DATA Step, Macro, Functions and more

How to perform t test on slope in proc reg

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 76
Accepted Solution

How to perform t test on slope in proc reg

Dear All,

 

I want to do a t-test on the slope of a simple linear regression.

H0: slope=1 VS Ha: slope !=1;

 

I tried the folowing code,"test predicted=1; ", but it performed the overall F test on slope=1 and intercept=0 

 

proc reg data=test;
model observed=predicted;
test predicted=1; 
quit; 

 

Thanks!!

 

Best wishes.


Accepted Solutions
Solution
‎06-07-2017 02:18 PM
Trusted Advisor
Posts: 1,926

Re: How to perform t test on slope in proc reg

[ Edited ]
Posted in reply to Xiaoningdemao

The TEST command does not product the standard ANOVA F-test. The TEST commands tests the specific hypothesis you are interested in, which in this case is testing the slope = 1 only.

View solution in original post


All Replies
Trusted Advisor
Posts: 1,926

Re: How to perform t test on slope in proc reg

Posted in reply to Xiaoningdemao

It's not obvious why you are making the statement that the TEST command is testing "the overall F test on slope=1 and intercept=0 ", as far as I know, this is not true. Why do you think it is testing this and not testing slope=1?

 

I also am mystified by

 

model observed=predicted;

 

as this makes little sense to me.

Frequent Contributor
Posts: 76

Re: How to perform t test on slope in proc reg

Posted in reply to PaigeMiller

Dear Paige,

 

Thank you for the response!

 

You are right, I should wrote

model observed=predicters;

maybe this is more reasonable?

 

As for the TEST command, the output shows a F-test. Isn't F-test come with ANOVA, and is an overall global test testing "slope=1 and intercept=0"?

 

 

Thank you!

 

Best wishes.

 

Solution
‎06-07-2017 02:18 PM
Trusted Advisor
Posts: 1,926

Re: How to perform t test on slope in proc reg

[ Edited ]
Posted in reply to Xiaoningdemao

The TEST command does not product the standard ANOVA F-test. The TEST commands tests the specific hypothesis you are interested in, which in this case is testing the slope = 1 only.

Frequent Contributor
Posts: 76

Re: How to perform t test on slope in proc reg

Posted in reply to PaigeMiller
Dear Paige,

Oh, I see!!

Thank you very much!

Best wishes.
☑ This topic is solved.

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

Discussion stats
  • 4 replies
  • 181 views
  • 0 likes
  • 2 in conversation