BookmarkSubscribeRSS Feed
chrisdunlap
Calcite | Level 5

Hi all,

Sorry if this question isn't worded correctly or I missed an already solved thread, I feel like I did my due diligence looking but I turned up blanks. I am running a multinomial logistic regression and I haven't had any issues with the model or handling of variables until I hit this specific item. I am using a secondary data set where an item asks where is the main place someone works with different responses of indoors, outdoors, indoors and outdoors, etc. Here is a subsection of the code where I am regrouping another variable into the one I plan on using.

 

	If pek1a=1 or pek1a=4 Then Smokeloc=1;				/* Indoors */
	If pek1a=2 Then Smokeloc=2;							/* Outdoors */
	If pek1a=3 Then Smokeloc=3;							/* Equally Indoors and Outdoors */
	If pek1a=5 or pek1a=6 Then Smokeloc=4;				/* Travel or Varies */
	Else If pek1a<=0 Then Delete;

 

 

When I run my survey logistic it shows all of my variable parameters.

 

proc surveyfreq data=tus1819 Varmethod=BRR (Fay=0.5);
Tables ATSMCARC / cl;
Tables (other variables here Smokeloc)*ATSMCARC / cl row;
Weight PWSRWgt;
Repweights RepWgt001-RepWgt160;
Run;

This all works fine and shows all of my items for specifically smokeloc.

All parametersAll parameters

 

However, the regression below doesn't run them all and drops most of them.

 

 

proc Surveylogistic data=tus1819 VarMethod=brr (Fay=0.5);
Class other variables here Smokeloc(ref='Indoors') / Param=Ref;
Model ATSMCARC = other variables here Smokeloc / link = glogit;
Weight PWSRWgt;
Repweights RepWgt001-RepWgt160;
Run;

And then I end up with this where only two of them are left.

Missing parametersMissing parameters

 

I have no idea what is going on because I've done this exact process with all of my other variables with no issues. Does anyone have an idea what I am doing wrong or what I should be looking for? I don't see any issues popping up in the log either when it is run.

Thanks!

2 REPLIES 2
SAS_Rob
SAS Employee

Very likely there are missing values in some of the other variables that causes observations from the other SmokeLoc levels to be dropped from the analysis.  You should run Crosstabs between SmokeLoc and the other variables individually to see which variables are causing the issue.  You might then consider not using that variable(s) in the model or treating missing as a valid category.

ballardw
Super User

To add to @SAS_Rob , I like to use the options LIST and MISSING in a tables statement in Proc Freq when more than 2 variables are involved as the output is easier to read and is pretty clear about where the "missing" are impacting.

 

Dummy code as an example:

 

Proc freq data=yourdata;

   tables var1 * var2 * othervar / list missing;

run;

 

This would be recommended for Class or categorical variables.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 2 replies
  • 561 views
  • 0 likes
  • 3 in conversation