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
only keep observations used in lagged regressionHello, I want to perform xtreg, fe on a panel dataset with lagged independent variables (1, 2 and 3…
Exporting tabstat output to latexHi everyone, I'm working with COVID-19 data in order to study the effect of inequality on coronavir…
Instrumental variable Probit regression using the cmp commandHi everyone, I want to investigate the effect that Financial Knowledge (FK, mesaured as the number …
Regression Discontinuity validity issuesI have tried to do a regression discontinuity design on my data for my dissertation. I am trying to …
Problem with meta forestplot nullrefline commandHi! I hope everyone is well! I meta-analyse Hazard ratios from epidemiological studies using the m…
Subscribe to:
Post Comments (Atom)
0 Response to Using r() with recode
Post a Comment