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
DID difference in difference for count data using nbreg (negativ binomial)Dear statalists, I have a data set of treated (employees purchasing stocks through a firm´s stock o…
coefplot - creating a vertical coefficient plot with multiple lines across the entire x-axisDear Stata users, I'm having a problem creating a coefficient plot with Stata that produces vertica…
Diff-in-DiffI am trying to do a diff-in-diff analysis on the effect of endorsement on a product. This is what my…
Predict commandHi, I estimated the probability of default of loans using borrower characteristics. First, I run a …
Rolling percentiles for large datasetHi, I have a large dataset containing more than 30m observations. The dataset aggregates daily trad…
Subscribe to:
Post Comments (Atom)
0 Response to Stata Recoding Variable Macro
Post a Comment