Wk 4. In-Class 2014-04-08 P308D - Categorical Data Analysis - Dale Berger
 Share
The version of the browser you are using is no longer supported. Please upgrade to a supported browser.Dismiss

 
View only
 
 
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAFAGAHAI
1
2
EXAMPLE 1
3
SalGender
Grad Date
4
Sal
5
F=0; M=1Cost0.156
6
Ed0.067-0.07
7
8
9
10
EXAMPLE 2
1 Strongly Agree
2 Don't know
3 Strongly Disagree
11
1 Temp
12
2 Hourly
13
3
14
4 Profit Sharing
15
Example 2.1 01
16
No BABA
17
0Hourly169
18
1Salary2451
19
20
Example 2.2
21
No BABA
22
Hourlyab
23
Salarycd
24
25
Concordant:
26
Discordant:
27
28
EXAMPLE 3Gamma:
Concordant Pairs:
Discordant Pairs:
29
1 Strongly Agree
2 Don't know
3 Strongly Disagree
1 Strongly Agree
2 Don't know
4
1 Strongly Agree
2 Don't know4
30
1 Temp91016
1 Temp
2534401440
No Concordant
1 TempNo DiscordantNo DiscordantNo Discordant
31
2 Hourly2289
2 Hourly
3520160
No Concordant
2 HourlyNo Discordant990
32
313111632010
No Concordant
3No Discordant19815840
33
4 Profit Sharing3210
4 Profit Sharing
No Concordant
No Concordant
No Concordant
4 Profit SharingNo Concordant25742265120
34
129P=258590Q=2283831
35
Gamma=(P-Q)/(P+Q)-0.7965797167
36
Z =
G*SQRT((P+G)/(N*(1-G^2)))
-184.985526
37
38
1 Strongly Agree
2 Don't know
3 Strongly Disagree
39
1 Temp00No Concordant
No Discordant
No Discordant
No Discordant
40
2 Hourly00No Concordant
No Discordant
00
41
300No Concordant
No Discordant
00
42
4 Profit SharingNo ConcordantNo ConcordantNo Concordant
No Concordant
00
43
0
44
6 Concordant pairs;
45
6 Discordant Paris:
46
47
Example 4ODDS RATIO
48
01
49
No BABA
50
0Hourly169
51
1Salary2451
52
100
53
Odds of being on salary if you have No Ba:
1.5
54
Odds of being on Salary if you have a BA:
5.666666667
55
Odds Ratio:3.777777778
56
Odds ratio calculated other way:
0.2647058824
57
1/ODDS Ratio 1 = Odds Ratio 2/1
58
59
ODDS RATIO
60
01
61
No BABA
62
Hourly837Test:
63
Salary719127
64
7121.236363636
65
Odds of being on salary if you have No Ba:
0.87532.323049002
66
Odds of being on Salary if you have a BA:
0.51351351351.878936693
67
Odds Ratio:0.58687258691.197727273
68
Odds ratio calculated other way:
1.7039473682.142857143
69
1/ODDS Ratio 1 = Odds Ratio 2/1
70
71
Example 7
Independence Hypothesis:
Chi ^Square=
97.05882353
3.2: Yates Correction
Chi ^Square=
94.1399287
Multinomial Outcome
McNemar's Chi Square Test
Binomial Claculation Debugging
72
Observed = O
2014
Expected = E
∑(O-E)^2/E∑(|O-E|-.5)^2/E
((a+b)!*(c+d)!*(a+c)!*(b+d)!)/(n!*A!*b!*c!*d!)
χ^2 = (ABS(b-c)-1)^2/(b+c)
x=67<- # in Cell B
73
DRDRDRDR
Calculated outcome:
#NUM!
Calculated Outcome:
5.789156627p=0.05#NUM!2.48004E+961.11825E+2249.33262E+1579.33262E+157
74
Year 2012D16768Year 2012D343468D32.0294117632.02941176D31.0661764731.06617647Checksum:N/AChecksum: N/AP=0.5
<- Likelihood of a hit for cell b
#NUM!13.64711E+949.33262E+1558.68332E+36
75
R9933132R6666132R16.516.5R16.0037878816.00378788
Approximation of the Binomial Calculation with Yates Correction:
2.406066630.008062661694Q=0.5
<- Likelihood of a miss for cell b
76
100100200100100200
Checksum: P=
0.021n=166<- =∑(b+c)
77
78
Example 8ControlTreatment
79
Success167CaseCT
80
Failure9933A9799
81
10010031
82
83
Failure rate0.9900.330B2575
84
Odds of failure99.0000.4937525
85
86
Success ratio0.01567.000C167
87
Failure ratio3.0000.3339933
88
89
Odds ratio201.0000.005
90
91
92
93
94
Be careful when interpreting odds ratios!
95
96
Example 9 - Logistic Regression
97
98
99
100
Loading...
 
 
 
Sheet1