實驗五回歸分析SAS進程_第1頁
實驗五回歸分析SAS進程_第2頁
實驗五回歸分析SAS進程_第3頁
實驗五回歸分析SAS進程_第4頁
實驗五回歸分析SAS進程_第5頁
已閱讀5頁,還剩17頁未讀 繼續(xù)免費閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認(rèn)領(lǐng)

文檔簡介

1、實驗五回歸分析SAS進程(2)實驗?zāi)康模? .會對實際問題成立有效的多元回歸模型,能對回歸模型進行殘差分析;2 .把握SAS輸出結(jié)果用于判別回歸方程優(yōu)良性的不同統(tǒng)計量,能對回歸模型進行 運用,對實際問題進行預(yù)測或操縱.實驗要求:編寫程序,結(jié)果分析.實驗內(nèi)容:1.誤差的正態(tài)性查驗有幾種方式,何時以為誤差項服從正態(tài)散布?答:1.學(xué)生化殘差2.殘差正態(tài)性的頻率查驗3.殘差的正態(tài)QQ圖查驗判定假設(shè)散點,大致在一條直線上之一力仇)一力相關(guān)系數(shù):戶一-廠一V 1-1/-I以為彳(i = l,2,來自正態(tài)散布,同意誤差正態(tài)性查驗.2 .回歸方程的選取的窮舉法中,評判回歸方程優(yōu)良性的準(zhǔn)那么有哪些?依照準(zhǔn)那 么

2、何時方程最優(yōu)?答:1)修正的復(fù)相關(guān)系數(shù)準(zhǔn)那么或均方殘差準(zhǔn)那么(心(p)或MS1紇準(zhǔn)那么)2) g準(zhǔn)那么3)預(yù)測平方和準(zhǔn)那么(PRE%,準(zhǔn)那么)擬合所有可能的-1個回歸方程,畫出C?圖:(p,Cp),在圖當(dāng)選取最接近參考 直線Cp= p的點所對應(yīng)的回歸方程為最優(yōu)方程.3 .簡述慢慢回歸方式的思想和步驟.大體思想:逐個引入自變量成立回歸方程,每次引入對丫阻礙最顯著的自變量,并對方程 中舊變量逐個進行查驗,把變成不顯著的變量逐個從方程中剔除掉,最終取得的方程中,既不 漏掉對丫顯著阻礙的變量,又不包括對丫阻礙不顯著的變量.添加或刪除某個自變量的準(zhǔn)那 么是用殘差平方和的相對減少或增加來衡量.步驟:(1)

3、修正的復(fù)相關(guān)系數(shù)準(zhǔn)那么、C”準(zhǔn)那么選擇模型(2)預(yù)測平方和準(zhǔn)那么選擇PRESSp最優(yōu)回歸方程(3)最優(yōu)模型的擬合查驗4 .做(選作)注意:能夠選課外綜合題目。程序:data examp2_6; input xl x2 y; cards;70656372818366758075797676697574858671647880747277818280808087 run;proc reg data= examp2_6;model y=xl-x2;output out=a p=predict r=resid h=h student=r;run;data b;set a;drop xl-x2;run;

4、proc print data=b;run;proc capability graphics noprint data=a; /* 對數(shù)據(jù)集 a 挪用 capability進程,高分辨圖,不打印輸出*/qqplot r/normal;/*作student數(shù)據(jù)的正態(tài)QQ圖*/run;goptions reset=all;/*將圖形的設(shè)置恢復(fù)為默許狀態(tài)*/proc gplot data=a;/*對數(shù)據(jù)集a作出畫高分辨的散點圖或曲線圖*/plot resid*predict; /*畫縱坐標(biāo)為殘差、橫坐標(biāo)為yi散點圖*/symbol v=dot i=none; /*散點表示符號圓點,不畫連線*/run

