Announcement

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

  • Coefplot adding, quadratic fit line

    I want to add a quadratic or linear fitting line to my coefplot.

    coefplot Basicsheepskin, vertical drop(father_educ mother_educ _cons) ///
    noci recast(line) xtitle("Completed Years of Schooling") ytitle("Log wage relative to zero Schooling")
    So far the graph looks like this. I hope someone can help me. Best regards.

    Click image for larger version

Name:	sheepskin.png
Views:	1
Size:	89.9 KB
ID:	1407328

  • #2
    see "help twoway lfit" and "help twoway qfit"

    Comment


    • #3
      Thank you for your answer. However, I use a regression with 16 variables and plot their estimates, thus as far as I know, I cannot use the "twoway qfit" command since the graph I want to get is not a "twoway" graph.
      My underlying regressions is as follows:
      reg lnwage first second third fourth fifth sixth seventh eigth nineth tenth eleventh twelveth thirteenth fourteenth fifteenth sixteenth if year == 2008

      Comment


      • #4
        Note exactly your example, but maybe the following is close to what you want:
        Code:
        sysuse nlsw88
        reg wage ibn.grade if grade>=6, nocons
        est sto m1
        reg wage c.grade##c.grade if grade>=6
        margins, at(grade=(6(1)18)) post
        est sto m2
        coefplot (m2, at recast(line) ciopts(recast(rarea) asty(ci))) ///
                 (m1, rename(*.grade = "") at(_coef) recast(line) ciopts(recast(rcap))) ///
                 , xlab(6(1)18) plotlabels("quadratic fit" "nonparametric fit")
        Click image for larger version

Name:	Graph.png
Views:	1
Size:	67.9 KB
ID:	1411015

        ben

        Comment


        • #5
          Hi!
          This is great but it is not really a quadratic fit, is it?
          Is there any way to do exactly the same with an actual quadratic fit line?
          Many thanks!

          Comment

          Working...
          X