06-12-2014 09:50 AM
Which is the proper way to run a fixed effect regression: proc reg or proc panel?
I have the following variables in my dataset: companyISIN, year, car, mv, ta, roa, ni, dy etc. car will be dependent variable and all other variables (except companyISIN and year) are independent variables.
For OLS regression, I run the following codes:
proc reg data = x;
model car = mv ta roa ni dy;
output out = fittedvals predicted fitted;
Please correct me if there are mistakes here.
But for the fixed effects or random effects model, 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;
I also would like to run the GMM model. How can I do all of these?
06-12-2014 10:24 AM
would you please write the codes? I am not familiar with these procs.
I am including the data file. I also need to do the log of mv variable and roa/100. 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.
06-12-2014 11:48 AM
Both procedures have tons of worked out examples in the documentation. It almost always works out better if you code it yourself, and if it doesn't work, ask for help then. Also, search the archives of the Statistical Procedures forum (for GLM and MIXED). There are hundereds of examples of code there
Examples of PROC PANEL code are available both in the documentation and in the Forcasting and Econometrics forum.
06-14-2014 09:09 AM
Sorry. Currently I am learning Statistical theory ,although I have some statistical background in my university . But I can't offer you more information. Doc Steve is expert about it. Maybe you should ask him more questions.
06-16-2014 08:15 AM
Abu, see my remarks upstream. There are many examples in the documentation for both procedures. What sort of errors occurred in the PROC PANEL run? Please list them.
06-17-2014 06:24 AM
Proc panel works if I delete all blank observations. If there is any blank observation for any variable, then it does not work. Is it the case for proc panel?
06-17-2014 07:24 AM
Not real sure of your meaning "it does not work." According to the documentation: Any observation in the input data set with a missing value for one or more of the regressors is ignored by PROC PANEL, and is not used in the model fit. The same is true of the other fixed effects regression packages in SAS, such as REG or GLM. No matter what you do, in these procedures, those observations will be excluded. This is especially frustrating for time series analysis
What can be done? Imputation, such as PROC MI, then PROC PANEL by imputation number, then PROC MIANALYZE is one way. PROC EXPAND for time series data is a second Random effects regression is another, if the data are at least missing at random.
06-17-2014 08:21 AM
It does not work means it shows the error messages such as:
ERROR: Each observation for time point CompanyISIN=US01988P1084 has a missing value for at least
one variable in MODEL statement .
NOTE: The SAS System stopped processing this step because of errors.
Other procedures such as proc reg or proc glm exclude the missing observations and show the results, but if there is any missing observation and if I submit the proc panel, then it does not run and hence it does not show the results, rather processing has been stopped (the above error message).
But if I delete all missing observations for all variables then proc panel works and shows the results.
06-17-2014 08:53 AM
Ahh. The two-way (company*time) comes up missing and so PANEL will stop. However, if you delete all missing observations, the time series will not be aligned correctly for the time series by company. I would find any values obtained to be suspect. I would strongly encourage the use of PROC EXPAND to impute the missing values in each company's time series as a first step, and then proceed to use PROC PANEL.
06-17-2014 09:17 AM
I will be upfront on this--I have never done it, so have no code to share. Search the Econometrics and Forecasting forum, as well as the Procedures forum. Many other people have posted on how to implement PROC EXPAND--that is how I knew of it.
06-17-2014 10:34 AM
One way is to use PROC EXPAND to interpolate missing values: http://support.sas.com/documentation/cdl/en/etsug/66840/HTML/default/viewer.htm#etsug_expand_getting...
Another way might be to replace the missing values with a fixed values such as a numeric (0), mean, max, min, etc.
PROC TIMESERIES allows you to do that - see setmissing option of ID statement for example: http://support.sas.com/documentation/cdl/en/etsug/66840/HTML/default/viewer.htm#etsug_timeseries_exa...