Dummies: In STATA, suppose you want to create a level/slope dummy with a reference category for
different continents you can easily use the code: xi i.continent (where continent contains the
different continens) to create a level dummy and we can use the code: xi i.continent*variable to
create a slope dummy for the continent with another variable.
Week 2: Panel data
Long vs wide format: In STATA the long format for panel data is when the time observations go from
top to bottom and the variable observations from left to right, while the wide format has all variables
with their time observation from left to right. For convenience purposes we need to reshape the data
from wide to long format.
With the code bysort you can sort on time or entity to perform transformations in the data, such that
you can calculate the mean of a variable per observation, or per time period.
Fixed effects: When you do a regression in state with panel data you first need to show stata you
have panel data with xtset and the corresponding identity indicator and time indicator. Additionally,
if you do a panel data regression with fixed firm effects, if there are variables included in the
regression which do not variate per entity (think of, for example a dummy variable), they will
automatically drop out due to collinearity issues. The STATA output of a fixed effects regression is
shown below, it is such that you cannot interpret the R-squared of the between and overall part, only
that of the within R-squared. Additionally, at the bottom there is output of an F-test, this F-test tests
if the dummies utilized for the fixed effects are actually significant, such that we know if we need the
fixed effects model or could have just done a pooled regression. The sigma u at the bottom give the
standard deviation of the fixed effects. The sigma e gives the standard deviation of the root mean
squared error. The rho gives the fraction of the variance which is due to the fixed effects (this thus
shows how much variation actually comes from within each entity).