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 R-square for individual time-series gro...

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

02-23-2015 01:56 AM

Hi! I am running a time series model with multiple firms with multiple years of observation (more than 10,000 observations).** I want to get R-squares for individual firms**. I know that r-square will show up in the individual firms' output report.But** I don't know how to obtain a data file includes both firm_id and also R-square for each firm**. Any suggestion will be appreciated.

The following is my SAS data and code information.

my basic code is

PROC AUTOREG DATA=TS;

by firm_id;

MODEL price=bps;

OUTPUT OUT=OUT1;

RUN;

Original data sample:

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

02-23-2015 02:17 PM

Try using ODS to get a dataset with the R squared values:

PROC AUTOREG DATA=TS;

by firm_id;

MODEL price=bps;

OUTPUT OUT=OUT1;

ods output fitstatistics=fitstatistics;

RUN;

This will generate a dataset in your WORK library with the regression R squared values for each BY variable.

Steve Denham