版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、用最小二乘法求解線性模型及對(duì)模型的分析作者:鄧春亮1、研究30名兒童體重為因變量與身高為自變量的關(guān)系,兒童體重與身高的記錄如下表:編號(hào)體重Y (kg)身高X(cm)1213141516171819202122232425262728293022.6021.5019.1021.8021.5020.1018.8022.0021.3024.0023.3022.5022.9019.5022.9022.3022.7023.5021.5025.5025.0026.1027.9026.8027.2024.4024.4023.0026.3028.80119.80121.70121.40124.40120.00
2、117.00118.00118.80124.20124.80124.70123.10125.30124.20127.40128.20126.10128.60129.40126.90126.50128.20131.40130.80133.90130.40131.30130.20136.00138.00試用計(jì)算機(jī)完成下面統(tǒng)計(jì)分析:(1) 應(yīng)用最小二乘法求經(jīng)驗(yàn)回歸方程;(2) 以擬合值為橫坐標(biāo),殘差倉(cāng)為縱坐標(biāo),作殘差圖,分析Gauss-Markou假設(shè)對(duì)本例的適用性;ii1(3) 考慮因變量的變換=K2,再對(duì)新變量和X重復(fù)(1)和(2)的統(tǒng)計(jì)分析;(4) 將Box-Cox變換應(yīng)用到本例,計(jì)算變換參數(shù)
3、人的值,并做討論。說明:第一題的數(shù)據(jù)和結(jié)果文件見附件1,下面第二題的數(shù)據(jù)文件和結(jié)果文件見附件2,必要時(shí)可參看。解:(1)在SPSS窗口中錄入數(shù)據(jù),首先進(jìn)行異常值檢測(cè),探查對(duì)回歸估計(jì)有異常大影響的數(shù)據(jù)。先利用SPSS畫出體重與身高的散點(diǎn)圖26.00體28.0024.0022.0020.00圖IT從圖1可以看出沒有明顯不一致的點(diǎn)。也可以通過SPSS軟件計(jì)算COOK統(tǒng)計(jì)量,看下表表1T編號(hào)殘差e i學(xué)生化殘差ricenter hiiCOOK統(tǒng)計(jì)量Di11.883781.27241.05491.078352,03312,02204.02770.000023-2.24835-1.49944.03138.
4、077784-.73361-.48247.00489.004635,70477,47518.05161.010486,49003,34183.11182.009927-1.20506-.82971.08920.0480781.678871.14538.07294.078009-1.15460-.75974.00594.01180101.30835.85964.00310.0139711,64786.42576.00351.0034712,48000.31710.01355.0024713,01081.00710.00143.0000014-2.95460-1.94417.00594.07726
5、15-.81887-.53756.00139.0052016-1.73494-1.14067.00434.0254717-.50526-.33146.00008.0019018-.69298-.45611.00643.0043119-3.00905-1.98610.01183.09329201.978671.29824.00038.02940211.636701.07368.00003.01989222.065061.35771.00434.03608232.600781.73550.03249.10611241.737831.15517.02522.0415025,91306.62283.0
6、7268.0230026-.50413-.33434.02088.0032027-.85971-.57329.03121.0113428-1.82512-1.20912.01887.0402629-.81662-.57199.11878.0293530.89321.64671.17316.05442.從上面數(shù)據(jù)看殘差值和中心化的杠桿率center、的值沒有異常大的,數(shù)據(jù),這里(h = centerh +1/n), COOK統(tǒng)計(jì)量D,值也沒有異常大的數(shù)據(jù),一般來說,殘差值和杠桿率越大,COOK統(tǒng)計(jì)量就越大,殘差值和杠桿率越小,COOK統(tǒng)計(jì)量就越小??梢娺@些數(shù)據(jù)是比較一致的。接下來對(duì)這些數(shù)據(jù)求解經(jīng)
7、驗(yàn)回歸方程。然后利用最小二乘法,在SPSS中Analyze菜單下依次選擇Regress:2-Stage Least Square,選擇因變量和自變量 執(zhí)行可輸出結(jié)果如下表:表12MODEL: MOD_3.Equation number:1Dependent variable.體重丫Listwise Deletion of Missing DataMultiple RR SquareAdjusted R SquareStandard Error.80301.64483.632151.55047Analysis of Variance:DF Sum of SquaresMean SquareReg
8、ression1122.20765122.20765Residuals2867.311022.40396F =50.83587Signif F =.0000Variables in the Equation VariableB SE B BetaT Sig T身高 X.395087.055412.8030147.130 .0000(Constant) -26.6151547.007449-3.798 .0007Correlation Matrix of Parameter Estimates身高X身高X1.0000000這里可以看出所求經(jīng)驗(yàn)回歸方程的常數(shù)項(xiàng)(Constant)為-26.6151
9、54,身高X的系數(shù)為0.395087。故經(jīng)驗(yàn)回歸方程為:J. =-26.615154+0.395087 X(2)通過SPSS,可得擬合值與殘差如下表表1 3:擬合值與殘差表體重Y身高X擬合值寧i殘差ei22.60119.8020.716221.8837821.50121.7021.46688.0331219.10121.4021.34835-2.2483521.80124.4022.53361-.7336121.50120.0020.79523.7047720.10117.0019.60997.4900318.80118.0020.00506-1.2050622.00118.8020.3211
10、31.6788721.30124.2022.45460-1.1546024.00124.8022.691651.3083523.30124.7022.65214.6478622.50123.1022.02000.4800022.90125.3022.88919.0108119.50124.2022.45460-2.9546022.90127.4023.71887-.8188722.30128.2024.03494-1.7349422.70126.1023.20526-.5052623.50128.6024.19298-.6929821.50129.4024.50905-3.0090525.50
11、126.9023.521331.9786725.00126.5023.363301.6367026.10128.2024.034942.0650627.90131.4025.299222.6007826.80130.8025.062171.7378327.20133.9026.28694.9130624.40130.4024.90413-.5041324.40131.3025.25971-.8597123.00130.2024.82512-1.8251226.30136.0027.11662-.8166228.80138.0027.90679.89321以擬合值為橫坐標(biāo),殘差e為縱標(biāo),得殘差圖
12、3.000002.000001.00000-2.00000-3.00000-4.0000024.0000022.0000()0.00000-L00000圖12從圖中可以看出,殘差圖沒有明顯的不一致的征兆,則可以認(rèn)為Gauss-Markou假設(shè)e N(0,c 2I)對(duì)本例基本上是合理的。1(3)作變換U = Y2,這時(shí)用同樣的方法可求得經(jīng)驗(yàn)回歸方程為:七=-0.314471+0.040641 土其預(yù)測(cè)值與殘差如下表U擬合值殘差4.754.554264.554264.644.631484.631484.374.619294.619294.674.741214.741214.644.562394.5
13、62394.484.440474.440474.344.481114.481114.694.513624.513624.624.733084.733084.904.757474.757474.834.753404.753404.744.688384.688384.794.777794.777794.424.733084.733084.794.863134.863134.724.895654.895654.764.810304.810304.854.911904.911904.644.944414.944415.054.842814.842815.004.826564.826565.114.89
14、5654.895655.285.025705.025705.185.001315.001315.225.127305.127304.944.985054.985054.945.021635.021634.804.976934.976935.135.212645.212645.37.5.29392.5.29392.以擬合值為橫坐標(biāo),殘差e為縱坐標(biāo),作殘差圖得0.300000.200000.100000.000000.100004),20000-0.30000-0.40000從圖3看,此時(shí)的殘差圖也沒有明顯的不一致的趨勢(shì),認(rèn)為Gauss-Markou假設(shè)。 N(0,d)對(duì)本例基本上是合理的。(4)
15、將因變量K進(jìn)行Box-Cox變換,Y x-1ln Y,n變換后原來的因變量Y = G,七,,yn )變?yōu)閅(x)= (y仇),y仇),, 計(jì)算不同X值對(duì)應(yīng)的殘差平方和RSS (x, z(x)y(X) iX=1n缶料i =1這里分別取人,i = 1,2,7值為-13 -1,iRSS Ci, z(X) 這里 n=30,-0.5,0, 0.5, 1, 1.5,計(jì)算分別計(jì)算Z仇),然后計(jì)算對(duì)應(yīng)的殘差平方和 i計(jì)算得到z如表所示,這里Z,表示zi表15編號(hào)UZ1Z2Z3Z4Z5Z6Z714.751707.19513.21176.1772.2536.1421.6014.7424.641705.94511.
16、99174.9871.0935.0120.5013.6734.371702.58508.85172.0568.3532.4518.1011.4244.671706.30512.34175.3171.4235.3220.8013.9654.641705.94511.99174.9871.0935.0120.5013.6764.481704.11510.25173.3369.5333.5419.1012.3474.341702.09508.40171.6467.9832.1217.8011.1584.691706.53512.56175.5371.6335.5321.0014.1594.62170
17、5.70511.76174.7670.8834.8120.3013.48104.901708.57514.59177.5673.6437.5423.0016.14114.831707.91513.92176.8872.9636.8422.3015.44124.741707.08513.10176.0672.1536.0421.5014.64134.791707.50513.52176.4872.5636.4421.9015.04144.421703.22509.43172.5768.8332.8918.5011.79154.791707.50513.52176.4872.5636.4421.9
18、015.04164.721706.86512.89175.8571.9435.8421.3014.45174.761707.30513.31176.2772.3536.2421.7014.84184.851708.10514.12177.0773.1637.0422.5015.64194.641705.94511.99174.9871.0935.0120.5013.67205.051709.85515.91178.9275.0538.9924.5017.69215.001709.44515.49178.4874.5938.5124.0017.17225.111710.30516.39179.4
19、375.5939.5625.1018.33235.281711.54517.72180.8677.1341.2326.9020.27245.181710.81516.93180.0076.2040.2125.8019.08255.221711.08517.23180.3276.5440.5826.2019.51264.941708.93514.96177.9374.0337.9323.4016.55274.941708.93514.96177.9374.0337.9323.4016.55284.801707.61513.62176.5872.6636.5422.0015.14295.13171
20、0.45516.55179.5975.7639.7525.3018.54305.37.1712.08.518.32.181.52.77.87.42.04.27.80.21.27.通過SPSS軟件運(yùn)行得到的方差分析表,可知道相應(yīng)的殘差平方和,具體數(shù)據(jù)如下表所示:表16力-1.5-1-0.500.511.5RSS73.14370.51468.63867.492、67.05167.31168.277通過表6的簡(jiǎn)單比較可以看出當(dāng)人=0.5時(shí),殘差平方和RSS V,那)/達(dá)到最小,因此我們可以近似地認(rèn)為0.5就是變換參數(shù)人的最優(yōu)選擇.2、研究?jī)和捏w重K與身高X1和胸圍X2之間的關(guān)系是具有一定現(xiàn)實(shí)意義的
21、,因?yàn)檫@種關(guān)系使我們能夠用簡(jiǎn)單 的方法從X 1和X2的值去估計(jì)一個(gè)兒童的體重,下表是一組觀測(cè)數(shù)據(jù):表2-1編號(hào)體重Y身高X1胸圍X2122.60119.8060.50221.50121.7055.50319.10121.4056.50421.80124.4060.50521.50120.0057.70620.10117.0057.00718.80118.0057.10822.00118.8061.70921.30124.2058.401024.00124.8060.801123.30124.7060.001222.50123.1060.001322.90125.3065.201419.5012
22、4.2053.701522.90127.4059.501622.30128.2060.101722.70126.1057.401823.50128.6060.401921.50129.4052.002025.50126.9061.502125.00126.5063.902226.10128.2063.002327.90131.4063.102426.80130.8061.502527.20133.9065.802624.40130.4062.602724.40131.3059.502823.00130.2062.502926.30136.0060.003028.80138.0063.70試用計(jì)
23、算機(jī)完成下面的統(tǒng)計(jì)分析:(1) 先假設(shè)Y與X和X有如下線性關(guān)系:Y = a +。X +p X + e,做最小二乘分析,并做相應(yīng)的殘差圖。 121122試計(jì)算Box-Cox變換參數(shù)的力值.(2) 對(duì)(1)中計(jì)算出的變換參數(shù)人值,做相應(yīng)的Box-Cox變換,并對(duì)變換后的因變量做對(duì)X1和X2的最小二 乘回歸,并做殘差圖。解:先計(jì)算中心化杠桿率center h和COOK統(tǒng)計(jì)量D的值表2-1編號(hào)擬合值1殘差2i學(xué)生化殘差ricenter hiiCOOK統(tǒng)計(jì)量Di121.517031.08297.99976.07509.04052220.275301.224701.12888.07238.05021320
24、.54753-1.44753-1.31902.05156.05380422.89020-1.09020-.97103.00889.01386520.56375.93625.85394.05330.02305619.41496.68504.64630.11302.02387719.74965-.94965-.88474.09125.03713821.65266.34734.33076.12873.00705922.07076-.77076-.68711.01058.007231023.11814.88186.78544.00882.009051122.79886.50114.44527.0041
25、8.002581222.32124.17876.15985.01640.000451324.85923-1.95923-1.85996.12356.214591420.37038-.87038-.83580.14264.049731523.42396-.52396-.46553.00413.002811623.87984-1.57984-1.40437.00510.026271722.27615.42385.38119.02725.003121824.10778-.60778-.54071.00666.004061921.30763.19237.21088.33436.008622023.99
26、8271.501731.33663.00754.025382124.74713.25287.23152.06029.001852224.929011.170991.05440.02950.024842325.920431.979571.79703.04463.091022425.162471.637531.47137.02553.045142527.64352-.44352-.42282.13059.011682625.44102-1.04102-.93760.02995.019802724.58817-.18817-.17089.04540.000832825.34514-2.34514-2
27、.10925.02738.095852926.17207.12793.12316.14686.001113028.10769.69231.67800.17443.04018從表中2-1的計(jì)算結(jié)果可以看出,第19個(gè)觀測(cè)的杠桿率最高為0.33436.。因此,第19個(gè)樣本點(diǎn)最有可能對(duì)模型擬合造成較大的影響。然后求解經(jīng)驗(yàn)回歸方程,從運(yùn)行結(jié)果的方差分析表2-2(ANOVA(b)可以看出F統(tǒng)計(jì)量的P-值(Sig.)為0.000, 這表明模型在總體中是顯著的。表 2-2 ANOVA(b)ANOVA bMo de lSu m of Squ aresdfMe an Squ areFSig.1Regression
28、153.984276.9 9258.5 01.000aResidu al35.5 34271.31 6To tal189.51929Pre dicto rs: (Con sta nt),胸圍X2,身高X1Dep end ent Va ria ble :體重丫表2-3Coefficie ntsaMo de lUnstan dard ize d Coe fficie ntsSta nd ard ize d Coe fficie ntstSig.BStd. Erro rBe ta1(Co nstan t)-36.1335.53 5-6 .528.000身高X1.299.045.6076.56 5.0
29、00胸圍X2.362.074.4544.91 4.000a. Dep end ent Va ria ble : 體重Y從回歸系數(shù)計(jì)算分析表2-3 (Coefficients(a),可知道回歸方程的常數(shù)項(xiàng)為-36.133,自變量身高和胸圍相對(duì) 應(yīng)的未標(biāo)準(zhǔn)化的回歸系數(shù)(Unstandardized Coefficients)分別為0.299、0.362,因而回歸方程為y = 36.133 + 0.299氣.+ 0.362七.且從表中可知3個(gè)系數(shù)的t統(tǒng)計(jì)量的P值均為0.000,這表明模型在總體中是顯著的。以擬合值為橫坐標(biāo),殘差e為縱坐標(biāo),作殘差圖:圖2-1殘差圖2.000001.000000. 00
30、000-1.00000-2.00000-3. 0000015. 0000018. 0000021. 0000024. 0000027. 0000030. 00000Unstandardized Predicted Value從圖2-1可以看出,殘差圖從左至右逐漸散開呈漏斗狀,這是誤差方差不相等的征兆。考慮將因變量K進(jìn)行Box-Cox 變換,跟第一題的(4)問同樣。這里同樣分別取七,i = 1,2,7值為-1.5, -1,-0.5, 0,0.5, 1,1.5,計(jì)算分別計(jì) 算z),然后計(jì)算對(duì)應(yīng)的殘差平方和RSS G, z仇),這里n=30,計(jì)算得到小如表1-5所示,然后計(jì)算對(duì)應(yīng)自變量% 和X2的殘
31、差平方和RSS G, z仇)。得Z2Z7方差分析表如下ANOVbModelSum of SquaresdfMean SquareFSig.1Regression151.509275.75453.967.000Residual37.900271.404Total189.40929a- Predictors: (Constant胸圍X2,身高1 b. Dependent Variable: Z1ANOVbModelSum of SquaresdfMean SquareFSig1Regression150.580275.29056.081.000Residual36.248271.343Total1
32、86.82829a- Predictors: (Constant胸圍X2,身高1 b. Dependent Variable: Z2ANOVAModelSum of SquaresdfMean SquareFSig.1Regression150.361275.18057.657.000Residual35.206271.304Total185.56729Predictors: (Constant胸圍2,身高1Dependent Variable: Z3ANOVAModelSum of SquaresdfMean SquareFSig.1Regression150.852275.42658.61
33、0.000Residual34.747271.287Total185.59829Predictors: (Constant)胸圍2,身高1Dependent Variable: Z4ANOVAModelSum of SquaresdfMean SquareFSig.1Regression152.051276.02658.889.000Residual34.857271.291Total186.90929Predictors: (Constant胸圍2,身高1Dependent Variable: Z5ANOVAModelSum of SquaresdfMean SquareFSig.1Regr
34、ession153.984276.99258.501?00OResidual35.534271.316Total189.51929Predictors: (Constant胸圍2,身高1Dependent Variable: Z6ANOVbModelSum of SquaresdfMean SquareFSig1Regression156.674278.33757.496.000Residual36.787271.362Total193.46129a- Predictors: (Constant胸圍X2,身高1 b. Dependent Variable: Z7從上面的方差分析表中可以得到人,
35、i = 1,2, ,7對(duì)應(yīng)的殘差平方和RSS i表2-4力-1.5-1-0.500.511.5RSS37.90036.24835.20634.74734.85735.53436.787從這個(gè)表中可的簡(jiǎn)單比較可以看出當(dāng)X = 0時(shí),殘差平方和RSS V,z(打=34.747達(dá)到最小,而X = 0.5對(duì)應(yīng)的 殘差平方和次之為34.857,且從的方差分析表可知它們對(duì)應(yīng)的P值都為0.000,都具有顯著性?,F(xiàn)在再看人=0和 人=0.5時(shí),對(duì)應(yīng)因變量彳和彳對(duì)應(yīng)的回歸系數(shù)分析表。Coefficients*ModelUnstan(Coeffdardized cientsStandardized Coeffic
36、ientstSig.BStd. ErrorBeta1(Constant)身高X1胸K214.092.290.3675.473.045.073.596.4662.5756.4585.044.016.000.000a. Dependent Variable: Z4Coefficients*ModelUnstan(Coeffdardized cientsStandardized CoefficientstSig.BStd. ErrorBeta1(Constant)身高X1胸K2-22.235.294.3645.482.045.073.602.460-4.0566.5304.994.000.000.000a. D
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025年度國(guó)際勞務(wù)派遣勞動(dòng)合同匯編3篇
- 胡克定律課程設(shè)計(jì)
- 職校數(shù)控技術(shù)課程設(shè)計(jì)
- 二零二五年國(guó)際貿(mào)易函電范文及服務(wù)條款合同6篇
- 2025版航空客運(yùn)服務(wù)人員聘用合同協(xié)議3篇
- 2025版國(guó)際房地產(chǎn)投資開發(fā)合同書范本3篇
- 二零二五年度個(gè)人委托代繳社保及企業(yè)年金補(bǔ)充管理合同3篇
- 植物的變化課程設(shè)計(jì)
- 2024年股權(quán)激勵(lì)合同業(yè)績(jī)指標(biāo)設(shè)定及獎(jiǎng)勵(lì)發(fā)放協(xié)議
- 2024煤礦安全生產(chǎn)信息化平臺(tái)建設(shè)與運(yùn)營(yíng)合同2篇
- 艦艇損害管制與艦艇損害管制訓(xùn)練
- 常見年宵花春節(jié)期間養(yǎng)護(hù)攻略
- 安全安全技術(shù)交底模板
- 2021年河南學(xué)業(yè)水平考試 pyton操作題代碼以及 Python基礎(chǔ)知識(shí)點(diǎn)
- 整本書閱讀《鄉(xiāng)土中國(guó)》課件+2024-2025學(xué)年統(tǒng)編版高中語(yǔ)文必修上冊(cè)
- 夏天奔跑的聲音(2022年浙江杭州中考語(yǔ)文試卷記敘文閱讀題及答案)
- 人力資源許可證制度(服務(wù)流程、服務(wù)協(xié)議、收費(fèi)標(biāo)準(zhǔn)、信息發(fā)布審查和投訴處理)
- 延期留用崗位協(xié)議書模板
- 借條的正規(guī)模板(2024版)
- 人教PEP版小學(xué)英語(yǔ)六年級(jí)上冊(cè)Unit1-6單元單元檢測(cè)試卷(含聽力材料)
- 銷售合同編號(hào)規(guī)則(2024版)
評(píng)論
0/150
提交評(píng)論