Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to insert R-squared value and the term R2 with square as subscript on top-right of R in stata graphs?

    Hi ,

    I am doing a scatter plot between insured people percentage (X axis) and rate of hospitalization (Y axis). I have used lfit command to get a linear fit of the scatter. I wanted to check if there is a direct method to know the R-squared /goodness of fit value of this linear fit? or should I run a regression and manually enter the value in the graph? Plus, if I do that manually is there a way to write R2 because I could not find an option for raise to the power 2?

    My stata codes are

    graph twoway (scatter perc_insured per_adm , mcolor(red) mlabcolor(red)) (lfit perc_insured per_adm , lpattern(dash) lcolor(black)), legend(off), height(6)) graphregion(color(white)) plotregion( m(b=0) )

  • #2
    See if aaplot from SSC helps.

    https://www.stata.com/statalist/arch.../msg01131.html

    https://www.statalist.org/forums/for...updated-on-ssc

    If that is not quite what you want, look at the code and borrow the ideas that match what you want.

    Comment


    • #3
      Hi,

      Yes aaplot worked. Thank you so much for all the help.

      Comment

      Working...
      X