Programming the statistical procedures from SAS

Estimate statement with interaction

Reply
Occasional Contributor
Posts: 10

Estimate statement with interaction

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.

Frequent Contributor
Posts: 140

Re: Estimate statement with interaction

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;

Occasional Contributor
Posts: 10

Re: Estimate statement with interaction

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.

Frequent Contributor
Posts: 140

Re: Estimate statement with interaction

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.

Respected Advisor
Posts: 2,655

Re: Estimate statement with interaction

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

Ask a Question
Discussion stats
  • 4 replies
  • 276 views
  • 0 likes
  • 3 in conversation