生物统计学答案 第十章 一元回归及简单相关分析
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
第十章一元回归及简单相关分析
10.1对尿毒症患者采用低蛋白并补加基本氨基酸的食物进行治疗,分析该疗法对患者体内一些成分的影响。
以下数据是在治疗前患者的基本数据[64]:
体重(BW)
/kg 体内总钾(TBK)
/mmol
血清尿素(UREA)
/(mmol·L-1)
73 3 147 19
70 3 647 36
72 3 266 25
53 2 650 25
97 3 738 34
77 3 982 36
63 2 900 49
54 3 194 38
66 3 930 16
53 3 419 34
70 3 978 34
63 2 747 26
65 4 181 46
88 3 678 41
82 3 540 39
69 3 912 19
91 4 138 35
62 2 896 43
74 3 410 50
90 3 679 23
74 3 855 38
71 2 750 50
59 3 583 31
80 3 268 47
66 2 846 45
115 4 804 65
111 5 290 38
64 2 960 45
71 3 610 24
69 2 905 31
计算三者之间的相关系数,并检验相关的显著性。
答:所用程序及计算结果如下:
options linesize=76 nodate;
data uremia;
infile 'e:\data\er10-1e.dat';
input bw tbk urea @@;
run;
proc corr nosimple;
var bw tbk urea;
run;
The SAS System
Correlation Analysis
3 'VAR' Variables: BW TBK UREA
Pearson Correlation Coefficients / Prob > |R| under Ho: Rho=0 / N = 30
BW TBK UREA
BW 1.00000 0.70594 0.28582
0.0 0.0001 0.1257
TBK 0.70594 1.00000 0.09661
0.0001 0.0 0.6116
UREA 0.28582 0.09661 1.00000
0.1257 0.6116 0.0
三个变量间,只有体重(BW)和体内总钾(TBK)间相关显著,r=0.705 94。
相关系数的显著性概率P=0.000 1。
10.2还是上例,经过一年的饮食治疗后,体内总钾量与治疗前的总钾量,如下表[64]:
病人号治疗后
/mmol 治疗前/mmol
16 3 246 3 147
22 3 272 3 647
25 3 110 3 266
28 2 006 2 650
39 2 879 2 900
47 3 620 3 930
51 3 597 3 978
53 3 080 2 747
56 3 420 3 678
38 2 280 2 400
54 2 360 2 105
58 2 490 2 530
以治疗前为自变量,治疗后为因变量,计算回归方程,并检验回归的显著性。
答:计算结果如下:
The SAS System
The REG Procedure
Model: MODEL1
Dependent Variable: after
Analysis of Variance
Sum of Mean
Source DF Squares Square F Value Pr > F
Model 1 2573589 2573589 39.40 <.0001
Error 10 653264 65326
Corrected Total 11 3226853
Root MSE 255.59029 R-Square 0.7976
Dependent Mean 2946.66667 Adj R-Sq 0.7773
Coeff Var 8.67388
Parameter Estimates
Parameter Standard
Variable DF Estimate Error t Value Pr > |t|
Intercept 1 560.15163 387.31612 1.45 0.1787
before 1 0.77447 0.12339 6.28 <.0001
回归方程为:
X Y 47774.063151.560ˆ+=
t 检验的显著性概率P <0.000 1。
故回归系数极显著。
10.3 调查河流中悬浮物每月沉淀的量与水流速度的关系,得到以下结果[65]:
流量 /(m 3·min -1) 每月上层沉积物 /t 流量 /(m 3·min -1) 每月主流沉积物
/t
流量 /(m 3·min -1) 每月下层沉积物
/t
1 651.3
425 468 12 181.6 1 990 300 23 640.1 2 010 730 848.6 209 455 9 902.3 1 626 786 11 269.9 671.326 832.6 183 412 3 592.4 488 599 3 405.2 148.755 621.4 147 799 3 325.3 471 549 1 398.6 39 156 598.6 108 025 1 763.8 112 404 1 144.6 24 843
574.3 200 537 1 429.7 89 201 1 126.4 32 939 228.4 50 386 1 404.4 79 615 675.4 9 913 204.8 57 608 1 337.6 84 191 285.6 1 189 188.1 30 947 1 128.6 62 034 174.0 264 16.3
1 826
823.1 87 925 104.2 881 655.9 52 395 97.4 259 595.1 66 379 47.1 367 569.1 29 913 45.9 70 273.9 20 497 41.3 136
265.8 22 469 32.6 70
236.7 22 704 3.4 13 236.2 27 566 1.2 4 145.8 7 463 142.7 11 281
97.2 9 257
70.0 3 699 63.7 3 955 32.8 2 636 27.2 1 232
18.0 1 068
17.0 584 15.6 400 10.2 456 7.9 195
6.6
114
以流量为自变量,月沉积物为因变量,计算回归方程。
答:首先对自变量和因变量做双对数变换,获得经对数变换后的回归方程,再通过反对数得到原始单位的回归方程。
程序和结果如下:
options linesize=76 nodate; data river;
infile 'E:\data\er10-3e.dat';
input upflow upsedim midflow midsedim lowflow lowsedim @@; x1=log10(upflow); y1=log10(upsedim); x2=log10(midflow); y2=log10(midsedim); x3=log10(lowflow); y3=log10(lowsedim); proc reg;
model y1=x1; proc reg;
model y2=x2; proc reg;
model y3=x3; run;
(1)上层沉积物:
The SAS System
Model: MODEL1
Dependent Variable: Y1
Analysis of Variance
Sum of Mean
Source DF Squares Square F Value Prob>F
Model 1 3.92128 3.92128 382.295 0.0001 Error 8 0.08206 0.01026 C Total 9 4.00334
Root MSE 0.10128 R-square 0.9795 Dep Mean 4.89337 Adj R-sq 0.9769 C.V. 2.06970
Parameter Estimates
Parameter Standard T for H0:
Variable DF Estimate Error Parameter=0 Prob > |T|
INTERCEP 1 1.890841 0.15686760 12.054 0.0001
X1 1 1.175010 0.06009554 19.552 0.0001
从参数估计列,得到如下回归方程:
变换为原单位后的方程为:
010175.11118775.77ˆX Y =
由t 检验的显著性概率可知,回归系数和常数项都是显著的。
(2)主流沉积物:
The SAS System
Model: MODEL1
Dependent Variable: Y2
Analysis of Variance
Sum of Mean
Source DF Squares Square F Value Prob>F
Model 1 35.58584 35.58584 1438.727 0.0001 Error 28 0.69256 0.02473 C Total 29 36.27840
Root MSE 0.15727 R-square 0.9809 Dep Mean 4.19618 Adj R-sq 0.9802 C.V. 3.74797
Parameter Estimates
Parameter Standard T for H0:
Variable DF Estimate Error Parameter=0 Prob > |T|
INTERCEP 1 1.366966 0.07992510 17.103 0.0001
X2 1 1.194288 0.03148616 37.931 0.0001
11010175.1841890.1ˆX Y '+='
从参数估计列得到回归方程如下:
22288194.1966366.1ˆX Y '+='
变换为原单位后的方程为:
288194.122090279.23ˆX Y =
由t 检验的显著性概率可知,回归系数和常数项都是显著的。
(3)底层沉积物:
The SAS System
Model: MODEL1
Dependent Variable: Y3
Analysis of Variance
Sum of Mean
Source DF Squares Square F Value Prob>F
Model 1 20.99588 20.99588 26.414 0.0001 Error 15 11.92328 0.79489 C Total 16 32.91916
Root MSE 0.89156 R-square 0.6378 Dep Mean 2.92730 Adj R-sq 0.6137 C.V. 30.45683
Parameter Estimates
Parameter Standard T for H0:
Variable DF Estimate Error Parameter=0 Prob > |T|
INTERCEP 1 0.593156 0.50301446 1.179 0.2567 X3 1 0.996479 0.19388907 5.139 0.0001
从参数估计列得到回归方程如下:
33479996.0156593.0ˆX Y '+='
变换为原单位后的方程为:
479996.033826918.3ˆX Y =
由t 检验的显著性概率可知,回归系数是显著的。
10.4 一种治疗肺动脉高血压的药物treprostinil sodium ,研究给药剂量与血浆浓度之间的关系,当用静脉给药时得到以下结果[66](近似值):
剂 量 /(ng·kg -1·min -1
) 血浆药物浓度
/(pg·mL -1)
20
4 750 24 2 500 49 8 000 53
5 500 70
9 000
78 12 500 84 8 000 90 13 250 96 18 250 102
14 500
122 17 500 126 17 000
以剂量为自变量,血浆药物浓度为因变量,计算的回归方程,检验回归的显著性并绘出回归线。
答:计算结果如下:
The SAS System
Model: MODEL1
Dependent Variable: CONCEN
Analysis of Variance
Sum of Mean
Source DF Squares Square F Value Prob>F
Model 1 263507305.51 263507305.51 52.387 0.0001 Error 10 50299986.153 5029998.6153 C Total 11 313807291.67
Root MSE 2242.76584 R-square 0.8397 Dep Mean 10895.83333 Adj R-sq 0.8237 C.V. 20.58370
Parameter Estimates
Parameter Standard T for H0:
Variable DF Estimate Error Parameter=0 Prob > |T|
INTERCEP 1 89.036517 1627.4120399 0.055 0.9574 DOSAGE 1 141.883547 19.60286907 7.238 0.0001
回归方程为:
X Y 547883.141517036.89ˆ+=
从回归系数和常数项的显著性概率可知,回归系数是显著的,常数项是不显著的。
散点图和回归线如下:
10.5 继续上题,这次是皮下给药,结果如下表[66](近似值): 剂 量 /(ng·kg -1·min -1) 血浆药物浓度
/(pg·mL -1) 剂 量 /(ng·kg -1·min -1) 血浆药物浓度 /(pg·mL -1)
50 7 500 12 1 000 52 7 750 13 1 750 64 14 250 15 2 500 17 3 750 66 10 250 28 6 250 67 13 000 67 10 000 29 3 250
67 5 750
30 2 500 70 10 000
32 5 250 36 4 250 73 8 750 38 6 250 75 10 000
80 16 250 38 7 000 80 10 250 38 6 750 80 8 500
44 3 500
44 9 750 87 11 000 47 5 000 95 15 250
95 15 750 49 5 750 100 11 250
50 6 000
问:(1)计算血浆药物浓度对剂量的回归方程,检验回归的显著性并绘出回归线。
(2)比较10.5和10.4两种给药方式的回归系数差异是否显著?
答:计算结果如下:
The SAS System
Model: MODEL1
Dependent Variable: CONCEN
Analysis of Variance
Sum of Mean
Source DF Squares Square F Value Prob>F
Model 1 401262581.37 401262581.37 84.935 0.0001 Error 32 151178595.1 4724331.0969 C Total 33 552441176.47
Root MSE 2173.55264 R-square 0.7263 Dep Mean 7823.52941 Adj R-sq 0.7178 C.V. 27.78225
Parameter Estimates
Parameter Standard T for H0:
Variable DF Estimate Error Parameter=0 Prob > |T|
INTERCEP 1 301.527681 897.27970517 0.336 0.7390 DOSAGE 1 139.905940 15.18070660 9.216 0.0001
回归方程为:
X Y 940905.139681527.301ˆ+=
从回归系数和常数项的显著性概率可知,回归系数是显著的,常数项是不显著的。
散点图和回归线如下:
比较两个回归系数:令10.4的回归系数为b 1,10.5的回归系数为b 2。
统计假设为:
H 0:β1-β2=0 H A :β1-β2≠0
08
.060
706180.1507869602.19940905.139547883.1412
2
22212
1
=+-=
+-=
b b s
s b b t
显著性概率P =0.936 6,P >0.05,尚无足够理由拒绝H 0。
结论:两个回归系数的差异不显著。
10.6 粤东近海渔场雄性条尾鲱鲤4月份和9月份的体重和体长的测定结果如下表[67]:
序号
4月份
9月份
体重/g 体长/cm 体重/g 体长/cm
1 59.7 14.0 38.9 12.7
2 50.1 13.0 31.9 11.9
3 37.1 12.0 21.2 10.3
4 36.2 11.6 17.2 9.9 5
41.2
11.2
11.7
9.6
6 26.6 10.6 14.6 9.1
7 26.5 10.2 10.2 8.6
8 24.1 9.
9 9.1 8.2 9 20.1 9.1 8.4 8.1 10
16.5 8.9
9.0
8.0
11 11.7 7.6 8.3 8.0 12
5.0
6.6
6.2
7.2
一般来说,鱼的体重(Y )在体长(X )上的回归符合以下关系:Y = aX b 。
计算回归方程,绘出对数尺度下的回归线,检验回归的显著性,并比较4月份和9月份两个回归系数的差异是否显著。
答:记4月份的样本为样本1,9月份的样本为样本2。
程序和结果如下:
options linesize=76 nodate;
data river;
infile 'E:\data\er10-6e.dat'; input fw fl nw nl @@;
y1=log10(fw); x1=log10(fl); y2=log10(nw); x2=log10(nl); proc reg;
model y1=x1; model y2=x2;
symbol v=star i=rl l=1 w=2 c=black; proc gplot; plot y1*x1; plot y2*x2; run;
(1)4月份的回归分析和回归线:
The SAS System
The REG Procedure Model: MODEL1
Dependent Variable: y1
Analysis of Variance
Sum of Mean
Source DF Squares Square F Value Pr > F
Model 1 0.94059 0.94059 260.55 <.0001 Error 10 0.03610 0.00361 Corrected Total 11 0.97669
Root MSE 0.06008 R-Square 0.9630
Dependent Mean 1.39473 Adj R-Sq 0.9593 Coeff Var 4.30790
Parameter Estimates
Parameter Standard
Variable DF Estimate Error t Value Pr > |t|
Intercept 1 -1.72319 0.19394 -8.89 <.0001 x1 1 3.09439 0.19170 16.14 <.0001
对数尺度下的回归方程和回归线为:
X Y 39094.319723.1ˆ+-=
从t 的显著性概率可以得知,常数项和回归系数都是显著的。
(2)9月份的回归分析和回归线:
The SAS System
The REG Procedure Model: MODEL1
Dependent Variable: y2
Analysis of Variance
Sum of Mean
Source DF Squares Square F Value Pr > F
Model 1 0.65994 0.65994 320.79 <.0001 Error 10 0.02057 0.00206 Corrected Total 11 0.68051
Root MSE 0.04536 R-Square 0.9698
Dependent Mean 1.12048 Adj R-Sq 0.9667 Coeff Var 4.04795
Parameter Estimates
Parameter Standard
Variable DF Estimate Error t Value Pr > |t|
Intercept 1 -2.04592 0.17727 -11.54 <.0001 x2 1 3.28993 0.18368 17.91 <.0001
对数尺度下的回归方程和回归线为:
X Y 93289.392045.2ˆ+-=
从t 的显著性概率可以得知,常数项和回归系数都是显著的。
(3)回归系数的比较:
统计假设为:
H 0:β1-β2=0 H A :β1-β2≠0
5
736.068
183.070191.093289.339094.32
2
22212
1
=+-=
+-=
b b s
s b b t
显著性概率P =0.47,P >0.05,尚无足够理由拒绝H 0。
结论:两个回归系数的差异不显著。
10.7 新疆维吾尔族和哈萨克族男生各100名,他们的立定跳远平均成绩与年龄之间的关系如下表所示[10]:
年龄/a 7
8 9 10 11 12 维吾尔族/cm 124.51 132.65 138.59 143.39 151.74 160.91 年龄/a 13 14 15 16 17 18 维吾尔族/cm 169.31 184.22 195.57 200.51 207.84 217.24 哈萨克族/cm 185.88
190.24
211.21
228.63
235.07
233.65
分别计算两个民族的成绩与年龄之间的相关系数,并检验两个相关系数的显著性。
答:程序和结果如下:
options linesize=76 nodate; data jump;
infile 'e:\data\er10-7e.dat'; input age wei ha @@; run;
proc corr nosimple; var age wei ha; run;
The SAS System
The CORR Procedure
3 Variables: age wei ha
Pearson Correlation Coefficients, N = 12
Prob > |r| under H0: Rho=0
age wei ha
age 1.00000 0.99494 0.98708
<.0001 <.0001
wei 0.99494 1.00000 0.98651
<.0001 <.0001
ha 0.98708 0.98651 1.00000
<.0001 <.0001
维吾尔族男生年龄与成绩间的相关系数r维=0.994 94;哈萨克族男生年龄与成绩间的相关系数r哈=0.987 08。
这两个相关系数都是极显著的。
10.8心脏的冠状窦口直径(d)与冠状窦瓣宽(w)和窦瓣高(h)存在一定关联,下面测量了从新生儿到儿童末期的6个年龄组的窦口直径、窦瓣宽和窦瓣高,结果见下表[68]:
组别
ⅠⅡⅢⅣⅤⅥ
窦口直径/mm 3.19 4.43 4.96 5.81 6.30 7.98
窦瓣宽/mm 4.64 6.42 7.32 7.68 8.99 10.30
分别计算窦瓣宽和窦瓣高与窦口直径间的相关系数,并检验相关系数的显著性。
答:所用程序与第7题一样,这里仅给出结果。
The SAS System
The CORR Procedure
3 Variables: diameter width height
Pearson Correlation Coefficients, N = 6
Prob > |r| under H0: Rho=0
diameter width height
diameter 1.00000 0.98660 0.87117
0.0003 0.0238
width 0.98660 1.00000 0.91358
0.0003 0.0109
height 0.87117 0.91358 1.00000
0.0238 0.0109
从程序运行的结果可以得出:r d-w=0.986 60,P=0.000 3,相关极显著;r d-h=0.871 17,P =0.023 8,相关显著。
10.9 Cu2+和Zn2+对尾草履虫的急性毒性试验结果如下[69]:
Cu2+Zn2+
浓度/( mg ·L-1) 死亡率/% 浓度/( mg ·L-1) 死亡率/%
0 2.5 0 4.2 0.14 5.1 1.8 5.2 0.18 15.4 3.2 21.7 0.24 40.2 5.6 33.0 0.32 50.4 10.0 46.1 0.42 63.0 18.0 62.6 0.56 79.5 32.0 73.0 0.75
93.2
56.0
89.6
分别计算Cu 2+和Zn 2+对尾草履虫的半致死剂量。
答:利用SAS 软件包中正态分布的分位数函数,对死亡率做概率变换,对浓度做常用对数变换。
以正态尺度的死亡率为自变量,以对数尺度的浓度为因变量,计算回归方程。
程序和结果如下:
options linesize=76 nodate; data parameci;
infile 'e:\data\er10-9e.dat';
input cuconcen cudearat znconcen zndearat @@; xcu=probit(cudearat/100); ycu=log10(cuconcen); xzn=probit(zndearat/100); yzn=log10(znconcen); run; proc reg;
model ycu=xcu; model yzn=xzn; run;
(1)Cu 2+:
The SAS System
The REG Procedure Model: MODEL1
Dependent Variable: ycu
Analysis of Variance
Sum of Mean
Source DF Squares Square F Value Pr > F
Model 1 0.40835 0.40835 241.67 <.0001 Error 5 0.00845 0.00169 Corrected Total 6 0.41679
Root MSE 0.04111 R-Square 0.9797
Dependent Mean -0.49525 Adj R-Sq 0.9757 Coeff Var -8.30000
Parameter Estimates
Parameter Standard
Variable DF Estimate Error t Value Pr > |t|
Intercept 1 -0.48662 0.01555 -31.30 <.0001
xcu 1 0.24545 0.01579 15.55 <.0001
当死亡率为50%时, 12326.0ˆ62486.0ˆlg =-=Y Y
故Cu 2+
对草履虫的半致死剂量为0.326 12 mg/L 。
(2)Zn 2+:
The SAS System
The REG Procedure Model: MODEL2
Dependent Variable: yzn
Analysis of Variance
Sum of Mean
Source DF Squares Square F Value Pr > F
Model 1 1.70301 1.70301 213.00 <.0001 Error 5 0.03998 0.00800 Corrected Total 6 1.74299
Root MSE 0.08942 R-Square 0.9771
Dependent Mean 1.00246 Adj R-Sq 0.9725 Coeff Var 8.91979
Parameter Estimates
Parameter Standard
Variable DF Estimate Error t Value Pr > |t|
Intercept 1 1.06262 0.03405 31.21 <.0001 xzn 1 0.55944 0.03833 14.59 <.0001
当死亡率为50%时,
01551.11ˆ62062.1ˆlg ==Y
Y
故Zn 2+对草履虫的半致死剂量为
11.551 01 mg/L 。
10.10 在一项关于碳酸利多卡因注射液热稳定性的实验研究中,发现NaHCO 3的比值(自变量)与相变点温度(因变量)存在以下关系[70]:
序号
NaHCO 3的比值 (自变量) 相变点温度/℃
(因变量)
1 1.00 54.1
2 1.50 48.0
3 1.81 46.6
4 2.50 41.1
5 2.91
39.1
6 3.8
7 35.5 7 5.00 32.9
8 5.80 29.6
9 7.50 26.8 10 8.39 25.1
11
10.00
22.4
做出散点图,并求出回归方程。
答:程序不再给出,这里只给出结果。
散点图和回归线如下:
回归分析见下表:
The SAS System
The REG Procedure Model: MODEL1
Dependent Variable: temp
Analysis of Variance
Sum of Mean
Source DF Squares Square F Value Pr > F
Model 1 966.81811 966.81811 97.17 <.0001 Error 9 89.54371 9.94930
Corrected Total 10 1056.36182
Root MSE 3.15425 R-Square 0.9152
Dependent Mean 36.47273 Adj R-Sq 0.9058 Coeff Var 8.64825
Parameter Estimates
Parameter Standard
Variable DF Estimate Error t Value Pr > |t|
Intercept 1 51.31644 1.78099 28.81 <.0001 rate 1 -3.24743 0.32943 -9.86 <.0001
由此得出回归方程:
X Y 43247.344316.51ˆ-=
回归系数的t 检验和回归模型的方差分析都指出,回归是极显著的。
10.11 4到10月龄胎儿的肝重与肝的Ca 含量存在以下关系[71]:
肝 重/g
6.48
13.02
24.17
44.86 58.39 75.58 86.47
-1求钙含量在肝重上的回归方程并检验回归的显著性。
答:结果如下:
options linesize=76 nodate;
data fetus;
input liver calcium @@; cards;
6.48 1271.0 13.02 1440.9 24.17 1016.6 44.86 663.7
58.39 516.3 75.58 535.9 86.47 492.5 ;
proc reg ;
model calcium=liver; run;
The SAS System
The REG Procedure Model: MODEL1
Dependent Variable: calcium
Analysis of Variance
Sum of Mean
Source DF Squares Square F Value Pr > F
Model 1 788984 788984 28.65 0.0031 Error 5 137679 27536
Corrected Total 6 926663
Root MSE 165.93934 R-Square 0.8514
Dependent Mean 848.12857 Adj R-Sq 0.8217 Coeff Var 19.56535
Parameter Estimates
Parameter Standard
Variable DF Estimate Error t Value Pr > |t|
Intercept 1 1364.29113 115.03041 11.86 <.0001 liver 1 -11.69414 2.18466 -5.35 0.0031
由此得出回归方程:
X Y 14694.1113291.3641ˆ-=
对回归模型的方差分析和回归系数的t 检验都指出,回归是极显著的。
10.12 青菜对14CO 2的富集系数(CF 值)如下[72]:
时间/d 菜 心 叶 子 6 24.6 13.8 12 53.4 30.9 18 82.0 41.9 24 100.1 63.2 36 114.1 96.8 48
156.4 135.6
以时间为自变量,菜心和叶子分别为因变量,计算回归方程,并比较两者回归系数的差异显
著性。
答:程序不再给出,这里只给出结果。
(1)菜心:
The SAS System
The REG Procedure Model: MODEL1
Dependent Variable: cfheart
Analysis of Variance
Sum of Mean
Source DF Squares Square F Value Pr > F
Model 1 10280 10280 86.05 0.0008 Error 4 477.84863 119.46216 Corrected Total 5 10758
Root MSE 10.92987 R-Square 0.9556
Dependent Mean 88.43333 Adj R-Sq 0.9445 Coeff Var 12.35945
Parameter Estimates
Parameter Standard
Variable DF Estimate Error t Value Pr > |t|
Intercept 1 18.88039 8.72513 2.16 0.0965
time 1 2.89804 0.31241 9.28 0.0008
由上表得出回归方程:
X Y 04898.239880.18ˆ+=
回归系数b 1是极显著的。
(2)叶子:
The SAS System
The REG Procedure Model: MODEL2
Dependent Variable: cfleaf
Analysis of Variance
Sum of Mean
Source DF Squares Square F Value Pr > F
Model 1 10269 10269 1108.25 <.0001 Error 4 37.06559 9.26640 Corrected Total 5 10307
Root MSE 3.04408 R-Square 0.9964
Dependent Mean 63.70000 Adj R-Sq 0.9955 Coeff Var 4.77877
Parameter Estimates
Parameter Standard
Variable DF Estimate Error t Value Pr > |t|
Intercept 1 -5.81765 2.43003 -2.39 0.0748
time 1 2.89657 0.08701 33.29 <.0001
由上表得出回归方程:
X Y 57896.265817.5ˆ+-=
回归系数b 2是极显著的。
(3)回归系数的比较:
统计假设为:
H 0:β1-β2=0 H A :β1-β2≠0
53
004.001
087.041312.057896.204898.22
2
22212
1
=+-=
+-=
b b s
s b b t
显著性概率P =0.9965,P >0.05,尚无足够理由拒绝H 0。
结论:两个回归系数的差异不显著。
10.13 人工测定蚊密度与气温存在以下关系[73]: 序号 蚊密度*
气 温 /℃ 序号 蚊密度* 气 温 /℃ 序号 蚊密度* 气 温
/℃
1
52.8 23.0 11 134.3 25.3 21 193.7 27.9 2 104.4 23.5 12 162.7 27.2 22 165.1 27.4 3 74.7 21.9 13 341.4 28.3 23 74.9 28.7 4 79.6 23.7 14 292.4 29.3 24 102.1 26.8 5 43.8 22.5
15 265.2 27.8
25 185.0 24.4
6 47.5 21.0 16 230.6 28.3 26 175.8 25.0
7 191.5 24.9 17 259.
8 30.1 27 203.5 26.3 8 157.8 25.6 18 148.5 29.4 28 138.5 23.3
9 204.3 26.0 19 331.4 30.2 29 93.1 26.6 10
232.8
25.5
20
326.3
27.5
30
97.0
24.8
注:*单位:只/h 。
以气温作为自变量,蚊密度作为因变量,求回归方程并对回归方程做方差分析。
答:结果如下:
The SAS System
The REG Procedure Model: MODEL1
Dependent Variable: density
Analysis of Variance
Sum of Mean
Source DF Squares Square F Value Pr > F
Model 1 103565 103565 25.51 <.0001 Error 28 113674 4059.77886 Corrected Total 29 217239
Root MSE 63.71639 R-Square 0.4767
Dependent Mean 170.35000 Adj R-Sq 0.4580 Coeff Var 37.40323
Parameter Estimates
Parameter Standard
Variable DF Estimate Error t Value Pr > |t|
Intercept 1 -459.98640 125.34184 -3.67 0.0010 temp 1 24.17552 4.78653 5.05 <.0001
由以上结果得到回归方程: X Y 52175.2440986.459ˆ+-=
方差分析表:
变差来源 平方和 自由度 均方 F P 回 归
103 565
1
103 565
25.51
<0.000 1
剩余113 674 28 4 059.778 86
总和217 239 29
10.14马鹿下臼齿咀嚼面宽度与年龄之间存在以下关系[48]:
序号年龄
/a
下臼齿咀嚼面宽度/mm
1 2.
5
8.65 8.90 8.30 8.80
2 3.
5 9.60 8.30 7.80 8.40 8.70 9.40 7.50 7.90 8.90 8.35 8.40
3 4.
5 10.13 8.65 10.00 10.90 9.92 10.00 10.14 10.12 10.15 9.10 10.17 9.80 9.72 9.82 10.00 10.15 8.80
4 5.
5 10.75 11.68 10.30 10.22 10.00 11.90 11.85 11.90 11.85 10.68
5 6.
5 11.30 12.70 11.48 11.87 10.20 10.82 11.52 11.60 10.25 11.00 11.30
6 7.
5
10.40 11.00 12.50 13.50 9.98
7 8.
5
12.16 12.80 11.88 11.10 11.48 11.40 12.10 10.15
8 9.
5
12.72 11.68 12.80 11.35 13.33
9 13.
5
12.20
10 17.
5
14.03
以年龄为自变量,咀嚼面宽度为因变量,计算回归方程。
这是一个有重复数据的回归问题,它的计算与无重复时相似,只是DATA步略有不同。
答:程序如下:
options linesize=76 nodate;
data deer;
infile 'E:\data\er10-14e.dat';
do i=1 to 10;
input n age @@;
do j=1 to n;
input width @@;
output;
end;
end;
proc reg;
model width=age;
run;
The SAS System
The REG Procedure
Model: MODEL1
Dependent Variable: width
Analysis of Variance
Sum of Mean
Source DF Squares Square F Value Pr > F
Model 1 98.09381 98.09381 113.00 <.0001 Error 71 61.63552 0.86811 Corrected Total 72 159.72934
Root MSE 0.93172 R-Square 0.6141
Dependent Mean 10.53699 Adj R-Sq 0.6087 Coeff Var 8.84240
Parameter Estimates
Parameter Standard
Variable DF Estimate Error t Value Pr > |t|
Intercept 1 7.81780 0.27808 28.11 <.0001 age 1 0.45580 0.04288 10.63 <.0001
由以上数据得到回归方程:
X Y 80455.080817.7ˆ+=
经t 检验回归系数和常数项都是显著的。
10.15 端粒(telomere )的长度随着年龄的增长而逐渐缩短,因此有可能根据端粒的大小推断出个体的年龄。
采用末端限制片段(terminal restriction fragment, TRF )长度来确定不同年龄组端粒的大小。
年龄组(岁)和各年龄组外周血白细胞TRF 平均长度(kb )的测定结果见下表[74]:
序号
年龄组中值/a
TRF/kb
1 2.0 14.29
2 9.0
12.92 3 19.0 12.16 4 29.0 11.91 5 39.0
11.68
6 49.0 11.25
7 59.0 10.94
8 69.0 10.3
9 9
77.5
10.31
以TRF 为自变量,年龄为因变量,求出最佳拟合回归方程。
答:求最佳拟合方程,可以通过绘图法,也可以通过比较剩余均方来确定。
绘图法比较直观,在这里我们采用绘图法。
(1)不变换:
(2)log 10(age)变换:
(3)sqrt(age)变换:
比较以上三个图形,显然对年龄做平方根变换后,直线化的效果最好,则方差分析表为:
Parameter Estimates
Parameter Standard
Variable DF Estimate Error t Value Pr > |t|
Intercept 1 28.65083 1.42367 20.12 <.0001 trf 1 -1.94297 0.12043 -16.13 <.0001
变换后的回归方程为: X Y 97942.183650.28ˆ-='
10.16用18种不同水体配制成培养基,培养基中的磷(P)浓度及用该培养基培养的玫瑰拟衣藻(Chloromonas rosae)的生长速率见下表[75]:
水体号P浓度/(mg ·L-1)生长速率/(μ)
1 0.101 0 0.244 0
2 0.082 0 0.198 9
3 0.061 0 0.238 2
4 0.028 0 0.246 0
5 0.030 0 0.171 6
6 0.032 0 0.216 3
7 0.210 0 0.413 8
8 0.150 0 0.332 8
9 0.160 0 0.268 4
10 0.016 8 0.094 8
11 0.012 0 0.099 3
12 0.012 8 0.165 0
13 0.008 4 0.091 5
14 0.006 0 0.006 7
15 0.006 4 0.059 2
16 0.004 2 0.033 3
17 0.003 0 0.019 8
18 0.003 2 - 0.014 7
以P浓度为自变量,生长速率为因变量,在直角坐标系中画出散点图,求出回归方程,并检验回归的显著性。
答:对自变量(P浓度)做自然对数变换,用变换后的数据进行分析。
程序和结果如下:options linesize=76 nodate;
data leaves;
infile 'e:\data\er10-16e.dat';
input p rate @@;
x=log(p); y=rate;
run;
proc gplot;
plot y*x;
proc reg ;
model y=x;
run;
The SAS System
The REG Procedure Model: MODEL1
Dependent Variable: y
Analysis of Variance
Sum of Mean
Source DF Squares Square F Value Pr > F
Model 1 0.21685 0.21685 128.01 <.0001 Error 16 0.02710 0.00169 Corrected Total 17 0.24395
Root MSE 0.04116 R-Square 0.8889
Dependent Mean 0.16027 Adj R-Sq 0.8820 Coeff Var 25.67984
Parameter Estimates
Parameter Standard
Variable DF Estimate Error t Value Pr > |t|
Intercept 1 0.46581 0.02869 16.23 <.0001 x 1 0.08059 0.00712 11.31 <.0001
回归方程为:
X Y ln 59080.081465.0ˆ+=
回归系数显著性检验表明,回归是显著的。
10.17 用不同浓度的草甘膦异丙胺盐(除草剂)溶液处理后,中华大蟾蜍心电图的三项指标平均值如下表[76]:
浓 度 /(mL·L -1)
P 波
/mV R 波 /mV P -R 间期
/ms
0 0.160 1.319 0.182 0.82 0.147 0.965 0.156 1.23 0.118 0.725 0.196 1.64 0.104 0.804 0.223 2.05 0.117 0.683 0.230 2.46 0.102 0.797 0.255 2.87
0.095
0.651
0.258
分别计算P 波,R 波及P-R 间期对浓度的回归方程,并检验回归系数的显著性。
答:下面给出程序和有关结果。
options linesize=76 nodate; data ECG;
infile 'e:\data\er10-17e.dat'; input x p r pr @@; sqrtx=sqrt(x); lnx=log(x); proc gplot; plot p*x; plot r*sqrtx; plot pr*lnx; proc reg; model p=x; model r=sqrtx; model pr=lnx; run;
(1)因变量:P 波
The SAS System
Parameter Estimates
Parameter Standard
Variable DF Estimate Error t Value Pr > |t|
Intercept 1 0.15176 0.01255 12.10 0.0003
x 1 -0.02056 0.00636 -3.23 0.0319
由此得到回归方程: X Y 56020.076151.0ˆ
-=,回归系数在α=0.05水平上显著。
(2)因变量:R 波
The SAS System
Parameter Estimates
Parameter Standard
Variable DF Estimate Error t Value Pr > |t|
Intercept 1 1.14221 0.17950 6.36 0.0031 sqrtx 1 -0.27890 0.13215 -2.11 0.1024
由此得到回归方程: X Y 90278.021142.1ˆ
-=,回归系数不显著。
(3)因变量:P -R 间期
The SAS System
Parameter Estimates
Parameter Standard
Variable DF Estimate Error t Value Pr > |t|
Intercept 1 0.17618 0.00378 46.61 <.0001 lnx 1 0.08217 0.00557 14.76 0.0001
由此得到回归方程: X Y ln 17082.018176.0ˆ
+=,回归系数极显著。
10.18 据说罗布麻有降血压的功能。
为了检验服药后的血压值是否与服药前有关,随机抽取10名受试者,测其服药前、后的收缩压如下表:
受试者 1 2 3 4 5 6 7 8 9 10 服药前/ mmHg 137 147 161 127 130 134 135 158 147 142 服药后/ mmHg 143 138 146 127 120 119 122 172 134 127
问服药后的血压值是否与服药前的血压值有关?
答:计算服药前后的相关系数,结果如下:
The SAS System
The CORR Procedure
2 Variables: x y
Pearson Correlation Coefficients, N = 10
Prob > |r| under H0: Rho=0
x y
x 1.00000 0.77793
0.0081
y 0.77793 1.00000
0.0081
两者的相关系数r =0.777 93,显著性概率P =0.008 1,P <0.01。
结论:服药后的血压值与服药前的血压值存在极显著的相关。
10.19 在曲线回归中,为了将曲线直线化,需进行几种不同的坐标变换。
然后比较误差均方MS E 的大小,MS E 最小的那种是最理想的变换方式。
在这里,为什么不能用公式SS E = S YY
-bS XY计算MS E,而必须用
()
∑
=
-
=
n
i
i
i
E
y
y
SS
1
2
ˆ
来计算?
答:因为SS E= S YY-bS XY是在直线回归中使用的公式。
对于曲线回归,通过坐标变换,将曲线回归直线化以后,其单位也随之改变。
对不同的坐标变换,变换后的单位不一致,由此计算出来的误差平方和的单位也不一致,无法相比较。
只有将经变换后求出的线性回归方程,变回原单位的非线性方程之后,用观测点与回归估计点之间离差的平方和进行比较才有意义。