Programming the statistical procedures from SAS

how to get p-value using proc reg

Accepted Solution Solved
Reply
Contributor
Posts: 35
Accepted Solution

how to get p-value using proc reg

Hello,

I have wrote the following code to built a regression model in SAS. but I also need p-value az an output. 

 

proc reg data=yearlyTrend_calculation;
 model yearlyAvg=a0 a1;
 output out=regres p=yhat r=e stdp=sd;
 run;

I would be really appriciate if somebody help me with this.

 

thank you in advance,

Samira


Accepted Solutions
Solution
‎12-19-2016 10:29 AM
Grand Advisor
Posts: 10,043

Re: how to get p-value using proc reg

 A Proc Statment is the bit that starts with Proc and ends with a ";" . 

So you want

proc reg data=yearlyTrend_calculation  Tableout outest=Est;
 model yearlyAvg=a0 a1;
 output out=regres p=yhat r=e stdp=sd;
run; 

View solution in original post


All Replies
Grand Advisor
Posts: 10,043

Re: how to get p-value using proc reg

Add

Tableout outest=Est

to the PROC statement

And output dataset named EST will have the pvalues among a lot of the other model statistics. Look at the value of _type_ the find the pvalue.

Contributor
Posts: 35

Re: how to get p-value using proc reg

[ Edited ]

I chaged my code to the following based on your suggestion: 

 

proc reg data=yearlyTrend_calculation;
model yearlyAvg=a0 a1;
output out=regres p=yhat r=e stdp=sd;
Tableout outest=Est;
run; 

 

but when I want to print the result :  proc print data=Est; run;  , I got the following error: 
run;



 

 182         Tableout outest=Est;
             ________
             180
 NOTE: The previous statement has been deleted.
 ERROR 180-322: Statement is not valid or it is used out of proper order.

 

Solution
‎12-19-2016 10:29 AM
Grand Advisor
Posts: 10,043

Re: how to get p-value using proc reg

 A Proc Statment is the bit that starts with Proc and ends with a ";" . 

So you want

proc reg data=yearlyTrend_calculation  Tableout outest=Est;
 model yearlyAvg=a0 a1;
 output out=regres p=yhat r=e stdp=sd;
run; 
☑ This topic is SOLVED.

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

Discussion stats
  • 3 replies
  • 178 views
  • 2 likes
  • 2 in conversation