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
How to Perform Functions within groups in a dataset?In my data set, I have a variable called "STATEID" which identifies the state to which the responden…
Esttab: Drop factor variables in regression outputI would like to drop some factor variable coefficients in my regressions, since they are mere contro…
How to generate dataset to test different mixed logit specifications using Monte Carlo experimentDear Statalist, I want to replicate the results of the Monte Carlo experiments reported in Chang an…
Align boxplot and line graphDear Statalisters, I'm trying to combine a line graph with a boxplot in one row. The axes have the …
x-axis scale for metanHi all, I am trying to create a forest plot using metan with a standardized scale of -24, 0, 1, 2, 5…
Subscribe to:
Post Comments (Atom)
0 Response to How to recode missing values within a range in Stata
Post a Comment