I want to run a simple OLS regression with fixed effects. (i.e. y= a b c, with fixed effects on d). I've been using proc mixed, but I am more comfortable with the output from traditional OLS like proc reg, which I don't believe supports fixed effects. The help menu is so complex. Any simple ideas?
Short of creating a dummy variable for every occurance of the fixed effect (over 100), what are my options for running OLS with fixed effects? With PROC MIXED, I use a class statement, but that is not available on PROC REG. I see that PROC VARCOMP has a class statement, but I have not been successful in implementing it. There must be an easy way to do this that I'm missing. Alternativly, is there any way to get an R2 out of PROC MIXED? Thanks.
I call what you are talking about a CLASS (or classification) effect, not a fixed effect.
Your choices are PROC GLM or PROC MIXED. Both use CLASS statements. PROC GLM provides R-squared values, PROC MIXED does not. PROC MIXED uses maximum likelihood estimation, whereas PROC GLM uses least squares estimation (in some cases, least squares and maximum likelihood will give the same answers).
I am a new user for SAS. I have some questions about fixed-effect in SAS program and I found your answers from the Yahoo searching.
Q1: You were saying that "PROC REG certainly does work on fixed effects". If I want to get the INVEST EFFICIENCY(y) and SALE(x1) / ASSET(x2) fixed effect regression for the different companies (COMPANY) and years (YEAR), could you please show me the detail codes?
(like: PROC REG DATA=a1???????;m1 model= y= x1 x2?????)
Q2:if some companies do not have one of variables (x1 or x2), will it be deleted during the calculation.
In general, I don't write code for other people. However, if you try something and you can't figure out why it isn't working, I would be happy to help.
Furthermore, your description of the problem is somewhat vague. I don't know how your data is structured, and its not clear to me what you mean by "... for the different companies (COMPANY) and years (YEAR)".
I would like to run the fixed-effect regression. First of all, I need to calculate the average values of the sale, asset and invest of different years for company AAA. Then do the same thing for companies BBB and CCC. Next, each original value minuses the average value, then the differences are used to run the regression. That is fixed-effect regression, right?
I learn from the SAS manual to write the following codes. But I do not know whether it is correct or not?
PROC GLM data=p1;
MODEL invest= sale asset year/SOLUTION;
Q1: The above codes are correct, aren’t they?
Q2; I want to output the final regression results (including the R-square, F-values etc.) to one file(p2). However, the file (p2) resulted from the above procedure (codes) are the new DATA set. How do get the regression result (including the R-square, F-values etc.) which I want?
Q3. if some companies do not have one of variables (sale or asset), will it be deleted during the calculation,