Dear Community,
I have read various post about when to use chi-squared test and when to use logistic regression and I have come to the conclusion, that it depends on who you ask.
However, I thought I would get the same result independent of what method I decided to use to examine the association between two variables. Now, - that is not the case in my situation.
I used the codes to examine the association between the preditive variable community and the criteria variabe MDD (event 1).
proc surveylogistic data=dietdivdummy; (This shows no sig. diff.)
model mdd (event="1")=community;
weight sampwt;
run;
proc freq data=dietdivdummy; (This shows a sig. diff. between the two communities)
tables mdd*community / chisq;
exact pchi or;
weight sampwt;
run;
I am still very new in this game so hope someone can explain to me what I am doing wrong.
I want to model the determinants of and predict the likelihood of an outcome and therefore will go with the proc surveylogistic methode. But can I trust the outcome?
Thanks,
Mette
Logistic regression assumes a function of the mean of the response variable is assumed to be linearly related to the explanatory variables.
Since you are not showing any complex sample design elements in the surveylogistic code why are you using surveylogistic?
Chi-square tests are for homogeneity or independence or measures of association. So your test is asking "are the variables associated", not "how does a change is one variable relate to a change in the other".
Also weight has somewhat different meaning between the two procedures.
Proc freq: If you use a WEIGHT statement, PROC FREQ assumes that an observation represents n observations, which will effectively change the sample size used for calculations.
Surveylogistic weight variable contains sampling weights, which are not the same.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Select SAS Training centers are offering in-person courses. View upcoming courses for: