Hello,
I am trying to draw a line graph with the outcome of my regressions.
I am estimating separate 'oaxaca' regressions for each quantile, then trying to save the coefficients for then be able to plot the values of one specific coefficient across the different percentiles.
My code is the following:
forvalues qt=5(5)95{
replace rifatr=rif03_`qt'_r if year2==0
replace rifatr=rif12_`qt'_r if year2==1
svy brr: oaxaca rifatr $correl, by(year23) weight(1) detail
matrix B=e(b)
svmat double B, name(coef)
gen quant=`q'
keep quant coef*
keep if _n==1
}
sort quant
label var quant "Quantile"
graph twoway (connected coef1 quant if quant>0.0 & quant<1.0 ) /*
I get the following error when running the first loop:
"new variables cannot be uniquely named or already defined"
Can anyone help? Thanks.
I am trying to draw a line graph with the outcome of my regressions.
I am estimating separate 'oaxaca' regressions for each quantile, then trying to save the coefficients for then be able to plot the values of one specific coefficient across the different percentiles.
My code is the following:
forvalues qt=5(5)95{
replace rifatr=rif03_`qt'_r if year2==0
replace rifatr=rif12_`qt'_r if year2==1
svy brr: oaxaca rifatr $correl, by(year23) weight(1) detail
matrix B=e(b)
svmat double B, name(coef)
gen quant=`q'
keep quant coef*
keep if _n==1
}
sort quant
label var quant "Quantile"
graph twoway (connected coef1 quant if quant>0.0 & quant<1.0 ) /*
I get the following error when running the first loop:
"new variables cannot be uniquely named or already defined"
Can anyone help? Thanks.
Comment