Tell me more ×
Cross Validated is a question and answer site for statisticians, data analysts, data miners and data visualization experts. It's 100% free, no registration required.

Controlling for variables like, firm size etc, is quite obvious. But I really have no idea on how to control for industry effects and year effects. I've read that you must insert dummy variables, with two digits SIC of GICS codes. But how does one do that in SPSS (or Stata).

Can you please help me with this?

share|improve this question

1 Answer

In STATA, you can use the xi functionality that's built in. Let industry be a variable indicating the industry of each observation and year being the year variable. If you have a simple regression of y on x, then adding the industry and year fixed effects is as simple as

xi: regress y x i.industry i.year

The command xi says that there is some x variable that you want to become a set of dummy or indicator variables based on each different value the variable can have. The i. simple tells STATA which variables you would like to transform.

STATA automatically drops one of the created dummy/indicator variables so that your model does not suffer from exact multiconliearity.

share|improve this answer
1  
In newer versions of Stata, you don't even need the xi prefix. – Dimitriy V. Masterov Mar 9 '12 at 16:19
True, but I find that adding the xi: prefix can still be useful because Stata automatically creates the dummy variables. It might be handy to have them especially for postestimation commands (though it's not necessary at all to have them). – andrea Mar 12 '12 at 9:02

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.