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
Predicting residual in constrained linear regressionI did a constrained linear regression and obtained residuals by predict. Stata 15 reports that it ge…
Grouped Difference of Mean TestDear all, I want to perform a difference of means test on my dataset, to see whether there is a dif…
Pivot to Long data from wide dataHi all I have a quick query, I have a small dataset that I am trying to switch from wide data to lo…
parallel trend assumptionDear Statalists, I have a quick question, please. I have an unbalanced panel dataset over a period f…
Trajectory Analysis in longitudinal dataDear Altruists, Good morning. Any suggestions for performing trajectory analysis for longitudinal ob…
Subscribe to:
Post Comments (Atom)
0 Response to Using r() with recode
Post a Comment