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
sub group analysis in clinical trial and forest plot in stataKindly help with the command for a forest plot Am analysis RCT data A binary outcome with several b…
Is there any case that the coefficient of variable of interest in DiD more significant when adding more variables?Considering a Difference-in-Differences equation with a dummy variable: yi=α+βDi+Xit+εi. While Xit…
What is the meaning of this Stata code and how to fix errors?Dear all, I come across a replication do-file of a study and some code in the do-file are beyond my…
Air Land TemperatureDear All, I firstly apologize for my post is not strictly related to Stata procedures, but I am mak…
Trouble obtaining quarterly values from a date variableI am starting with a date_of_survey variable that is a string formatted as YYYY-MM-DD. I then run th…
Subscribe to:
Post Comments (Atom)
0 Response to Creating a subsample with missing value restrictions
Post a Comment