Friday, May 26, 2006

[猜猜看]豬哥亮在哪?

猜猜豬哥亮在哪??

內有惡犬-妮妮


內有惡犬, originally uploaded by a882190982001.

希望不再是國王的圖片了

天殺的納許

類別分析的報告好奇用了今年NBA的MVP納許的攻守數據,結果哩,做出來他的貢獻根本跟太陽隊的輸贏沒有相關,那我找了那麼久的數據有啥用,但是醜媳婦還是得上轎,就.............給他喇叭納許對於太陽隊不僅僅是攻手上的貢獻,而最重要的是他對於太陽所有球員的精神支柱是無人能取代的.................
,教授請不要噹我,要噹,請去噹"天殺的納許"吧


The SAS System 38

The FREQ Procedure

Table of X by Y

X Y

Frequency| 0| 1| Total
---------+--------+--------+
0 | 7 | 10 | 17
---------+--------+--------+
1 | 19 | 47 | 66
---------+--------+--------+
Total 26 57 83


Statistics for Table of X by Y

Statistic DF Value Prob
------------------------------------------------------
Chi-Square 1 0.9644 0.3261
Likelihood Ratio Chi-Square 1 0.9320 0.3343
Continuity Adj. Chi-Square 1 0.4745 0.4909
Mantel-Haenszel Chi-Square 1 0.9528 0.3290
Phi Coefficient 0.1078
Contingency Coefficient 0.1072
Cramer's V 0.1078


Fisher's Exact Test
----------------------------------
Cell (1,1) Frequency (F) 7
Left-sided Pr <= F 0.8972
Right-sided Pr >= F 0.2422

Table Probability (P) 0.1394
Two-sided Pr <= P 0.3836

Sample Size = 83


The SAS System 39

The FREQ Procedure

Summary Statistics for X by Y

Cochran-Mantel-Haenszel Statistics (Based on Table Scores)

Statistic Alternative Hypothesis DF Value Prob
---------------------------------------------------------------
1 Nonzero Correlation 1 0.9528 0.3290
2 Row Mean Scores Differ 1 0.9528 0.3290
3 General Association 1 0.9528 0.3290


Estimates of the Common Relative Risk (Row1/Row2)

Type of Study Method Value 95% Confidence Limits
-------------------------------------------------------------------------
Case-Control Mantel-Haenszel 1.7316 0.5746 5.2181
(Odds Ratio) Logit 1.7316 0.5746 5.2181

Cohort Mantel-Haenszel 1.4303 0.7223 2.8324
(Col1 Risk) Logit 1.4303 0.7223 2.8324

Cohort Mantel-Haenszel 0.8260 0.5393 1.2651
(Col2 Risk) Logit 0.8260 0.5393 1.2651


Total Sample Size = 83


Table of Z by Y

Z Y

Frequency| 0| 1| Total
---------+--------+--------+
0 | 10 | 18 | 28
---------+--------+--------+
1 | 16 | 39 | 55
---------+--------+--------+
Total 26 57 83


The SAS System 40

The FREQ Procedure

Statistics for Table of Z by Y

Statistic DF Value Prob
------------------------------------------------------
Chi-Square 1 0.3784 0.5385
Likelihood Ratio Chi-Square 1 0.3743 0.5407
Continuity Adj. Chi-Square 1 0.1331 0.7152
Mantel-Haenszel Chi-Square 1 0.3738 0.5409
Phi Coefficient 0.0675
Contingency Coefficient 0.0674
Cramer's V 0.0675


Fisher's Exact Test
----------------------------------
Cell (1,1) Frequency (F) 10
Left-sided Pr <= F 0.8072
Right-sided Pr >= F 0.3545

Table Probability (P) 0.1617
Two-sided Pr <= P 0.6192

Sample Size = 83


The SAS System 41

The FREQ Procedure

Summary Statistics for Z by Y

Cochran-Mantel-Haenszel Statistics (Based on Table Scores)

Statistic Alternative Hypothesis DF Value Prob
---------------------------------------------------------------
1 Nonzero Correlation 1 0.3738 0.5409
2 Row Mean Scores Differ 1 0.3738 0.5409
3 General Association 1 0.3738 0.5409


