Dear all
From the entire sample list ,I would like to create a sub-sample based on certain condtions.Say, I have 3 variables,assets,profits&sales.I want to create a subsample by imposing certain conditions on the specified variables and here is what I did.
gen estsample = 1 if assets>=0&profits>100&sales<200000.
It turns out that wherever the values are missing for all of these, estample 1 is created. I want stata to keep it as missing ,if either of these variables are missing.How to do this
Thanks in advance
Related Posts with Creating a subsample with missing value restrictions
Code of Patell Z-statisticGoodmorning everyone, I'd like to derive a Z-statistic by means of the Patell test (https://www.eve…
renaming variables using values they holdHey everyone, Is there a simple command (or few lines of code) to rename variables based on a speci…
Taking the average of observations within a specific date rangeHi, I want to compute the average of a variable (teamsize) for observations within a specific time …
Problems creating Herfindahl-Hirschman IndexHello everyone, I want to create the Herfindahl-Hirschman Index for my data. I have quartlery data …
Variable Labels Hello dear forum members, I am new here and am currently learning Stata. I am a beginner and have o…
Subscribe to:
Post Comments (Atom)
0 Response to Creating a subsample with missing value restrictions
Post a Comment