Presentation is loading. Please wait.

Presentation is loading. Please wait.

Categorical Data Analysis: When life fits in little boxes AnnMaria DeMars, PhD.

Similar presentations


Presentation on theme: "Categorical Data Analysis: When life fits in little boxes AnnMaria DeMars, PhD."— Presentation transcript:

1 Categorical Data Analysis: When life fits in little boxes AnnMaria DeMars, PhD.

2 What are we going to do today? Basic statistics Logistic regression

3 An actual example Are you going to die soon?

4 Our data Kaiser Permanente Study of the Oldest Old, 1971-1979 and 1980-1988: [California] DEPENDENT VARIABLE: Dthflag = 1 if Died during study period 0 if alive at end of study period

5 Our data PREDICTOR VARIABLES: nursehome = 0 if lived at home continuously 1 = admitted to nursing home at any time

6 We all knew FREQ DID THIS PROC FREQ DATA = dsname ; TABLES varname1 * varname2 / chisq ; …AND THAT WITH THIS YOU YOU GET: – Chi-square value (several) – Phi coefficient – Fisher Exact test (where applicable)

7 Lets Start Simple: PROC FREQ PROC FREQ DATA =in.old ; TABLES dthflag ;

8 Not Too Interesting… 55.4% of our sample died.

9 …So lets Dig Deeper: STACKED BAR CHART

10 Stacked Bar Chart with SAS Enterprise

11

12

13 STACKED BAR Figure 1

14 STACKED BAR Figure 2

15 The Syntax PROC GCHART DATA=mydata.oldpeople; VBAR gender / SUBGROUP=dthflag TYPE= PCT INSIDE=PCT ;

16 Lets Keep Digging! Association Measures

17 Enterprise Guide Method

18

19

20

21 The Syntax PROC FREQ DATA = mydata.oldpeople ; TABLES dthflag*nursehome / NOROW NOPERCENT NOCUM CHISQ MEASURES ;

22 Nursing home placement by death Conditional probabilities

23 Being able to find SPSS in the start menu does not qualify you to perform a multinomial logistic regression

24 Chi-square results

25 The options & what they tell you

26 Chi-square results Pearson ∑ (f o – f e ) 2 f e

27 Chi-square results

28

29 What is Fisher’s exact test & when do I get one?

30

31 Fisher’s Exact Test: probability of a table as unusual as the one that you have obtained under the null hypothesis of no relationship.

32 With 2 x 2 Tables it’s automatic

33 Recap: Fisher’s Exact Test Small sample size OR Need exact probability

34 A bunch of things you may not know Proc Freq Does

35 Computing odds ratios Divide frequency row 1, column 1 by frequency in row 2 column 2 2,846/184 = 13.51 -- odds of a person who lived not being in a nursing home versus being in a home. Divide frequency in row 2, column 1 by frequency row 2, column 2 2,239/ 1,077 = 2.08 Divide first result by the second 13.51/ 2.08 = 6.49

36 Measures

37 Mantel-Haeszel chi-square Tests ordinal relationship Same as Pearson if only two categories

38 Ordinal relationship ?

39 Don’t just compare values

40 ER visits versus nursing home

41

42 More measures

43 Take-away 1.Different types of chi-square values, different types of correlations and other tests like odds ratios do exist. 2.These statistics are very easy to obtain using SAS. 3.While most times, all of these measures will point you in the direction of the same general conclusion, there are times when one is preferable to the others.

44 Take-away 2 Non-standard hypotheses call for non- standard statistics

45 What about this ? PROC FREQ DATA = dsname ; TABLES varname / BINOMIAL (EXACT EQUIV P =.333) ALPHA =.05 ;

46 What’s it Do? The binomial (equiv p =.333) will produce a test that the population proportion is.333 for the first category. That is “No” for death. A Z- value will be produced and probabilities for one-tail and two-tailed tests. The exact keyword will produce confidence intervals and, since I have specified alpha =.05, these will be the 95% confidence intervals.

47 Again, Not New

48 Hmmm…. This is interesting

49 Null rejected !


Download ppt "Categorical Data Analysis: When life fits in little boxes AnnMaria DeMars, PhD."

Similar presentations


Ads by Google