use https://www3.nd.edu/~rwilliam/statafiles/wages, clear xtset id t * This will produce better R code than was in the Socius 2017 paper * If desired, first switch to the directory where you want the R file stored xtdpdml wks L.lwage, pre(L.union) inv(ed) errorinv lavaan(Socius, r)