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
Meta - Forest plot - How do we get high-res figures in large meta-analyses?Dear statalisters, -meta- with the option forestplot is capable of producing great forest plots, wh…
Ripley's spatial K-function: Generating clusters based on geographical information in firm-level & patent-level panel dataDear Stata users, I have firm-level panel data (merged with patent-level data) with geographical in…
Stata interpreting the same string value as different valuesI have postcodes in my dataset that I want to group together. As you can see when I type tab Postcod…
Two-way scatter plot title and axis titleDear All, I am trying to do a two way scatter plot from my analysis. The code which i am running in…
Need help to add observations for each category.Hi Everyone, I am trying to find the total of the variables in stata but keep getting error message…
Subscribe to:
Post Comments (Atom)
0 Response to How to recode missing values within a range in Stata
Post a Comment