Estimates of the Common Relative Risk (Row1/Row2)

Type of Study Method Value 95% Confidence Limits
-------------------------------------------------------------------------
Case-Control Mantel-Haenszel 1.3542 0.5146 3.5635
(Odds Ratio) Logit 1.3542 0.5146 3.5635

Cohort Mantel-Haenszel 1.2277 0.6435 2.3421
(Col1 Risk) Logit 1.2277 0.6435 2.3421

Cohort Mantel-Haenszel 0.9066 0.6558 1.2533
(Col2 Risk) Logit 0.9066 0.6558 1.2533


Total Sample Size = 83


Table of X by Z

X Z

Frequency| 0| 1| Total
---------+--------+--------+
0 | 7 | 10 | 17
---------+--------+--------+
1 | 21 | 45 | 66
---------+--------+--------+
Total 28 55 83


The SAS System 42

The FREQ Procedure

Statistics for Table of X by Z

Statistic DF Value Prob
------------------------------------------------------
Chi-Square 1 0.5296 0.4668
Likelihood Ratio Chi-Square 1 0.5178 0.4718
Continuity Adj. Chi-Square 1 0.1937 0.6599
Mantel-Haenszel Chi-Square 1 0.5232 0.4695
Phi Coefficient 0.0799
Contingency Coefficient 0.0796
Cramer's V 0.0799


Fisher's Exact Test
----------------------------------
Cell (1,1) Frequency (F) 7
Left-sided Pr <= F 0.8450
Right-sided Pr >= F 0.3249

Table Probability (P) 0.1699
Two-sided Pr <= P 0.5672

Sample Size = 83


The SAS System 43

The FREQ Procedure

Summary Statistics for X by Z

Cochran-Mantel-Haenszel Statistics (Based on Table Scores)

Statistic Alternative Hypothesis DF Value Prob
---------------------------------------------------------------
1 Nonzero Correlation 1 0.5232 0.4695
2 Row Mean Scores Differ 1 0.5232 0.4695
3 General Association 1 0.5232 0.4695


Estimates of the Common Relative Risk (Row1/Row2)

Type of Study Method Value 95% Confidence Limits
-------------------------------------------------------------------------
Case-Control Mantel-Haenszel 1.5000 0.5013 4.4883
(Odds Ratio) Logit 1.5000 0.5013 4.4883

Cohort Mantel-Haenszel 1.2941 0.6629 2.5264
(Col1 Risk) Logit 1.2941 0.6629 2.5264

Cohort Mantel-Haenszel 0.8627 0.5609 1.3269
(Col2 Risk) Logit 0.8627 0.5609 1.3269


Total Sample Size = 83


Table 1 of Z by Y
Controlling for X=0

Z Y

Frequency| 0| 1| Total
---------+--------+--------+
0 | 2 | 5 | 7
---------+--------+--------+
1 | 5 | 5 | 10
---------+--------+--------+
Total 7 10 17


The SAS System 44

The FREQ Procedure

Statistics for Table 1 of Z by Y
Controlling for X=0

Statistic DF Value Prob
------------------------------------------------------
Chi-Square 1 0.7806 0.3770
Likelihood Ratio Chi-Square 1 0.7961 0.3723
Continuity Adj. Chi-Square 1 0.1466 0.7018
Mantel-Haenszel Chi-Square 1 0.7347 0.3914
Phi Coefficient -0.2143
Contingency Coefficient 0.2095
Cramer's V -0.2143

WARNING: 75% of the cells have expected counts less
than 5. Chi-Square may not be a valid test.


Fisher's Exact Test
----------------------------------
Cell (1,1) Frequency (F) 2
Left-sided Pr <= F 0.3539
Right-sided Pr >= F 0.9182

Table Probability (P) 0.2721
Two-sided Pr <= P 0.6221

Sample Size = 17


Table 2 of Z by Y
Controlling for X=1

Z Y

Frequency| 0| 1| Total
---------+--------+--------+
0 | 8 | 13 | 21
---------+--------+--------+
1 | 11 | 34 | 45
---------+--------+--------+
Total 19 47 66


The SAS System 45

The FREQ Procedure

