Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Home
- /
- Analytics
- /
- Forecasting
- /
- Regression

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Posted 06-12-2014 12:23 PM
(1793 views)

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

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Just remove maxiter=0 from syntax .

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Hi Ken,

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

Thanks,

Naeem

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

**If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. **

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.