Hello everyone,
I'm working on my thesis using Stata 16, I've been using it a bit in the past but I'm not too well versed in stata.
I wanted to duplicate some of my observations using the expand command and added a new variable using the ,generate(newvar) at the end of the command. I did this twice for different variables but some of the newly generated observations have an entry in both new variables and I don't understand why. Could someone offer insight?
Here is my code:
expand 2 if ReceiverRegimeTypeII == "1" | ReceiverRegimeTypeII == "2"| ReceiverRegimeTypeII == "3", generate (obs)
(70 observations created)
.
. expand 2 if ReceiverRegimeTypeIII == "1" | ReceiverRegimeTypeIII == "2"| ReceiverRegimeTypeIII == "3", generate (obs1)
(62 observations created)
. tab obs obs1
| obs1
obs | 0 1 | Total
-----------+----------------------+----------
0 | 504 32 | 536
1 | 70 30 | 100
-----------+----------------------+----------
Total | 574 62 | 636
So specifically I'm asking why do 30 observations have both 1s in obs and obs1?
Thanks in advance!!
Related Posts with variables generate with expand are not unique to duplicated observations
2SLS Panel Data Regression with endogenous First-Stage Binary VariableHello everyone, I hope you all are staying safe out there. I am trying to find a way to build a two…
Muli-dimensional Fixed effects (reghdfe) vs Random-effectHi, I am conducting research on data that requires me to perform multi-dimensional fixed-effects. S…
How to separate data from one variable into two, without missing in STATA?I have a dataset with answers form 2004 and 2016 in the same variable, but I want to separate the an…
Want to Know How to Model for Uncertainty of Latent Variables in Country-Level Data Using xtscc and xtabond2Hello, I have a research project involving country-level panel data where I want to model for uncer…
Auditor tenureHello, I would like to calculate the audit tenure. I have read previous treads (e.g. https://www.sta…
Subscribe to:
Post Comments (Atom)
0 Response to variables generate with expand are not unique to duplicated observations
Post a Comment