BookmarkSubscribeRSS Feed
WilliamBoecklen
Fluorite | Level 6

How do I test a null hypothesis of slope=1 in linear regression?

 

I tried Test x=1;

 

It did not work.

 

Thanks.

2 REPLIES 2
ballardw
Super User

@WilliamBoecklen wrote:

How do I test a null hypothesis of slope=1 in linear regression?

 

I tried Test x=1;

 

It did not work.

 

Thanks.


So where is the actual regression you used?

Example data might help.

 

"It did not work" is awful vague.

Are there errors in the log?: Post the code and log in a code box opened with the {i} to maintain formatting of error messages.

No output? Post any log in a code box.

Unexpected output? Provide input data in the form of data step code pasted into a code box, the actual results and the expected results. Instructions here: https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat... will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the {i} icon or attached as text to show exactly what you have and that we can test code against.

 

Perhaps comparing the results of the different output between these two calls to proc reg will help.

Pay particular attention to the last 3 tables generated as they are the results of the TEST= options. Large F values or small p-values (Pr>F) indicate the tested value is likely not the parameter for the variable.

proc reg data=sashelp.class;
   model Weight = Height;
   title 'without  test';
run;quit;title;

proc reg data=sashelp.class;
   model Weight = Height;
   hgt1: test height=1;
   hgt3_5: test height=3.5;
   hgt3_8: test height=3.8;
   title 'with  test';
run;quit;title;
WilliamBoecklen
Fluorite | Level 6

Hi,

 

Here is the code:


ods noproctitle;
ods graphics / imagemap=on;

proc reg data=WORK.PROJECT2 alpha=0.05 plots(only)=(diagnostics residuals
fitplot observedbypredicted);
model Professor=Student /;
test Student=1;
run;
quit;

 

 

 

The line, "test student=1" does not change the output from that generated without that statement.

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 2357 views
  • 0 likes
  • 2 in conversation