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
- /
- Proc Reg / GLM

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

04-07-2009 10:00 PM

Hello,

I have a question about Proc Reg or GLM about prediction. I was trying to use proc reg and proc glm to make prediction. I have a code as follow:

proc glm data=Sports_Wins_vs_Spending;

model wins = spending / P;

run;

quit;

Let's say I have the following data:

Wins Spending

30 50

35 55

60 57

44 68

The option "P" gives me the predicted value at each of the spending level that I have in the dataset (50, 55, 57, 68). However, there is a specific Spending I would like to use to predict the Number of Wins for the team. Can anyone tell me what would be the code to specify the Spending that I want (say, 45) in the model and get the predictive boundary (say 95%) for that predicted value?

I have a question about Proc Reg or GLM about prediction. I was trying to use proc reg and proc glm to make prediction. I have a code as follow:

proc glm data=Sports_Wins_vs_Spending;

model wins = spending / P;

run;

quit;

Let's say I have the following data:

Wins Spending

30 50

35 55

60 57

44 68

The option "P" gives me the predicted value at each of the spending level that I have in the dataset (50, 55, 57, 68). However, there is a specific Spending I would like to use to predict the Number of Wins for the team. Can anyone tell me what would be the code to specify the Spending that I want (say, 45) in the model and get the predictive boundary (say 95%) for that predicted value?

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

04-08-2009 09:13 AM

Try the ESTIMATE statement. I think that something like this would work:

ESTIMATE 'Spending is 45' spending 45/CLPARM;

ESTIMATE 'Spending is 45' spending 45/CLPARM;

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

04-08-2009 05:14 PM

Hi,

You may want to try the following code:

data s;

input wins spending;

datalines;

30 50

35 55

60 57

44 68

. 45

;

proc reg data=s;

model wins=spending;

output out=predict

p=wins_pred

LCL=wins_95LCL

UCL=wins_95UCL ;

proc print data=predict(where=(wins=.)) noobs;

run;

In the output window you'll see predicted wins (wins_pred) for spending=45 along with the lower (wins_95LCL) and upper (wins_95UCL) bounds of 95% CI for an individual prediction.

More about an OUTPUT statement in PROC REG:

http://support.sas.com/documentation/cdl/en/statug/59654/HTML/default/statug_reg_sect015.htm Message was edited by: statsplank

You may want to try the following code:

data s;

input wins spending;

datalines;

30 50

35 55

60 57

44 68

. 45

;

proc reg data=s;

model wins=spending;

output out=predict

p=wins_pred

LCL=wins_95LCL

UCL=wins_95UCL ;

proc print data=predict(where=(wins=.)) noobs;

run;

In the output window you'll see predicted wins (wins_pred) for spending=45 along with the lower (wins_95LCL) and upper (wins_95UCL) bounds of 95% CI for an individual prediction.

More about an OUTPUT statement in PROC REG:

http://support.sas.com/documentation/cdl/en/statug/59654/HTML/default/statug_reg_sect015.htm Message was edited by: statsplank