BookmarkSubscribeRSS Feed
AbuChowdhury
Fluorite | Level 6

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.

8 REPLIES 8
ets_kps
SAS Employee

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

AbuChowdhury
Fluorite | Level 6

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.

ets_kps
SAS Employee

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.

AbuChowdhury
Fluorite | Level 6

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.

udo_sas
SAS Employee

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

stat_sas
Ammonite | Level 13

Just remove maxiter=0 from syntax .

ets_kps
SAS Employee

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

stat_sas
Ammonite | Level 13

Hi Ken,


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

Thanks,

Naeem

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

Multiple Linear Regression in SAS

Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 8 replies
  • 1944 views
  • 0 likes
  • 4 in conversation