sas習(xí)題大全帶程序編碼_第1頁
sas習(xí)題大全帶程序編碼_第2頁
sas習(xí)題大全帶程序編碼_第3頁
sas習(xí)題大全帶程序編碼_第4頁
sas習(xí)題大全帶程序編碼_第5頁
已閱讀5頁,還剩32頁未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

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

文檔簡介

1、P265 1今有某種型號(hào)的電池三批,它們分別是A、B、C三個(gè)工廠所生產(chǎn)的,為評(píng)比其質(zhì)量,各隨機(jī)抽取5只電池為樣品,經(jīng)試驗(yàn)得其壽命(h)如下:ABC40 4248 453826 2834 323039 5040 5043試在顯著性水平0.05下檢驗(yàn)電池的平均壽命有無顯著的差異,若差異是顯著的,試求均差A(yù)-B,A-C和B-C的置信水平為95%的置信區(qū)間。代碼:data l1; do b=1 to 5;do a=1 to 3;input x;output;end;end;cards;40 26 39 42 28 50 48 34 40 45 32 50 38 30 43proc anova;clas

2、s a;model x=a;run;結(jié)果輸出:The SAS System 19:15 Friday, April 9, 2012 5 The ANOVA Procedure Class Level Information Class Levels Values a 3 1 2 3 Number of observations 15The SAS System 19:15 Friday, April 9, 2012 6 The ANOVA ProcedureDependent Variable: x Sum of Source DF Squares Mean Square F Value Pr

3、 > F Model 2 615.6000000 307.8000000 17.07 0.0003 Error 12 216.4000000 18.0333333 Corrected Total 14 832.0000000 R-Square Coeff Var Root MSE x Mean 0.739904 10.88863 4.246567 39.00000 Source DF Anova SS Mean Square F Value Pr > F a 2 615.6000000 307.8000000 17.07 0.0003結(jié)論:結(jié)論:在顯著水平為0.05下0.0003&

4、lt;0.05,所以各個(gè)總體均值間有顯著差異。代碼:data l1;p265 1 (ua-ub)input lei n;do rep= 1 to n;input x;output;end;cards;1 540 42 48 45 382 526 28 34 32 30;proc ttest;class lei;var x;run;結(jié)果輸出:The SAS System 19:15 Friday, April 9, 2012 25 The TTEST Procedure Statistics Lower CL Upper CL Lower CL Upper CL Variable lei N M

5、ean Mean Mean Std Dev Std Dev Std Dev Std Err x 1 5 37.664 42.6 47.536 2.3815 3.9749 11.422 1.7776 x 2 5 26.074 30 33.926 1.8946 3.1623 9.087 1.4142 x Diff (1-2) 7.3618 12.6 17.838 2.426 3.5917 6.8808 2.2716 T-Tests Variable Method Variances DF t Value Pr > |t| x Pooled Equal 8 5.55 0.0005 x Satt

6、erthwaite Unequal 7.62 5.55 0.0006 Equality of Variances Variable Method Num DF Den DF F Value Pr > F x Folded F 4 4 1.58 0.6685 代碼:data l1;(p265 1 ub-uc)input lei n;do rep= 1 to n;input x;output;end;cards;1 526 28 34 32 302 539 50 40 50 43;proc ttest;class lei;var x;run;結(jié)果輸出:The SAS System 19:08

7、 Friday, April 23, 2012 1 The TTEST Procedure Statistics Lower CL Upper CL Lower CL Upper CL Variable lei N Mean Mean Mean Std Dev Std Dev Std Dev Std Err x 1 5 26.074 30 33.926 1.8946 3.1623 9.087 1.4142 x 2 5 37.795 44.4 51.005 3.1873 5.3198 15.287 2.3791 x Diff (1-2) -20.78 -14.4 -8.018 2.9558 4.

