BookmarkSubscribeRSS Feed
ABiostatistician
Calcite | Level 5

I ran a PROC GENMOD code (see below).  The output shows that the least squares means for a binary variable, "Q", are non-estimable, but there is an estimated difference in least squares means between "Q = 1" and "Q = 0".

How is this possible?  I thought that the difference in least squares means is calculated by subtracting the 2 least squares means.  If my least squares means are non-estimable, then shouldn't my difference in least squares means be non-estimable, too?

Thanks for your thoughts.

proc genmod

  data = mydata;

  class Q (ref = '0')

  X (ref = '1')

  W (ref = '1')

  R;

  model successes/trials

  =

  Q

  X

  W

  X * W

  Q * X

  Q * W

  / dist = bin

  link = logit;

  repeated

  subject = R;

  lsmeans Q / exp diff cl e;

  lsmeans X / exp diff cl e;

  lsmeans W / exp diff cl e;

  lsmeans X * W / exp diff cl e;

  lsmeans Q * X / exp diff cl e;

  lsmeans Q * W / exp diff cl e;

run;

3 REPLIES 3
Rick_SAS
SAS Super FREQ

Normally I don't try to answer these kinds of questions, but it is Saturday morning and I don't know if the experts will see this question until Monday.  I am not an expert in this area, but I'll give it a shot.

In theory, it possible to estimate the difference of means without being able to estimate the means. Suppose I collect data for two variables, X and Y. I don't give you the original data, but instead decide to subtract off some reference value from both variables nd then give you the adjusted values. I might subtract 7 or 13 or 321...you don't know.  As a consequence of my manipulation, there is no way that you can estimate the means of the variables. Howeer, you can easily estimate the mean of the difference X-Y, since my subtraction cancels out.

In your case, you have a binary variable Q. The level Q=0 is not estimable because it is getting lumped in with the intercept term. (I assume the level Q=1 has an estimate, right?)  However, you can estimate the incremental effect of Q=1 as compared to Q=0, which means that you can estimate the difference.

lvm
Rhodochrosite | Level 12 lvm
Rhodochrosite | Level 12

This can easily happen with fixed-effect models.

ABiostatistician
Calcite | Level 5

Thanks for your reply on a Saturday morning, Rick!

No, actually - I do not get an estimate for Q = 1 in the least squares mean output.  Both Q = 1 and Q = 0 are non-estimable in the least squares mean table.

As I understand, the difference in least squares means is calculated by subtracting the 2 least squares means - which makes my result very strange.  If both the least squares means are non-estimable, then how can the difference in least squares means be estimable?

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!

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