Hi,
I am trying to make a group of scatter plots on the same graph using the method shown here: https://www.statalist.org/forums/for...d-r-2-included
But in my case, there are five sub-plots as the by(Education) has five categories, and it is adding the same r2 value to all the charts.
I tried another Satalist tutorial, but the result remains the same:
Please let me know if there any way to report the inviduals r2 for each of the sub-plots.
Thank you.
I am trying to make a group of scatter plots on the same graph using the method shown here: https://www.statalist.org/forums/for...d-r-2-included
But in my case, there are five sub-plots as the by(Education) has five categories, and it is adding the same r2 value to all the charts.
Code:
by Education: reg bmi wscore local r2: display %5.4f e(r2) twoway (scatter bmi wscore, by(Education, note("") graphregion(color(white)))) (lfit bmi wscore), note(R-squared=`r2')
Code:
corr bmi wscore local corr : di %5.3g r(rho) twoway (scatter bmi wscore, by(v717, note("") graphregion(color(white)))) (lfit bmi wscore), mlabel(code) subtitle("correlation `corr'")
Thank you.
Comment