I am trying to recode a variable using the values from the return list but from the error message I am getting it appears that these values cannot be used with the recode command, which I find hard to believe and therefore wonder whether I am not using the r() correctly here:
#delimit ;
sysuse auto.dta, clear;
sum weight, d;
recode weight (r(min)/r(p25)=1)
(r(p25)/r(p50)=2)
(r(p50)/r(p75)=3)
(r(p75)/r(max)=4),
gen(weight_qrtls);
#delimit cr
Related Posts with Using r() with recode
Exporting LaTeX regression table with 2 group classifications, using esttabI am using the command esttab in Stata to export a regression table. I would like to label my models…
how to calculate returns for specific timeframes?Hi Everyone! I have a dataset of daily closing price of stocks for 2020. I am interested in calcula…
ResultsHi, I am dealing w/ panel data and am running 3 regressions based on a dummy variable that indicate…
GSEM identify latent classesI am trying to learn latent class models. I don't know much about them. I'm trying to figure out how…
Creating one year lagged variable for law ( state by year panel data)Hello stata community, I have a panel set of law effective data for state by year , and I need to c…
Subscribe to:
Post Comments (Atom)
0 Response to Using r() with recode
Post a Comment