turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- Analytics
- /
- Stat Procs
- /
- Contrasts Statement

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

04-14-2016 12:42 PM - edited 04-14-2016 12:46 PM

I'm trying to figure out how the Contrasts statement works

I'm running a simple glm on a single factor (glm31_cover_type)

I want to test whether each of the parameter estimates is independent from the other levels of the factor cover type. I've read a few articles on this but it seems quite complicated. I thought there would just be a statement that would produce something like the attachment.

How would I adjust my code below so that I get something like the attached? So, for each level of the factor I want to get the standard error of the parameter differences. There are 5 levels so 5+4+3+2+1 = 15 standard errors.

Specifically I'm confused by the "contrast label factor 1 -1" code. How do I change this to incororate a test of all parameter differences in the factor.

**proc** **genmod** data=insurancedata;

class glm31_cover_type(ref="COMP");

Weight NbClaims;

model AvgClaim = glm31_cover_type/ dist=gamma link=log obstats SCALE=DEVIANCE CORRB;

contrast 'Label1' glm31_cover_type **1** -**1** ;

ods output ParameterEstimates =myObStats CORRB = CorrMatrix Contrasts = TestOfContrasts;

**run**;

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

04-14-2016 01:02 PM

I think you will find the LSMEANS effect(s) / diff; statement is more suited to the task of all differences.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

04-14-2016 01:27 PM

Will that give you an estimate of the significance of the difference for each of the 15 combinations above? I'm interested in the individual differences rather than an overall. If you open the attachment in my last post you will see what I'm after. It just allows me to group levels that are similar. For example looking at the effect of cover type on claim frequency I might group "adft" and "comp" together as there is no statistically significant difference in their parameter estimates.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

04-14-2016 02:06 PM

LSMEANS will give you pair-wise differences. Use the LSMESTIMATE to do what you are asking about where you take the mean of 1 or more levels and compare to mean 1 or more other levels.

It might look something like

LSMESTIMATE effect -.5 -.5 .33333 .33333 .33333;

To compare the mean of levels 1+2 with mean of levels 3+4+5; You may want more decimal places or use divisor option.

lsmestimate effect -3 -3 2 2 2 / divisor=6;