2024年4月11日发(作者:)

实验八 卡方分析与线性回归 植保133 裴小津 2013010320

data abc;

do a=1 to 2;

do b= 1 to 2;

input c@@;

output ;

end ;

end;

cards;

26 184 50 200

proc freq;

weight c;

tables a*b/chisq expected nopercent nocol;

run;

The SAS System 00:19 Sunday, January 1, 2006 1

The FREQ Procedure

Table of a by b

a b

Frequency‚

Expected ‚

Row Pct ‚ 1‚ 2‚ Total

ƒƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆ

1 ‚ 26 ‚ 184 ‚ 210

‚ 34.696 ‚ 175.3 ‚

‚ 12.38 ‚ 87.62 ‚

ƒƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆ

2 ‚ 50 ‚ 200 ‚ 250

‚ 41.304 ‚ 208.7 ‚

‚ 20.00 ‚ 80.00 ‚

ƒƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆ

Total 76 384 460

Statistics for Table of a by b

Statistic DF Value Prob

ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ

Chi-Square 1 4.8037 0.0284

Likelihood Ratio Chi-Square 1 4.8944 0.0269

Continuity Adj. Chi-Square 1 4.2671 0.0389

Mantel-Haenszel Chi-Square 1 4.7932 0.0286

Phi Coefficient -0.1022

Contingency Coefficient 0.1017

Cramer's V -0.1022

Fisher's Exact Test

ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ

Cell (1,1) Frequency (F) 26

Left-sided Pr <= F 0.0188

Right-sided Pr >= F 0.9903

Table Probability (P) 0.0091

Two-sided Pr <= P 0.0321

Sample Size = 460

data abc;

do r= 1 to 2;

do c= 1 to 3;

input y@@;

output;

end;end;

cards;

26 41 54 174 159 146

proc freq;

weight y;

tables r*c/chisq expected;

run;

The SAS System

01:06 Sunday, January 1, 2006 1

The FREQ Procedure

Table of r by

r c

Frequency‚

Expected ‚

Percent ‚

Row Pct ‚

Col Pct ‚ 1‚ 2‚ 3‚ Total

ƒƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆ

1 ‚ 26 ‚ 41 ‚ 54 ‚ 121

‚ 40.333 ‚ 40.333 ‚ 40.333 ‚

‚ 4.33 ‚ 6.83 ‚ 9.00 ‚ 20.17

‚ 21.49 ‚ 33.88 ‚ 44.63 ‚

‚ 13.00 ‚ 20.50 ‚ 27.00 ‚

ƒƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆ

2 ‚ 174 ‚ 159 ‚ 146 ‚ 479

‚ 159.67 ‚ 159.67 ‚ 159.67 ‚

‚ 29.00 ‚ 26.50 ‚ 24.33 ‚ 79.83

‚ 36.33 ‚ 33.19 ‚ 30.48 ‚

‚ 87.00 ‚ 79.50 ‚ 73.00 ‚

ƒƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆ

Total 200 200 200 600

33.33 33.33 33.33 100.00

Statistics for Table of r by c