spss数据统计分析与实践 第十五章:加权最小二乘法(weighted least squares)

上传人:marr****208 文档编号:116673304 上传时间:2019-11-17 格式:DOC 页数:16 大小:172KB
返回 下载 相关 举报
spss数据统计分析与实践 第十五章:加权最小二乘法(weighted least squares)_第1页
第1页 / 共16页
spss数据统计分析与实践 第十五章:加权最小二乘法(weighted least squares)_第2页
第2页 / 共16页
spss数据统计分析与实践 第十五章:加权最小二乘法(weighted least squares)_第3页
第3页 / 共16页
spss数据统计分析与实践 第十五章:加权最小二乘法(weighted least squares)_第4页
第4页 / 共16页
spss数据统计分析与实践 第十五章:加权最小二乘法(weighted least squares)_第5页
第5页 / 共16页
点击查看更多>>
资源描述

《spss数据统计分析与实践 第十五章:加权最小二乘法(weighted least squares)》由会员分享,可在线阅读,更多相关《spss数据统计分析与实践 第十五章:加权最小二乘法(weighted least squares)(16页珍藏版)》请在金锄头文库上搜索。

1、SPSS数据统计分析与实践 第十五章:加权最小二乘法(Weighted Least Squares)SPSS数据统计分析与实践主讲:周涛副教授北京师范大学资源学院2007-12-4教学网站:/ Least Squares)本章内容:一、最小二乘法的应用领域z根据需要人为地改变观测量的权重zRemedial Measures for Unequal Error Variances二、SPSS提供的WLS过程zLinear Regression procedure (with weight variable)zWeight Estimation procedure三、相关输出结果的比较zOLS与W

2、LS比较zSPSS提供的两种WLS方法比较加权最小二乘法应用(一)根据需要人为地改变观测量的权重根据需要人为地改变观测量的权重实例实验中收集的15对数据,每对数据都是将n份样品混合后测得的平均结果,但各对数据的n大小不等,试求出X对Y的线性方程。数据源:郭祖超,医用数理统计方法第三版P249根据需要人为地改变观测量的权重实例bModel Summary方法一:如果不考虑AdjustedStd. Error ofModelRR SquareR Squarethe Estimatea1.987.975.973.11330样品混合量的差a. Predictors: (Constant), xb. D

3、ependent Variable: y异,则该问题是一个非常简单的线性aCoefficientsUnstandardizedStandardized回归问题,可直接CoefficientsCoefficientsModelBStd. ErrorBetatSig.1(Constant)7.454.17343.143.000拟合回归方程,结x-.015.001-.987-22.468.000a. Dependent Variable: y果如下:2Y = 7.45 0.015 * X (R=0.98) 根据需要人为地改变观测量的权重实例方法二:由于每对测量数据都是将n份样品混合后测得结果,显然混

4、合的样品越多,测得的结果越稳定,即变异越小。如果直接拟合方程,则是将所有测量值均一视同仁,1份样品的测量结果与15份样品混合后的测量结果等价对待,这显然不太合理。为此可以考虑在分析中将样品数n作为权重变量,n值越大的观测量在计算中给予的权重越高,对方程的影响越大,即按照加权最小二乘法来拟合回归方程。根据需要人为地改变观测量的权重实例zSPSS操作步骤:zAnalyze?Regression?LinearzDependent: YzIndependent: XzWLS Weight: nWLS WeightWLS: Weighted Least SquaresWLS 输出结果b,cModel S

5、ummaryAdjustedStd. Error ofModelRR SquareR Squarethe Estimatea1.982.965.962.29365a. Predictors: (Constant), xb. Dependent Variable: yc. Weighted Least Squares Regression - Weighted by na,bCoefficientsUnstandardizedStandardizedCoefficientsCoefficientsModelBStd. ErrorBetatSig.1(Constant)7.190.18838.31