8、3761 8.3835 2.7677 T-Tests Variable Method Variances DF t Value Pr > |t| x Pooled Equal 8 -5.20 0.0008 x Satterthwaite Unequal 6.51 -5.20 0.0016 Equality of Variances Variable Method Num DF Den DF F Value Pr > F x Folded F 4 4 2.83 0.3378 代碼:data l1;(p265 1 ua-uc)input lei n;do rep= 1 to n;inp

9、ut x;output;end;cards;1 540 42 48 45 382 539 50 40 50 43;proc ttest;class lei;var x;run;結(jié)果輸出:The SAS System 19:15 Friday, April 9, 2012 28 The TTEST Procedure Statistics Lower CL Upper CL Lower CL Upper CL Variable lei N Mean Mean Mean Std Dev Std Dev Std Dev Std Err x 1 5 37.664 42.6 47.536 2.3815

10、3.9749 11.422 1.7776 x 2 5 37.795 44.4 51.005 3.1873 5.3198 15.287 2.3791 x Diff (1-2) -8.648 -1.8 5.0485 3.1718 4.6957 8.996 2.9698 T-Tests Variable Method Variances DF t Value Pr > |t| x Pooled Equal 8 -0.61 0.5613 x Satterthwaite Unequal 7.41 -0.61 0.5626 Equality of Variances Variable Method

11、Num DF Den DF F Value Pr > F x Folded F 4 4 1.79 0.5862結(jié)論:在置信水平為95%的置信區(qū)間。ua-uc、ua-ub、ub-uc分別為(-7.65,4.05)、(6.75,18.45)、(-20.25,-8.55).p 265 2為了尋找飛機(jī)控制面板上儀器表的最佳布置,試驗(yàn)了三個(gè)方案,觀察領(lǐng)航在緊急情況的反應(yīng)時(shí)間(以1/10秒記),隨機(jī)地選擇28名領(lǐng)航員,得到他們對(duì)于不同的布局方案的反應(yīng)時(shí)間如下:方案14 13 9 15 11 13 14 11方案10 12 7 11 8 12 9 10 13 9 10 9方案11 5 9 10 6 8

12、 8 7試在顯著性水平0.05下檢驗(yàn)各個(gè)方案的反應(yīng)時(shí)間有無顯著的差異,若有差異,試求1-2,1-3,2-3的置信水平為0.95的置信區(qū)間。代碼:data l1;(p 265 2)input type$ n;do i=1 to n;input x;output;end;cards;M1 814 13 9 15 11 13 14 11M2 1210 12 7 11 8 12 9 10 13 9 10 9M3 811 5 9 10 6 8 8 7;proc anova;class type;model x = type;run;結(jié)果輸出:The SAS System 19:10 Friday, Ap

13、ril 16, 2012 1 The ANOVA Procedure Class Level Information Class Levels Values type 3 M1 M2 M3 Number of observations 28The SAS System 19:10 Friday, April 16, 2012 2 The ANOVA ProcedureDependent Variable: x Sum of Source DF Squares Mean Square F Value Pr > F Model 2 81.4285714 40.7142857 11.31 0.

14、0003 Error 25 90.0000000 3.6000000 Corrected Total 27 171.4285714 R-Square Coeff Var Root MSE x Mean 0.475000 18.70643 1.897367 10.14286 Source DF Anova SS Mean Square F Value Pr > F type 2 81.42857143 40.71428571 11.31 0.0003結(jié)論:在顯著水平為0.05下0.0003<0.05,所以各個(gè)方案的反應(yīng)時(shí)間有著明顯的差異。代碼:data l1;(p265 2 u1-u

15、2)input lei n;do rep= 1 to n;input x;output;end;cards;1 814 13 9 15 11 13 14 112 1210 12 7 11 8 12 9 10 13 9 10 9;proc ttest;class lei;var x;run;結(jié)果輸出:The SAS System 19:08 Friday, April 23, 2012 2 The TTEST Procedure Statistics Lower CL Upper CL Lower CL Upper CL Variable lei N Mean Mean Mean Std Dev

