Stata Panel Data [work] Now
xtreg gdp fdi trade gcf, re
Create correlated variables gen fdi = 2 + 0.5 invnorm(uniform()) + 0.3 (country/10) + 0.02*(year-2000) gen trade = 40 + 8 invnorm(uniform()) + 0.5 (year-2000) gen gcf = 20 + 3 invnorm(uniform()) gen gdp = 7 + 0.15 fdi + 0.01 trade + 0.05 gcf + rnormal(0,0.3) + 0.1*(country/5) stata panel data
Random effects assumes the unobserved panel effects are uncorrelated with your regressors. This is a strong assumption but allows inclusion of time-invariant variables. xtreg gdp fdi trade gcf, re Create correlated