Help using Base SAS procedures

Different results proc survey logistic and proc freq (chisq)

Occasional Contributor
Posts: 8

Different results proc survey logistic and proc freq (chisq)

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;

proc freq data=dietdivdummy;   (This shows a sig. diff. between the two communities)
tables mdd*community / chisq;
exact pchi or;
weight sampwt;


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?




Super User
Posts: 13,583

Re: Different results proc survey logistic and proc freq (chisq)

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.







Ask a Question
Discussion stats
  • 1 reply
  • 2 in conversation