6、6.000x-.014.001-.982-18.7.000a. Dependent Variable: yb. Weighted Least Squares Regression - Weighted by n2Y = 7.19 0.014 * X (R=0.97) WLS 与OLS 输出结果比较1.在OLS中,测定系数为0.975, 而在WLS中测定系数降低为0.965。2.由于测定系数是按照普通最小二乘法进行计算,因此加权后的方程测定系数必然小于普通最小二乘法,即此时不能使用测定系数来判断模型的优劣。WLS 与OLS 输出结果比较3. 通过绘制OLS和WLS的回归直线加以比较,如下图所示,

7、WLS更靠近中部那些混合样品数据n较大的测量值,而对两端n较小的测量值则比OLS回归直线更远一些,显然这些测量值在计算时对方程的影响程度是不同的。实现WLS的另一种方法z事实上,如果使用SPSS的Weight Case过程,将n指定为频数变量,然后进行普通的线性回归,得到的分析结果与上述加权最小二乘法完全相同。z操作过程如下所示:实现WLS的另一种方法步骤:(1)调用Weight Case过程Data?WeightCases)(2)调用线性回归过程(采用OLS)实现WLS的另一种方法输出结果b,cModel SummaryAdjustedStd. Error ofModelRR SquareR

8、 Squarethe Estimatea1.982.965.962.29365a. Predictors: (Constant), xb. Dependent Variable: yc. Weighted Least Squares Regression - Weighted by na,bCoefficientsUnstandardizedStandardizedCoefficientsCoefficientsModelBStd. ErrorBetatSig.1(Constant)7.190.18838.316.000x-.014.001-.982-18.000a. Dependent Va

9、riable: yb. Weighted Least Squares Regression - Weighted by n2Y = 7.19 0.014 * X (R=0.97) 加权最小二乘法应用(二)Unequal Error Variances Remedial Measures-Weighted Least SquaresVariation of Errors Around the Regression Line1. y values are normallydistributed around the regression line.f(e)2. For each x value,

10、the “spread”or variance around the regression line is the same.YX2X1XRegression LineEqual Error VariancesY=+X+X+K+X+(1)i01i12i2p?1i,p?1i,Kare parameters01p?1are known constantsX,X,K,Xi1i2i,p?12N(0,)are independentiEqual error i=1,L,nvariance?1b=(XX)XY(2)p1ppp1ppUnequal Error VariancesY=+X+X+K+X+(3)i

11、01i12i2p?1i,p?1i,Kare parameters01p?1X,X,Kare known constants,Xi1i2i,p?12N(0,)are independentiiUnequal error i=1,L,nvariance2?0K01?20K02?2=?nnMMM?2?00K?n?Unequal Error VarianceszThe estimation of the regression coefficients in generalized model (3)could be done by using the estimators in (2)for regr

12、ession model (1)with equal error variances. These estimators are still unbiased and consistent for model (3),but they no longer have minimum variance.zTo obtain unbiased estimators with minimum variance, we must take into account that the different Y observations for the n cases no longer have the s

13、ame reliability.zObservations with small variances provide more reliable informationabout the regression function than those with large variances.Error Variances KnownError Variances KnownWe first consider the estimation of the regression 2function coefficients when the error variance iare known. Th

14、is case is usually unrealistic, but it provides guidance as to how to proceed when the error variances are not know.Error Variances Known2When the error variances are known, we can use ithe method of maximum likelihoodto obtain estimators of the regression coefficients in (3).n112L()=exp?(Y?X?K?X)i0

15、1i1p?1i,p?121(4)/22(2)2i=1iiwhere denotes the vector of the regression coefficients. We define the2reciprocal of the variance as the weight w:ii1w=(5)i2inn?w?1?81/22iL()=()exp?w(Y?X?K?X)ii01i1p?1i,p?1(6)?22?i=11?Error Variances KnownWe find the maximum likelihood estimators of the regression coefficients by maximizing L()in formula (6),K,with respect to.01p?1nn?w?1?81/22iL()=()exp?w(Y?

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 大杂烩/其它

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号