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
How to deal with serial correlation?Hello dears, thank you to statalist community for this support. I need your help please. I am perf…
DfbetaIm using OLS regression. To find dfbetas I cannot use defbeta command after a regression command tha…
Normalising a variable between 0 and 1I am running a regression where my dependent variable is a 0-6 scale Likert item, and I am planning …
How to compute RSS and TSS from xtivregI'm working on a project investigating the impact of childhood malnutrition on scholastic performanc…
Append MergeDear all, I have tried to merge my datasets but appending was the approach that lead me to my resul…
Subscribe to:
Post Comments (Atom)
0 Response to Stata Recoding Variable Macro
Post a Comment