BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
samira
Obsidian | Level 7

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

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

 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

3 REPLIES 3
ballardw
Super User

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.

samira
Obsidian | Level 7

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.

 

ballardw
Super User

 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; 

sas-innovate-2024.png

Today is the last day to save with the early bird rate! Register today for just $695 - $100 off the standard rate.

 

Plus, pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is ANOVA?

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.

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