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
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.
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.