BookmarkSubscribeRSS Feed
knighsson
Obsidian | Level 7

Hello,

I want to run a multinomial logistic regression for sample survey data. The code is below.

 

I have two questions:

1. is this the right code for the multinomial logistic regression?

2. How to do the diagnostics? Below is my code using Pearson residuals, but I  am not sure it is right or not. (In addition, Does proc surveylogistic statement have goodness of fit test option? I did not find it, but please correct me if i am wrong ) Do I need to do any other diagnostic tests?

 

Thank you!

 

 

proc surveylogistic data=nh.diseases nomcar;
class cluster age gender PIR SDDSRVYR race/ param=glm;
    strata SDMVSTRA;
    cluster SDMVPSU;
    weight glucwt4yr;
domain eligible;
model BMI_outcome= age gender PIR SDDSRVYR race  EIEER totalcounts cluster/vadjust=none link=glogit RSQUARE;
output out=res_o predicted=prob_o; /*output the predicted probability*/
run;
 

proc sql;

create table res2_o as

select prob_o, BMI_outcome, glucwt4yr from res_o where prob_o is not missing;

run;

 

data res3_o;

set res2_o;

if BMI_outcome=1 then y_o = 1;  *** y=1 means that participants are obesity ;

else if BMI_outcome=2 then y_o = 2;  *** y=2 means that participants are overweight ;

else y_o=0;  *** y=2 means that participants are normal weight ;

pearson_o = sqrt(glucwt4yr)*(y_o-prob_o)/sqrt(prob_o*(1-prob_o)); /*by formula*/

run;

 

/* QQ plot */

proc univariate data=res3_o normal;

var pearson_o;

qqplot pearson_o/normal(mu=est sigma=est);

run;

1 REPLY 1
gcjfernandez
SAS Employee

The Surveylogistic code you specify is appropriate for fitting multinomial logistic regression with domain and survey design structure ( Design: strata, cluster and survey weight).

You could also include LSMeans and LSMESTIMATE statements.

 

Because the survey data analysis is design specific, and used in case of finite population, model based fit statistics, assumption checks are irrelevant. You could perform exploratory graphical analysis on Pearson residual for model specification error.

 

 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 376 views
  • 0 likes
  • 2 in conversation