Programming the statistical procedures from SAS

Chi-square test of association

Frequent Contributor
Posts: 132

Chi-square test of association

I have data that has measures of compliance (pass/fail) and mortality (died/survived), as well as, pre-existing conditions that are binary categorical variables.  I've already run formal tests with the pre-existing condition variables against both compliance and mortality using a Chi-square test of association to identify statistically significant differences across both outcome variables.


My next approach is to look at the different mortality rates between compliance for each of the pre-existing conditions.  My initial thought is to do the exact same approach as I did previously, but instead I would limit my data to only observations that had a specific pre-existing condition and then do a Chi-square test of association between compliance and mortality.


I'm not sure if this would be a valid test since I'm not including my entire population of data, or if there is a better approach that I should use to compare the two rates of mortality for the pre-existing conditions like a T-test or a Binomial proportions test?  I know there are formal tests that compare population proportions, but are those just T-tests or should I continue my approach of using a Chi-square test?

SAS Employee
Posts: 91

Re: Chi-square test of association

One option might be to fit a log-linear to the counts instead and then you could perform something akin to multiple comparisons using an LSMEANS or ESTIMATE statement.  Something like what is done in this usage note: 

Frequent Contributor
Posts: 132

Re: Chi-square test of association

Thank you for your response and suggestion using a log-linear approach.  My only concern after looking at the link is that the example is looking specifically into comparing the different values of the TYPE categorical variable across SITE (still considering two variable comparisons, just across different values of one of the variables).  In my data, I would essentially have three separate variables:  the co-existing condition binomial variable, the outcome binomial variable, and the mortality binomial variable.


By looking at the different mortality rates across the different outcome values (PASS/FAIL), that is already taking the two variable comparison approach like in the example.  The only difference would be that I would need to filter the data for only the observations that have the co-existing condition.  Basically, it's not multi testing like the example displays as it would be just one test between mortality and outcome, however, it would be for a sub-set of the population (those observations that have the co-existing condition).


My thought is to run the following:


PROC FREQ DATA=analysis (WHERE=(coexist_cond=1));

  TABLES outcome*death / chisq measures relrisk;



This would tell me if there is a difference between passing and dying vs failing and dying for those with the co-exisitng condition.  I'm just not sure if the test is valid given that I'm only looking at a sub-set of the population where the observations have the co-exisitng condition.  Does any of this make sense?  Again, thanks for your time and help.

Ask a Question
Discussion stats
  • 2 replies
  • 2 in conversation