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
Logit and Probit TableI want to estimate a regression (shown below on the table) and fill in the data points of the table …
encode and destringHi, this is Alice. I am constantly facing problems of destring a variable that contains both numeric…
Panel DataHi, I am working with panel data and want to create a dummy variable based on the median of each cro…
How to make a table with multiple variables?I want to make a table that looks like: Rate of Graduation (%) Parent’s Years of Education Tal…
RE: Obtaining robust standard errors after xtnbreg with random effectsHello! I am using negative binomial regression with random effects: xtnbreg crime unemployment pove…
Subscribe to:
Post Comments (Atom)
0 Response to Using r() with recode
Post a Comment