5、;/*此處至Quit是計算學(xué)生化殘差對應(yīng)的標(biāo)準(zhǔn)正態(tài)散布的分位數(shù)*/proc sort data=a;by r;/*按r排序*/proc iml;/*挪用iml矩陣分析模塊,計算數(shù)據(jù)*/use a;/*打開數(shù)據(jù)集a */read all varr into rr; /*讀入集a中變量r (學(xué)生化殘差)各觀測值到矩陣rr中*/do i=l to 31;/*此循環(huán)計算*/qi=probit (/;q=QObsypredictresi drh110.34.83775.462341.496490.11583210.34.55395.746151.602950.14721310.24.81705.3830

6、21.528460.17686416.415.87410.525880.139670.05919518.819.8690-1.06901-0.293680.12066619.721.0183-1.31833-0.369620.15575715.616.1927-0.59269-0.162280.11480818.219.2459-1.04595-0.276660.05148922.621.41301.186980.320900.092011019.920.1876-0.28758-0.075930.0479?1124.222.01542.184600.584770.073831221.021.

7、4685-0.46846-0.123690.048091321.421.4685-0.06846-0.OISOS0.048091421.320.50620.793850.212370.072761519.123.9541-4.85411-1.274690.037651622.227.8522-5.65220-1.482750.035671733.831.58402.216030.612500.131311827.433.8065-6.40648-1.783240.143461925.730.6010-4.90098-1.306850.066662024.928.6970-3.79704-1.1

8、013?0.211242134.534.38820.111820.029330.035812231.736.0083-4.30832-1.135960.045422336.335.38530.914740.241760.049952438.341.7690-3.46900-0.948030.111432542.644.8777-2.27770-0.608210.069312655.450.94294.457131.202600.088422755.752.22383.476250.941880.096032858.353.42854.871491.327570.106422951.553.89

9、93-2.39933-0.655110.109833051.053.8993-2.89933-0.791630.10983317?.O68.51538.484702.486140,22706SAS系統(tǒng)2008年08月01日 星期五 下午06時18分33秒2-Rnp-saa PV7 二 cvpes-10正態(tài)分位數(shù)4 GRAPHl WORJOGSKxGPlOT0:|五 00Residual*2艾里:R旬單統(tǒng)計里受里N均值標(biāo)準(zhǔn)差總和最小值最大宜R310.010311.036800.31962-1.783242.486140310.671720.62292-20.82318-2.272750.1624

10、3Pearson相關(guān)天數(shù), N = 3 當(dāng) HO: Rho=0 時,Prob >rlRQR1.000000.94091<.0001Q0.940911.00000<0001pY XI9X2YAYYa -1Y(A) = |,2*° A SS可為Z)SS旦人Z)5SZ;Za,) AInk 2 = 0lambdaO0.31200g車og月01日£ObsXIX2Z18.3703.4210728.6653.4210738.8633.40100410.5724.45205510.7814.78410610.8834.30105711.0664.33393811.0754

11、.70396911.1805.254511011.2754.926541111.3795.436251211.4765.063651311.4765.112281411.7695.100191512.0754.823501612.9745.207691712.9856.381521813.3865.776231913.7715.599252013.8645.513162114.0786.442762214.2806.192372314.5746.596412416.0726.761082516.3777.085992617.3817.971832717.5827-390532817.9808.

12、150352318.0807.721283018.0807.688223120.6879-17501SS£(A;Za) = (Z'A> )T (I - H)ZU) 55£(A;ZU) 2yO.31 _55£(2;Za>) A = 0.31 2 = 0.31 Z Z =Z X1,X”X?,X4 Z = X/7 +w031-Z = X/3 + s Z = XJ3 + s2008號08月OlE星電五下午06時18分33秒$The REC ProcXire枇 de I: HDDGL1Dependent Variable: ZMnber of fteer

13、vat ions? Read rnber of Cbzervat ions UsedVarisbeInterceptKIK?Parar»>?terEet irrdteStandard Errort ValuePr > |tl-2.948800.61162-6.6?<.0001fl.419400.0156526.80<.00010.040510.007715.26<.0001rroFieler 1st irr©tesAnjlys is of /oirionccSourceDF3un of Squaresfe?n SquareF Vain?Pr &

14、gt; FModalErrorCorroded Total2283064.651441.4800866.0314732,275720.95286SID.81<.0001Root M5E Depen5=rit Coeff VerMean0.223915.787083.872B2R-SquareAdj R-Sq0.37TB0.3780Z XPX7 £”a = l,2,31)Z正態(tài)分位數(shù)-enp-s3H psz'LuaprusPredicted Vilg of 2Z z R2 = 0.9776 Z Z = -2.84830+0.41940X, +0.04051X2 Z =仄+

