BookmarkSubscribeRSS Feed
kathrin_r
Calcite | Level 5

Hi

Can anyone help me with the following problem:

I can't get estimates from the estimate statement and always get the message that the estimate is not estimable

A versus B for BMI <= 22  is not estimable."

proc glm data=inputdata;

       class trgrp  BMIgroup ;

       model outcome = trgrp   BMIgroup BMIgroup*trgrp /solution;

       estimate "A versus B for BMI <= 22 " BMIgroup 1 0 trgrp 1 -1 BMIgroup*trgrp 1  0 -1  0  ;

          run;

The variable trgrp and BMIgroup are both binary variables. I want to estimate the treatment effect in the group with the low BMI.

What am I doing wrong?

Thanks for your help.

4 REPLIES 4
plf515
Lapis Lazuli | Level 10

If you want to estimate the effect of trgrp in one BMI group then do this:

proc glm data=inputdata;

       class trgrp ;

       model outcome = trgrp;

      where bmigroup = 0;

run;

kathrin_r
Calcite | Level 5

But I also want to add another estimate statement for the group >22.

I think this should be possible with the estimate statement or is it really necessary to run twice proc glm with a where statement.

plf515
Lapis Lazuli | Level 10

You are dealing with the question of whether you want a stratified analysis (one for the low BMI group, one for the high BMI group) or a moderated model with an interaction term.

If you stratify the analysis, you could use a BY statement:

proc sort data = inputdata;

by bmigroup;

run;

proc glm data=inputdata;

       class trgrp ;

       model outcome = trgrp;

      by bmigroup;

run;

if you want a moderated model you could run

proc glm data=inputdata;

       class trgrp bmigrp ;

       model outcome = trgrp bmigrp trgrp*bmigrp;

      lsmeans trgrp bmigrp trgrp*bmigrp;

run;

and you could have an estimate statement as well - although I find LSMEANS easer to write and to have easier output to read.

SteveDenham
Jade | Level 19

And in this case, the use of the LSMESTIMATE statement is indicated.  However, it isn't supported in GLM, so a change to PROC MIXED would be one way to get this done. Another approach would be to use the SLICE option in the LSMEANS statement.

Steve Denham

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