Let’s say I have time series data for 10 years across 5 industries. I want to be able to control for yearly effects and industry effects. Ideally, I would create 9 dummy variables for 9 of the years (not 10, to avoid dummy variable trap) and 5 industry dummy variables for the 5 industries.

However, that is a lot of dummy variables to manually create and keep track of. So, instead of creating dummy variables, I’m using fixed effects. Looking around, I found two ways to use fixed effects in class proc glm and proc surveyreg:

```
proc glm data = table1;
```

class year industry;

model y = x / solution;

run; quit;

proc surveyreg data = table1;

class year industry;

model y = x / solution;

run; quit;

However, I have two questions / confusions:

1) Do I need to include year and industry in the model statement? If I include the year and industry in the model statement, SAS tells me that The X’X matrix has been found to be singular, essentially one or more of my independent variables are the exact same. If I do not include year and industry in the model statement, it works just fine.

2) Is proc glm or proc surveyreg a better way to use fixed effects? They both seem to give different results.

Thanks!