15、儀/3?X/8Pearson Correlation Coefficients, N = 31Prob > |rI under HO: Rho=0RRQQRR1.000000.96990<.0001QQ0.96990<.”011.00000Parameter EstimatesVariableDFPa rameter EstimateStandard Errort VluePr > IIIIntercept1162.8759025.775656.32<.0001xl1-1.210320.30145-4.010.0007x21-0.665910.82100-0.81

16、0.4274z31-8.6130312.24125-0.700.4902Analysis of VarianceSourceDFSum ofSquaresMean SquareF ValuePr > FMode 134133.633221377.8777413.01<.0001Error192011.58417105.87285CorrectedTotal226145.21739Root MSE10.28845R-Square0.6727DependentMean61.34783Adj R-Sq0.6210Coeff Var16.77232Parameter EstimatesVa

17、riableDFParameter EstimateSUnda rd Errort ValuePr > ItlIntercept1162.8759025.775656.32<.0001xl1-1.210320.30145-4.010.0007x21-0.G65910.82100-0.810.4274x31-8.6130312.24125-0.700.4302Obsypredictresidrh14848.5888-0.5888-0.061500.1341825768.8628-11.8828-1.283030.1925536663.55102.44900.246820.070124

18、7068.44961.5504Q.172310.2352458984.84964.15040.452040.2037863642,6336-6.6336-0.781140.31S8374659.7986-13.7988-1.383010.0597785455.7768-1.7768-0.189980.17375g2633.6754-7.6754-0.917300.33870107776,39400.60600.063410141913.85811.549790.24478126754.867912.13211.214370-05728134761.3103-14.31

19、03-1.584700.22977145167.9538-16.8539-1.710280.07185155743.821513.17851.545200.31298166669.4430-3.4430-0.354040.1036217?964.112114.88791.628920.20905188880.78037.21970.7578202187-12.2187-1.238770.07809204941.67587.32410.811580.23078217?73.33963.68040.387620.15772n5246.02165.97840.665550.

20、23787236057.72702.27300.227750.05918正西分位效GRAPH! WDRK.GSEG.CAPAK11Prodictod Valufl o* ,Pearson 相關(guān)系數(shù),N = 23 , 當(dāng) HO: Rho=0 時,Prob > lr|RQR1.000000.96428<.0001Q0.964281.00000<.0001pY X1,X?,X3CpR;(p)2002年呢月01日星期五下午The REG ProcedureModel: NODEL1D&pendent Variable: 2C(p) Select ion MethodNumbe

21、r of Observations Read23Number of Observations Used23Number inModelC(p)R-SquareVariables in Model22.79670.6579xl x222.95180.6553xl x334.00000.B717xl x2 x316.53750.5587xl214.88530.4491乂2 x3115,05870.4115x311G.09640.3936乂 2R,P)R:(P)£Cp2002年呢月01日星期五下午The REQ ProcedureModel: MODEL1Dependent Variabl

22、e! zC(p) SeIect ion MethodNumber of Observations Read23Number of Observations Used23Number in Modelc(p)R-SquareVariables in Model22.78670.6578xl x222.95180.6553xl x334.00000.6717xl x2 x316.53750.5587xl214.88530.4491x2 x3115.05870.4115x3116.09640.3936x2Cp£ PRESSp=£d;(p)2003年08月01口星期立|、二MEAN

23、S PROCEDURE分析麥里:press Residual without Current Observation未校平方和1.8820041MEANS PROCEDURE分析受里:press Residual without Current Observation未校平方和2.4935484MEANS PROCEDURE分析變里:press Residual without Current Observation未檢平方和1.6531882MEANS PROCEDURE分析變里:press Residual without Current Observation未校平方和1.5890749

24、2008年08月01日星期五7MEANS PROCEDURE分析麥里:press Residual without Current Observation未校平方和2.8511881MEANS PROCEDURE分析愛里:press Residual without Current Observ&t ion未校平方和1.8059710Z =+ 自乂 + £200街08月01 m星期五F午OS時12分秒19Ihe REG PrccedjreModel: M0DEL1fependant Variable: 7Number of Observotions Read23Number

