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
Sargan Test is too sensitiveHello Dear Stata Forum Users, I have a panel dataset (14,545 observations) and been using Arellano-…
Correlation categorical and continuous variableHi everyone and happy new Year, I would like to show in a plot that a categorical variable (a dummy…
Creating a new continuous variableHi everybody, Could anyone help me out with creating a new continuous variable? My main dataset do…
robust standard error for IV panel regressionHi I have been running panel data random effect 2sls (G2SLS) and i want to robust to heteroskedastic…
Bootstrap for outerweights in PLSSEMHi, I'm trying to get pvalues for the outer weights of the formative part of my measurement model in…
Subscribe to:
Post Comments (Atom)
0 Response to How to recode missing values within a range in Stata
Post a Comment