how to use R² from multiple regressions as a variable in another regression

Accepted Solution Solved
Reply
Contributor
Posts: 43
Accepted Solution

how to use R² from multiple regressions as a variable in another regression

hi i am estimating regressions for stock prices on monthly basis, i want to creat a timeseries variable of R² from each regression , How to do it????


Accepted Solutions
Solution
‎07-04-2012 09:37 PM
Respected Advisor
Posts: 4,654

Re: how to use R² from multiple regressions as a variable in another regression

Like this :

proc reg data=have outest=want;

by myStock myWhatever;

model myPrice = myXvariable / rsquare;

run;

proc print data=want;

var myStock myWhatever _RSQ_;

run;

PG

PG

View solution in original post


All Replies
Solution
‎07-04-2012 09:37 PM
Respected Advisor
Posts: 4,654

Re: how to use R² from multiple regressions as a variable in another regression

Like this :

proc reg data=have outest=want;

by myStock myWhatever;

model myPrice = myXvariable / rsquare;

run;

proc print data=want;

var myStock myWhatever _RSQ_;

run;

PG

PG
Contributor
Posts: 43

Re: how to use R² from multiple regressions as a variable in another regression

Thanks for the quick reply , i have another question how can i calculate weekly standard deviation from my daily price series and use it in a regression as a variable??

Thanks

Regards

Respected Advisor
Posts: 4,654

Re: how to use R² from multiple regressions as a variable in another regression

If I get it right, what you want is something like (untested) :

proc sql;

create table myWstd as

select stock, intck("WEEK", '01JAN2000'd, myDate) as weekNo, std(price) as priceStd

from myData

group by stock, calculated weekNo;

  
and then regress priceStd on weekNo, by stock.

PG

PG
☑ This topic is SOLVED.

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

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