I am now trying to convert stata to R and I have the following codes in stata:
tsset code_numeric year_numeric
sort code_numeric year_numeric
tab year, gen (yr)
tab code, gen(cd)
reg fhpolrigaug L.(fhpolrigaug lrgdpch) yr* cd* if sample==1, cluster(code)
Does anyone know which syntax should I use in R to get the same result as in stata? To be concrete, I mean the tab year, gen(yr)
, tab code, gen(cd)
and reg fhpolrigaug L.(fhpolrigaug lrgdpch) yr* cd* if sample==1, cluster(code)
parts. The dataset I used is in the link: https://www.openicpsr.org/openicpsr/project/113251/version/V1/view