25、of Observations Used23Analysis of VarisncoSourceDFSurn of SquaresMeanSquareF ValuePr > FModel22.235811.1179019.23<.0001Error201.162440.05912CorrectedTotal228.83825iFbot MSE0.24108R-Square0.6579Dspcncfent 杷0n4.72242Adj R-$qB.G23?Cueff Ver5.10511Psrariter Eel i m?.tecVariableCFParanctcrEst imate

26、Standard Errort ValueFr > It IIntercept17.391450.5911212.50<.0001xl1-0.026990.00C88-3.930.9008z21-0.031510.01303-2.410.0256爐=0.6579 內(nèi)當(dāng)天 zZ = 739145-0.0269咯-0.0315% A = 0/ = 1x,(i<z:<5-i)r = A)+A +£ 8”=SSRXJMSE(Xk)“)=P(6(1,23 2)之耳)ZUUH耳U&月UI 口 壬即工The REG ProcedureModel: MODEL1dep

27、endent Variable: z3 Qu22Number of Observations ReadNumber of Observations UsedStepwise Selection: StepStatstics for Entry DF = 1,21VariableToleranceMode 1 R-SquareF ValuePr > Fx11.0000000.558726.59<0001x21.0000000.393613.630.0014x31.0000000.411514.680.0010and C(p) = 6.5375Variable xl Entered:

28、R-Square = 0.5587下21”.SSR(X J-=26.59F pX| p p = 0.0001<a£ =0.101 M Y = J3()+F Fq= i)/? = O.OOOl <aD =0,101 Z = Bo + 自吊 +£ Z 二/。+ 自吊 +£Ana lysis of VarianceSourceDFSum ofSquaresMean SquareF ValuePr > FMode 111.898721.8987228.59<.0001Error211.499530.07141Corrected Total223.3

29、982555(%) = 1.89872SS瓦X )=1.49953) = 0.07141 Z=/o+同M+eVariablePa rameterEsti mateStandardErrorType II SSF ValuePr > FIntercept6.086590.2722535.80742501.46<-0001xl-0.034690.006731.8987226.59<.0001Bounds on condition number: 1, 1y = 4+4X+& A = XJ = 2XX2yX3Y = j3()+PkXk+fiX1+h g c e 萬斤SS&a

30、mp;X/X)心成立以:& =。(八123"月“(M)",23 - 3)P不 S-乂)丁=p(F(l, 20) > 月)伏= 2,3) X2 F . MSE5,占> p p = 0.0258 <a£ =0.10 乂? x( XX2Y = p.y+pxX+p2X2+sStepwise Select ion: Step 2SUt ist ics for Entry DF = 1,20VariableToleranceModel R-SquareF ValuePr > Fx20.7822760.65795.800.0258x30.7523

31、000.65535.600.02S2Variable x2Entered! R-Square = 0.6579and C(p)=2.7967X,一尸=區(qū)=,_SSR(占_r: _XltX2F 1 MSE(XX。1' MSE(XX:) - p;r;p)=尸(尸(1,20)之百)p = P(F(1,20) > F) X3 F Fi -5-80P=0.0258<aD =0.10 x、,X2 X1,X?Y =d+4X1+dX?+8, A = XX2y 1 = 3Analysis of VarianceSum ofMeanSourceDFSquaresSquareF ValuePr

32、> F1.117900.0581219.23<.00012 o222.235811.162443.39825Mode IErrorCorrected TotalVariableParameter EstimateStandardErrorType II SSF ValuePr > FIntercept7.391450.591129.08751156.35<0001Xi-0.026980.006860.8983815.460.0008x2-0.031510.013080.337035.800.0258Bounds on condition number: 1.2783,

33、5.1133Statistics: for Removal DF 二 1,20VariablePartialR-SquareModel R-SquareF ValuePr > Fxl0.26440.393615.460.0008x20.08920.55875.800.0258XX2第三步,第二步選擇模型y=&+gX+&X2+£, a=x,x2, 1=3,3進:對不在模型中的自變量X3,逐個添加到此模型中,擬合相應(yīng)模型丫 =鳳+4乂4+力乂+&*2+&假設(shè)”0% ;瓦=0 (左= 1,2),計算各自偏x統(tǒng)計量3)= 5S/?(XJXpX2) F(1 234),相應(yīng)的 :3)= P(F(1,19) &g

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

最新文檔

評論

0/150

提交評論