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
Adding to a monthly panel data information on last & next dates from another panelI have information of ids from two sources: (1) a monthly purchase panel, (2) an yearly survey (with…
calculate the number of sharemy data looks like this and I want to calculate how many times did each bank lead in the year for e…
Drawing the IRF for 25 combinations in a loop formHello, I try to estimate and draw a chart of IRF for 25 combinations based on this model : yi,t…
First Differences in VAR ModelsI am currently trying to build a VAR model based off daily stock market returns, exchange rate and t…
How to correct/delete observations to create a Panel Data?Hello, I am working with a panel data comprising of two waves written as Survey 1 and 2. The observ…
Subscribe to:
Post Comments (Atom)
0 Response to Stata Recoding Variable Macro
Post a Comment