Statistics for Table 2 of Z by Y
Controlling for X=1

Statistic DF Value Prob
------------------------------------------------------
Chi-Square 1 1.3015 0.2539
Likelihood Ratio Chi-Square 1 1.2683 0.2601
Continuity Adj. Chi-Square 1 0.7208 0.3959
Mantel-Haenszel Chi-Square 1 1.2818 0.2576
Phi Coefficient 0.1404
Contingency Coefficient 0.1391
Cramer's V 0.1404


Fisher's Exact Test
----------------------------------
Cell (1,1) Frequency (F) 8
Left-sided Pr <= F 0.9225
Right-sided Pr >= F 0.1969

Table Probability (P) 0.1194
Two-sided Pr <= P 0.3815

Sample Size = 66


The SAS System 46

The FREQ Procedure

Summary Statistics for Z by Y
Controlling for X

Cochran-Mantel-Haenszel Statistics (Based on Table Scores)

Statistic Alternative Hypothesis DF Value Prob
---------------------------------------------------------------
1 Nonzero Correlation 1 0.2845 0.5937
2 Row Mean Scores Differ 1 0.2845 0.5937
3 General Association 1 0.2845 0.5937


Estimates of the Common Relative Risk (Row1/Row2)

Type of Study Method Value 95% Confidence Limits
-------------------------------------------------------------------------
Case-Control Mantel-Haenszel 1.2948 0.4968 3.3742
(Odds Ratio) Logit 1.3360 0.5022 3.5543

Cohort Mantel-Haenszel 1.1929 0.6308 2.2559
(Col1 Risk) Logit 1.2223 0.6368 2.3463

Cohort Mantel-Haenszel 0.9167 0.6555 1.2820
(Col2 Risk) Logit 0.9098 0.6493 1.2748


Breslow-Day Test for
Homogeneity of the Odds Ratios
------------------------------
Chi-Square 1.7617
DF 1
Pr > ChiSq 0.1844


Total Sample Size = 83


The SAS System 47

The CATMOD Procedure

Data Summary

Response Y Response Levels 2
Weight Variable count Populations 4
Data Set ALL Total Frequency 83
Frequency Missing 0 Observations 8


Population Profiles

Sample X Z Sample Size
-------------------------------
1 0 0 7
2 0 1 10
3 1 0 21
4 1 1 45


Response Profiles

Response Y
-------------
1 0
2 1


Maximum Likelihood Analysis

Maximum likelihood computations converged.


Maximum Likelihood Analysis of Variance

Source DF Chi-Square Pr > ChiSq
--------------------------------------------------
Intercept 1 11.00 0.0009

Likelihood Ratio 3 3.00 0.3922


Analysis of Maximum Likelihood Estimates

Standard Chi-
Parameter Estimate Error Square Pr > ChiSq
----------------------------------------------------------
Intercept -0.7850 0.2367 11.00 0.0009


The SAS System 48

The CATMOD Procedure

Data Summary

Response Y Response Levels 2
Weight Variable count Populations 4
Data Set ALL Total Frequency 83
Frequency Missing 0 Observations 8


Population Profiles

Sample X Z Sample Size
-------------------------------
1 0 0 7
2 0 1 10
3 1 0 21
4 1 1 45


Response Profiles

Response Y
-------------
1 0
2 1


Maximum Likelihood Analysis

Maximum likelihood computations converged.


Maximum Likelihood Analysis of Variance

Source DF Chi-Square Pr > ChiSq
--------------------------------------------------
Intercept 1 5.03 0.0249
X 1 0.95 0.3293

Likelihood Ratio 2 2.06 0.3562


Analysis of Maximum Likelihood Estimates

Standard Chi-
Parameter Estimate Error Square Pr > ChiSq
------------------------------------------------------------
Intercept -0.6312 0.2814 5.03 0.0249
X 0 0.2745 0.2814 0.95 0.3293


The SAS System 49

The CATMOD Procedure

Data Summary

Response Y Response Levels 2
Weight Variable count Populations 4
Data Set ALL Total Frequency 83
Frequency Missing 0 Observations 8


Population Profiles

Sample X Z Sample Size
-------------------------------
1 0 0 7
2 0 1 10
3 1 0 21
4 1 1 45


