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
x, then adding the industry and year fixed effects is as simple as
xi: regress y x i.industry i.year
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.