Hi,
I am running a regression with proc surveyreg which looks like this: Y= x0 + X1 + X1*DD + X1*X2 + X1*X2*DD.
DD is a dummy variable and all the other ones are continuous variables.
How can I compare the effect (!) of the regression slopes between X1*DD and X1*X2*DD and test if the difference is significant? I do not want to include the intercept.
While this doesn't do a formal hypothesis test of the difference, it should tell you everything you want to know. Add CLPARM and SOLUTION to your MODEL statement. You could then match up the appropriate terms and look for overlap in the confidence intervals.
I think the only way to get a formal test will involve getting the inverse of the X'X (or X'WX) matrix and construct the proper quadratic form, because as you have identified, CONTRAST, ESTIMATE and LSMESTIMATE statements don't really lend themselves to testing between continuous covariate estimates. I suppose that you could construct an ESTIMATE statement that had everything in there, in the right place, and used the proper values, but I suspect that it would be more likely to give an estimate at the particular values of the continuous covariate than of the difference in the slope estimates.
Steve Denham
Is there some reason that X2 is not included in main effects??
X2 and DD are additional included as main effects.
I think both CONTRAST Statement and ESTIMATE Statement can do that .
While this doesn't do a formal hypothesis test of the difference, it should tell you everything you want to know. Add CLPARM and SOLUTION to your MODEL statement. You could then match up the appropriate terms and look for overlap in the confidence intervals.
I think the only way to get a formal test will involve getting the inverse of the X'X (or X'WX) matrix and construct the proper quadratic form, because as you have identified, CONTRAST, ESTIMATE and LSMESTIMATE statements don't really lend themselves to testing between continuous covariate estimates. I suppose that you could construct an ESTIMATE statement that had everything in there, in the right place, and used the proper values, but I suspect that it would be more likely to give an estimate at the particular values of the continuous covariate than of the difference in the slope estimates.
Steve Denham
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.