BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
kivester
Obsidian | Level 7

I am using sas v9.3 proc genmod to model a continuous outcome:

 

PROC GENMOD;
class number train bl/param=glm;
model y= train age mt pn eo tncc bl;
effectplot fit (x=mt plotby=train)/obs;
repeated subject=number/type=ar rupdate=2;
run;

My class variable train has 8 levels, but the effectplot displays on trainer 1, 4, 5, 6, 7, and 8. Trainers 2 and 3 are ommited for some reason. If a perform a slicefit plotby train, all levels are displayed, but that isn't the graph I really want. Any reason two levels of my class variable are being omitted?

 

Thanks!

Katy

 

1 ACCEPTED SOLUTION

Accepted Solutions
Rick_SAS
SAS Super FREQ

Most likely reason is that you have insufficient observations to fit a model for those levels, due to missing value in other variables. The following simulated data has a similar structure to what you have specified. Run it and see if you get 8 plots.  If so, the problem is probably related to your data:

 

data have;
call streaminit(1);
do number=1 to 4;
   age = 20 + ceil(20*rand("uniform"));
   do train=1 to 8;
      do j = 1 to 4;
         mt = rand("Normal");
         y = 2 + age + 3*train - mt + rand("normal");
         output;
      end;
   end;
end;
run;

PROC GENMOD data=have;
class number train /param=glm;
model y= train age mt;
effectplot fit (x=mt plotby=train)/obs;
repeated subject=number/type=ar rupdate=2;
run;

View solution in original post

1 REPLY 1
Rick_SAS
SAS Super FREQ

Most likely reason is that you have insufficient observations to fit a model for those levels, due to missing value in other variables. The following simulated data has a similar structure to what you have specified. Run it and see if you get 8 plots.  If so, the problem is probably related to your data:

 

data have;
call streaminit(1);
do number=1 to 4;
   age = 20 + ceil(20*rand("uniform"));
   do train=1 to 8;
      do j = 1 to 4;
         mt = rand("Normal");
         y = 2 + age + 3*train - mt + rand("normal");
         output;
      end;
   end;
end;
run;

PROC GENMOD data=have;
class number train /param=glm;
model y= train age mt;
effectplot fit (x=mt plotby=train)/obs;
repeated subject=number/type=ar rupdate=2;
run;

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 1096 views
  • 0 likes
  • 2 in conversation