I asked a similar question earlier. I'm attempting to fill in missing values such that observations 0-458 are e 0, 445-832 are 1, and 832-850 are 0.
The following code allowed me to replace missing values in observations 1-160 with 1, with the rest of the observations set to 0.
replace myvar = cond(_n <= 160, 1, 0) if missing(myvar)
How can I interpret this command for my current purpose?
#This is cross-posted on StackOverflow here:https://stackoverflow.com/questions/...range-in-stata but so far with no luck.
Related Posts with How to recode missing values within a range in Stata
GSEM in STATAHello. I'm a new user of STATA and struggle to get thinks done. I want to build a GSEM model where t…
Esttab problem with interaction fixed effectHello, I am using a survey dataset (the World Values Survey) and trying out the following code in S…
Granger test and var (xtvar, prHi everyone, I am encountering a few problems when I tried to run var codes to be followed by a Gra…
Problem in String Matching using listsI have sample individual addresses data which is pretty unclean. There more than 400000 observations…
How to open a .dat data file in STATA?Hello! I am currently helping out on a research project that previous used SPSS to do statistical a…
Subscribe to:
Post Comments (Atom)
0 Response to How to recode missing values within a range in Stata
Post a Comment