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;
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;
04-14-2016 01:27 PM
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;