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?
Table of countries in panel dataDear users, For my thesis, I am looking to export a table from Stata consisting of all the countrie…
Difference-if-Differences omitting variablesDear all, I have a large panel data set and I use diff-in-diff to analyze the effect of a parental …
Replace values for duplicatesHello, I need some. I'm new with STATA so I'm in the learning process. I have a database which is co…
Z-test for a portfolio and a benchmarkHello, I am trying to run a z-test on the mean of a variable of a portfolio (top 10 percent of an i…
Avoid truncation of axis labels in bar graphHi Statalist, I am trying to make a bar chart in Stata with some very long labels on the y-axis. Ho…
Subscribe to:
Post Comments (Atom)
0 Response to How can I replace missing state values on panel data?
Post a Comment