Programming the statistical procedures from SAS

compare regression slopes

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 6
Accepted Solution

compare regression slopes

[ Edited ]

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. 


Accepted Solutions
Solution
‎07-24-2016 02:45 PM
Respected Advisor
Posts: 2,655

Re: compare regression slopes

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

View solution in original post


All Replies
Super User
Posts: 10,875

Re: compare regression slopes

Is there some reason that X2 is not included in main effects??

Occasional Contributor
Posts: 6

Re: compare regression slopes

[ Edited ]

X2 and DD are additional included as main effects. 

Super User
Posts: 9,779

Re: compare regression slopes

I think both CONTRAST Statement and ESTIMATE Statement can do that .

Occasional Contributor
Posts: 6

Re: compare regression slopes

Thanks!
For clarification: If I use the contrast statement I can only compare the values of the dummy variable with each other under specified values of the continuous variable? Or can I use the contrast statement to something like an F-Test for groups of continuous regression slopes?
And if I use the estimate statement, I can estimate the effect for all specified variables. However I do not have the difference between effects. Am I wrong here?
Super User
Posts: 9,779

Re: compare regression slopes

Sorry. I am not expert about it. I want leave it to @Steve .... CONTRAST can compare these two coefficience/parameter of variables are equal or not.
Solution
‎07-24-2016 02:45 PM
Respected Advisor
Posts: 2,655

Re: compare regression slopes

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

Occasional Contributor
Posts: 6

Re: compare regression slopes

Ok, thank you!
☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 7 replies
  • 309 views
  • 0 likes
  • 4 in conversation