Stata will output the panel variable, the time variable, and whether the panel is (all entities have data for all time periods) or unbalanced (some entities have missing time periods). 2. Exploring and Visualizing Panel Data
When your model includes a lagged dependent variable as an explanatory variable ( yt−1y sub t minus 1 end-sub predicting
at the panel level, unless you have explicit reasons to use a different covariance estimator. stata panel data
Difference-in-Differences is just FE with a treatment dummy and time dummies, but only if treatment timing is identical. For staggered adoption, Goodman-Bacon (2021) shows TWFE is biased. Stata now has did_imputation (Borusyak et al.) and csdid (Callaway-Sant’Anna).
xtregar y x1 x2, fe
Alternatively, after FE estimation, you can use the xtregar command, which estimates an FE or RE model with an AR(1) disturbance:
Estimate random effects and store results xtreg y x1 x2, re estimates store re Stata will output the panel variable, the time
) means the RE assumptions are violated. You must use . 5. Diagnostic Checking
When you run xtreg, fe , Stata automatically displays an F-test at the bottom of the output window: F test that all u_i=0 . Difference-in-Differences is just FE with a treatment dummy
: xtabond2 in Stata (user-written, by Roodman) is more flexible than official xtabond . Yet many journals still accept the older command.