BookmarkSubscribeRSS Feed
MetteSP
Calcite | Level 5

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

1 REPLY 1
ballardw
Super User

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.

 

 

 

 

 

 

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is Bayesian Analysis?

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 673 views
  • 2 likes
  • 2 in conversation