16、 Std Dev Std Dev Std Err x 1 8 10.828 12.5 14.172 1.3223 2 4.0705 0.7071 x 2 12 8.883 10 11.117 1.2454 1.7581 2.985 0.5075 x Diff (1-2) 0.7203 2.5 4.2797 1.4024 1.8559 2.7446 0.8471 T-Tests Variable Method Variances DF t Value Pr > |t| x Pooled Equal 18 2.95 0.0085 x Satterthwaite Unequal 13.7 2.

17、87 0.0125 Equality of Variances Variable Method Num DF Den DF F Value Pr > F x Folded F 7 11 1.29 0.6738結(jié)論:u1-u2,u1-u3,u2-u3的置信水平為0.95的置信區(qū)間為(0.72,4.28),(2.55,6.45),(0.22,3)代碼:data l1;(p265 2 u1-u3)input lei n;do rep= 1 to n;input x;output;end;cards;1 814 13 9 15 11 13 14 112 811 5 9 10 6 8 8 7;pr

18、oc ttest;class lei;var x;run;結(jié)果輸出:The SAS System 19:08 Friday, April 23, 2012 3 The TTEST Procedure Statistics Lower CL Upper CL Lower CL Upper CL Variable lei N Mean Mean Mean Std Dev Std Dev Std Dev Std Err x 1 8 10.828 12.5 14.172 1.3223 2 4.0705 0.7071 x 2 8 6.328 8 9.672 1.3223 2 4.0705 0.7071

19、x Diff (1-2) 2.3552 4.5 6.6448 1.4643 2 3.1542 1 T-Tests Variable Method Variances DF t Value Pr > |t| x Pooled Equal 14 4.50 0.0005 x Satterthwaite Unequal 14 4.50 0.0005 Equality of Variances Variable Method Num DF Den DF F Value Pr > F x Folded F 7 7 1.00 1.0000結(jié)論:代碼:data l1;(p265 2 u2-u3)i

20、nput lei n;do rep= 1 to n;input x;output;end;cards;1 1210 12 7 11 8 12 9 10 13 9 10 92 811 5 9 10 6 8 8 7;proc ttest;class lei;var x;run;結(jié)果輸出:The SAS System 19:08 Friday, April 23, 2012 4 The TTEST Procedure Statistics Lower CL Upper CL Lower CL Upper CL Variable lei N Mean Mean Mean Std Dev Std Dev

21、 Std Dev Std Err x 1 12 8.883 10 11.117 1.2454 1.7581 2.985 0.5075 x 2 8 6.328 8 9.672 1.3223 2 4.0705 0.7071 x Diff (1-2) 0.2203 2 3.7797 1.4024 1.8559 2.7446 0.8471 T-Tests Variable Method Variances DF t Value Pr > |t| x Pooled Equal 18 2.36 0.0297 x Satterthwaite Unequal 13.7 2.30 0.0378 Equal

22、ity of Variances Variable Method Num DF Den DF F Value Pr > F x Folded F 7 11 1.29 0.6738結(jié)論:p265 3某防治站對(duì)4個(gè)林場的松毛蟲密度進(jìn)行調(diào)查,每個(gè)林場調(diào)查5塊地得資料如下表:地點(diǎn)松毛蟲密度(頭/標(biāo)準(zhǔn)地)A1192 189 176 185 190A2190 201 187 196 200A3188 179 191 183 194A4187 180 188 175 182判斷4個(gè)林場松毛從密度有無顯著差異,取顯著性水平=0.05.代碼:data l1;(p265 3)do b=1 to 5;do a

23、=1 to 4;input x;output;end;end;cards;192 190 188 187 189 201 179 180 176 187 191 188 185 196 183 175 190 200 194 182proc anova;class a;model x=a;run;結(jié)果輸出:The SAS System 19:15 Friday, April 9, 2012 7 The ANOVA Procedure Class Level Information Class Levels Values a 4 1 2 3 4 Number of observations 20

24、The SAS System 19:15 Friday, April 9, 2012 8 The ANOVA ProcedureDependent Variable: x Sum of Source DF Squares Mean Square F Value Pr > F Model 3 403.3500000 134.4500000 3.77 0.0321 Error 16 571.2000000 35.7000000 Corrected Total 19 974.5500000 R-Square Coeff Var Root MSE x Mean 0.413883 3.184091

25、 5.974948 187.6500 Source DF Anova SS Mean Square F Value Pr > F a 3 403.3500000 134.4500000 3.77 0.0321結(jié)論:P265 4一試驗(yàn)用來比較4種不同藥品解除外科手術(shù)后疼痛的延長時(shí)間(h),結(jié)果如下表:藥品時(shí)間長度(h)A8642B6644C810101012D442試在顯著性水平=0.05下檢驗(yàn)各種藥品對(duì)解除疼痛的延續(xù)時(shí)間有無顯著差異。代碼:data l1;(P265 4)input type$ n;do i=1 to n;input x;output;end;cards;M1 48 6

26、4 2M2 46 6 4 4 M3 58 10 10 10 12M4 34 4 2;proc anova;class type;model x = type;run;結(jié)果輸出:The SAS System 19:15 Friday, April 9, 2012 35 The ANOVA Procedure Class Level Information Class Levels Values type 4 M1 M2 M3 M4 Number of observations 16The SAS System 19:15 Friday, April 9, 2012 36 The ANOVA Pr

27、ocedureDependent Variable: x Sum of Source DF Squares Mean Square F Value Pr > F Model 3 108.3333333 36.1111111 12.50 0.0005 Error 12 34.6666667 2.8888889 Corrected Total 15 143.0000000 R-Square Coeff Var Root MSE x Mean 0.757576 27.19477 1.699673 6.250000 Source DF Anova SS Mean Square F Value P

28、r > F type 3 108.3333333 36.1111111 12.50 0.0005結(jié)論:P266 5將抗生素注入人體會(huì)產(chǎn)生抗生素與血漿蛋白質(zhì)結(jié)合的現(xiàn)象。以致減少了藥效,下表列出5種常用的抗生素注入到牛的體內(nèi)時(shí),抗生素與血漿蛋白質(zhì)結(jié)合的百分比。試在水平=0.05下檢驗(yàn)這些百分比的均值有無顯著的差異。青霉素四環(huán)素鏈霉素紅霉素氯霉素29.627.35.821.629.224.332.66.217.432.828.530.811.018.325.032.034.88.319.024.2代碼:data l1;do b=1 to 4;do a=1 to 5;input x;output

29、;end;end;cards;29.6 27.3 5.8 21.6 29.2 24.3 32.6 6.2 17.4 32.8 28.5 30.8 11.0 18.3 25.0 32.0 34.8 8.3 19.0 24.2proc anova;class a;model x=a;run;結(jié)果輸出:The SAS System 19:15 Friday, April 9, 2012 9 The ANOVA Procedure Class Level Information Class Levels Values a 5 1 2 3 4 5 Number of observations 20The

30、 SAS System 19:15 Friday, April 9, 2012 10 The ANOVA ProcedureDependent Variable: x Sum of Source DF Squares Mean Square F Value Pr > F Model 4 1480.823000 370.205750 40.88 <.0001 Error 15 135.822500 9.054833 Corrected Total 19 1616.645500 R-Square Coeff Var Root MSE x Mean 0.915985 13.12023 3.009125 22.93500 Source DF Anova SS Mean Square F Value Pr > F a 4 1480.823000 370.205750 40.88 <.0001結(jié)論:P266 6下表給出某種化工過程在三種濃度、四種溫度水平下得率的數(shù)據(jù):溫度(因素B)10243852濃度(因素A)2%14 1011 1113 910 124% 9 710 8 7 11 6 106% 5 1113 1412 1314 10試在顯著性

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(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ì)自己和他人造成任何形式的傷害或損失。

評(píng)論

0/150

提交評(píng)論