Programming the statistical procedures from SAS

Proc genmod effect of using an offset on LSmeans

Reply
New Contributor
Posts: 4

Proc genmod effect of using an offset on LSmeans

Hello,

 

I am currently running a proc genmod with poisson distribution on a dataset and was looking for LSmeans estimated for one of the variables.

When I do this without an offset included and I ask to transform the LSmeans back to response scale (ilink) I get estimates that make intuitive sense (on the correct scale of the original count variable).

 

However when I include an offset in the model (based on the log of another variable), the LSmeans seem to be presented on a different scale, even with the ilink option included. Results are strongly correlated though.

 

So I was wondering what exactly is happening in the LSmeans estimation when an offset is included in the model. And additionaly how to get the LSmeans back to response scale with an offset included in the model.

Ideally I want to get estimates on the original count scale with an offset included in the model.

 

model with offset:

ods output LSmeans=LSmeans;
proc genmod data=control;
class F2 block ;
model eggs = F2 block / type3 dist=poisson offset=l_area;
lsmeans F2/cl  ilink;run;quit;

 

model without offset:

ods output LSmeans=LSmeans1;
proc genmod data=control;
class F2 block ;
model eggs = F2 block / type3 dist=poisson ;
lsmeans F2/cl ilink;run;quit;

 

The first model produces LSmeans with the following values for the "mean" column in the LSmeans output:

0.04437
0.07704
0.03344
0.03425
0.02408
0.05762

The second model produces LSmeans with the following values for the "mean" column in the LSmeans output:

  9.2543
 15.1355
  9.9462
  6.5443
  4.8722
 10.4939

 

Thank you in advance.

Grand Advisor
Posts: 9,458

Re: Proc genmod effect of using an offset on LSmeans

[ Edited ]

 

lsmeans age / ilink diff exp cl ;

 

I think that is  what supposed to be, 

offset=  will offset a value from mean of population.

New Contributor
Posts: 4

Re: Proc genmod effect of using an offset on LSmeans

Thank you for replying, but this does not seem to translate the marginal averages back to the original count scale.

From what I understand, this is just the way it is and I have to interpret the results on a rate scale instead of the original count scale.

 

Frequent Contributor
Frequent Contributor
Posts: 132

Re: Proc genmod effect of using an offset on LSmeans

When you use an offset, you are modeling rate (eggs/area) rather than count (eggs). See the example here:

 

http://support.sas.com/kb/24/188.html

New Contributor
Posts: 4

Re: Proc genmod effect of using an offset on LSmeans

This is also what I have found, there seems to be no transformation back to the original count scale available.

I will just have to work with that scale in my results (which is also reasonable).

 

Thank you

Frequent Contributor
Frequent Contributor
Posts: 132

Re: Proc genmod effect of using an offset on LSmeans

I'll admit, it's not clear to me why you would model rate (eggs/area) but want estimates of count (eggs). The only scenario in which that makes sense is when area is the same for every observation. If area differs among observations then, really, what are you to make of count data? I don't see the logic in that. You note that rate is "reasonable" so that's probably the path you should follow.

New Contributor
Posts: 4

Re: Proc genmod effect of using an offset on LSmeans

The desire to present the results on the count scale comes from a customer. And I have at least to try to accomodate their wishes.

 

Ask a Question
Discussion stats
  • 6 replies
  • 102 views
  • 2 likes
  • 3 in conversation