turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- Analytics
- /
- Stat Procs
- /
- how to get p-value using proc reg

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

12-16-2016 12:59 PM

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

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

12-16-2016 03:38 PM

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;

All Replies

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

12-16-2016 01:57 PM

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.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

12-16-2016 02:03 PM - edited 12-16-2016 02:05 PM

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

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

12-16-2016 03:38 PM

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;