BookmarkSubscribeRSS Feed
Mahiya17
Calcite | Level 5

I need x to = 1 - 178 (observations). So far my commands are:

 

/* transform consumption and income variables into logs*/

data session3.combinedfiles;
set session3.combinedfiles;

y=log(PCECC96);
x1=log(DPIC96);
x2=log(MPRIME);
run;

 

/* multiple regression model: suppose Y now depends on x1 and x2: Y = beta0+ beta1 x1 + beta2 x2 + error*/

proc reg data=session3.combinedfiles;
model y = x1 x2;
output out=session3.est_data1 residual=e predicted=y_hat lcl=lower95 ucl=upper95;
run;
quit;

 

As you can see I don't have a column called X which simply equals id. Thank you for the help.


q1.PNG
4 REPLIES 4
PGStats
Opal | Level 21

Simply add a statement:

 

/* transform consumption and income variables into logs*/
data session3.combinedfiles;
set session3.combinedfiles;
y=log(PCECC96);
x1=log(DPIC96);
x2=log(MPRIME);
ID=_n_;
run;
PG
Mahiya17
Calcite | Level 5

I still don't have a column that says X and under it the numbers from 1 through 178.


q1.PNG
PGStats
Opal | Level 21

Something went wrong. Check the log. You should have a new column called ID in your OUT= dataset.

PG
Rick_SAS
SAS Super FREQ

If you want the variable to be named x, then use

x = _n_;

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 4 replies
  • 1481 views
  • 0 likes
  • 3 in conversation