Hi all,
I have a numeric variable, range is about from 100-400,000. I would like to recode this variable to group it into ranges of 1,000.
For example:
gen newvar = .
replace newvar = 1 if var >=100 & <1000
However, this will take a lot of time. I understand that a macro might help but I have zero experience with macros. I would appreciate any help in this. Thank you.
Related Posts with Stata Recoding Variable Macro
georoute troubleshootingI'm trying to generate travel distances using georoute in Stata but getting different error messages…
Drop all observations featuring a particular value of a variable if any one observation with that value meets a separate criteriaHello all, I've seen the helpful responses here and since I can't quite seem to find the right solu…
How to call the stored results in e()?I am using did_imputation and I read over the help file. I saw a part about the result regarding Sto…
Subtract over a particular pair of monthsI have a problem with my panel data ( which is organised by month and municipality) were I want to t…
Problems with logistic regression resultsI used stata to run logistic regression, but stata gives the following information: " note: DX != 0…
Subscribe to:
Post Comments (Atom)
0 Response to Stata Recoding Variable Macro
Post a Comment