Forecasting using SAS Forecast Server, SAS/ETS, and more

Regression

Reply
Regular Contributor
Posts: 183

Regression

Hi All,

I have the following variables in my dataset: companyISIN, year, car5, bm, mv, roa, dy. I also need to do the log of mv variable and divide roa by ression100. So the dependent variable will be car5 and independent variables will be bm, log of mv, roa/100, and dy. In the regression, there will be two fixed effects: firm (i.e. companyISIN) and year.

How can I run the fixed effects regression using proc panel. proc glm, or proc mixed?


I run the following codes but it does not work:

proc panel data = x;

model car = mv ta roa ni dy / fixone;

id CompanyISIN year;

run;


I have included the data file so you can have a look.

Thanks.

Attachment
SAS Employee
Posts: 89

Re: Regression

Posted in reply to AbuChowdhury

what does the log file say?

I see a bunch of issues.

First, your dependent variable is almost always missing. That dep variable name is car5 but you call it car in the syntax. Other than that, it looks ok as long as the data are sorted.

What do the other variables mean? Happy to help if you provide some additional info.

Thanks-Ken

Regular Contributor
Posts: 183

Re: Regression

Hi,

Thanks for reply. Yes, the dependent variable will me missing many places because the dependent variable is cumulative abnormal return and independent variables are firm level variables such as book-to-market, market value, return on assets, dividend yield. There are observations for each firm each year of the independent variables but dependent variable, car5, does not have the observations for each firm each year.

Yes, the syntax will be car5.

In the log file, it tells that there is one cross cross section or time series.

I need to run the regression with firm (companyISIN) and year fixed effects. So what will be the codes? should I continue to use proc panel? or should I use proc glm or proc mixed?

Let me know if you need further information. Your help is highly appreciated.

SAS Employee
Posts: 89

Re: Regression

Posted in reply to AbuChowdhury

You can use any PROC you wish, this is a conceptual problem and not a tool problem. For simplicity, you might want to use PROC MIXED or GLM though. See this note SAS/ETS(R) 13.1 User's Guide

If you want to use a Fixed Effects (FE) strategy to control for time and firm level heterogeneity, you are going to have some issues with such sparse data.

Here is the strategy I would use,

proc qlim data=tmp1.x ; class year   ;model car5 = bm mv roa dy year / noint;nloptions maxiter=0; run;

This is effectively creating a Dummy for each time and for each cross section.  Given that you only have one observation in some cross-sections you need to omit an intercept to get anything that makes sense.  Personally I think you should probably consider a Random Effects strategy for estimation because of your data problems. (PROC MIXED)

Hope this helps.

Regular Contributor
Posts: 183

Re: Regression

proc qlim is running and showing the results but the logfile also shows the following error message:

WARNING: The Hessian matrix is singular.

ERROR: QUANEW Optimization cannot be completed.

SAS Employee
Posts: 416

Re: Regression

Posted in reply to AbuChowdhury

Hello -

The error message bascially tells you that the nonlinear optimization algorithm failed to execute.

You may want to try a different optimization technique: http://support.sas.com/documentation/cdl/en/etsug/66840/HTML/default/viewer.htm#etsug_nlomet_sect005...

Thanks,

Udo

Trusted Advisor
Posts: 1,228

Re: Regression

Posted in reply to AbuChowdhury

Just remove maxiter=0 from syntax .

SAS Employee
Posts: 89

Re: Regression

Hi,

I included maxiter=0 because I wanted the estimates to be OLS and that is what the optimizer uses as initial values. 

Ideally I would have sent you to PROC REG but I couldn't find how to easily do class variables.  Feel free to use any tool that uses OLS. 

Ken

Trusted Advisor
Posts: 1,228

Re: Regression

Hi Ken,


Based on error message it seems OLS estimates can not be calculated.

Thanks,

Naeem

Ask a Question
Discussion stats
  • 8 replies
  • 1041 views
  • 0 likes
  • 4 in conversation