BookmarkSubscribeRSS Feed
SAS_novice1
Fluorite | Level 6

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.

6 REPLIES 6
Ksharp
Super User

 

lsmeans age / ilink diff exp cl ;

 

I think that is  what supposed to be, 

offset=  will offset a value from mean of population.

SAS_novice1
Fluorite | Level 6

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.

 

sld
Rhodochrosite | Level 12 sld
Rhodochrosite | Level 12

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

SAS_novice1
Fluorite | Level 6

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

sld
Rhodochrosite | Level 12 sld
Rhodochrosite | Level 12

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.

SAS_novice1
Fluorite | Level 6

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.

 

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
  • 6 replies
  • 1934 views
  • 2 likes
  • 3 in conversation