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
Effect size questionI have a question about interpreting effect sizes. Let's say I have one model in which the main ind…
helphello, i'm going to do the two-step estimation using the heckman method and i need the commands used…
Difference in Difference with only three clusters (one untreated, two treated)Hi there! I am currently working on my dissertation studying how a school-based initiative affects …
When export to Excel, how to exclude one variable?I use manual item "Data to Excel Spreadsheet" from File---Export. The codes are: Code: export excel…
keep if(varname) ==r(max)Can someone explain the last two commands: I understand that r(max) or r(min) is to be used after th…
Subscribe to:
Post Comments (Atom)
0 Response to Using r() with recode
Post a Comment