Array
Hi,
I have a 2 year panel data, and I do not have stateside information for 2019. To match the states for both years, I run the following command:
bys id: gen st=state
bys id: replace st=state[_n+1] if year==2019
However, when I run the code, Stata replaces only 2 observations but not all. How can I fix my problem?
Thanks!
Related Posts with How can I replace missing state values on panel data?
Advice regarding Ramsey RESET test resultHello, I'm running an OLS regression with around 2000 observations and a few variables - most of th…
Loading do-file editor and other windows on startupI tend to load the do-file editor right after I start Stata. I often also open the data editor and v…
cap file commandsHi all I have a problem with the following code (I got it by a colleague...): use "${logpath}\cou…
Panel dataset of Matched sample using rangejoinDear Statalisters, I want to see the effect of a law which came into effect on 1975 on the lnpatent…
Date precisionIf I do this: . gen double d=clock("20200101 01:01:01", "YMD hms") . format %tC d . browse then …
Subscribe to:
Post Comments (Atom)
0 Response to How can I replace missing state values on panel data?
Post a Comment