Response Profiles

Response Y
-------------
1 0
2 1


Maximum Likelihood Analysis

Maximum likelihood computations converged.


Maximum Likelihood Analysis of Variance

Source DF Chi-Square Pr > ChiSq
--------------------------------------------------
Intercept 1 8.97 0.0027
Z 1 0.38 0.5391

Likelihood Ratio 2 2.62 0.2695


Analysis of Maximum Likelihood Estimates

Standard Chi-
Parameter Estimate Error Square Pr > ChiSq
------------------------------------------------------------
Intercept -0.7394 0.2468 8.97 0.0027
Z 0 0.1516 0.2468 0.38 0.5391


The SAS System 50

The CATMOD Procedure

Data Summary

Response Y Response Levels 2
Weight Variable count Populations 4
Data Set ALL Total Frequency 83
Frequency Missing 0 Observations 8


Population Profiles

Sample X Z Sample Size
-------------------------------
1 0 0 7
2 0 1 10
3 1 0 21
4 1 1 45


Response Profiles

Response Y
-------------
1 0
2 1


Maximum Likelihood Analysis

Maximum likelihood computations converged.


Maximum Likelihood Analysis of Variance

Source DF Chi-Square Pr > ChiSq
--------------------------------------------------
Intercept 1 4.30 0.0381
X 1 0.86 0.3525
Z 1 0.29 0.5892

Likelihood Ratio 1 1.77 0.1828


Analysis of Maximum Likelihood Estimates

Standard Chi-
Parameter Estimate Error Square Pr > ChiSq
------------------------------------------------------------
Intercept -0.5973 0.2880 4.30 0.0381
X 0 0.2628 0.2827 0.86 0.3525
Z 0 0.1344 0.2489 0.29 0.5892


The SAS System 51

The CATMOD Procedure

Data Summary

Response Y Response Levels 2
Weight Variable count Populations 4
Data Set ALL Total Frequency 83
Frequency Missing 0 Observations 8


Population Profiles

Sample X Z Sample Size
-------------------------------
1 0 0 7
2 0 1 10
3 1 0 21
4 1 1 45


Response Profiles

Response Y
-------------
1 0
2 1


Maximum Likelihood Analysis

Maximum likelihood computations converged.


Maximum Likelihood Analysis of Variance

Source DF Chi-Square Pr > ChiSq
--------------------------------------------------
Intercept 1 4.50 0.0339
X 1 0.34 0.5585
Z 1 0.05 0.8187
X*Z 1 1.71 0.1911

Likelihood Ratio 0 . .


Analysis of Maximum Likelihood Estimates

Standard Chi-
Parameter Estimate Error Square Pr > ChiSq
--------------------------------------------------------------
Intercept -0.6326 0.2981 4.50 0.0339
X 0 0.1744 0.2981 0.34 0.5585
Z 0 -0.0683 0.2981 0.05 0.8187
X*Z 0 0 -0.3898 0.2981 1.71 0.1911

無聊的SAS程式碼

options nodate nonotes ps=60;
data All;
input Z X Y count @@;
cards;
0 0 0 2
0 0 1 5
0 1 0 8
0 1 1 13
1 0 0 5
1 0 1 5
1 1 0 11
1 1 1 34
;
proc freq;
weight count;
tables X*Y/ nocol norow nopercent chisq cmh;
tables Z*Y/ nocol norow nopercent chisq cmh;
tables X*Z/ nocol norow nopercent chisq cmh;
tables X*Z*Y/ nocol norow nopercent chisq cmh;
run;

data All;
input Z X Y count @@;
cards;
0 0 0 2
0 0 1 5
0 1 0 8
0 1 1 13
1 0 0 5
1 0 1 5
1 1 0 11
1 1 1 34
;
proc catmod order=data;
weight count;
population X Z;
model Y=;
proc catmod order=data;
weight count;
population X Z ;
model Y=X;
proc catmod order=data;
weight count;
population X Z;
model Y=Z;
proc catmod order=data;
weight count;
population X Z ;
model Y=X Z;
proc catmod order=data;
weight count;
population X Z;
model Y=X|Z;
run;

TEST

哈哈 我的第一次