Announcement

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

  • problem to get R-squared fro "xtscc" and outreg2 --please advice me

    hello and good day,

    I try to extract the table of my estimation from xtscc estimation but "R-squared" did not report.
    I am so thankful to receive your advice.

    this is my code"

    foreach v in "ltotalfertility" {
    cd "E:\paper-thesis\MyProject - Copy/`v'"
    use "E:\paper_thesis_dofile-dta\240302022-final_dofile_totla\final_27032022.dta"
    xi: xtscc d0`v' l(0/2).d_pp2 l(1/1).d0`v' i.year,fe

    outreg2 using `v'.xls, replace label keep(l(0/2).d_pp2 l(1/1).d0`v' e(r2_w))

    foreach vart in "1" "2" "3" "4" "5" {

    xi: xtscc d`vart'`v' l(0/2).d_pp2 l(1/1).d0`v' i.year,fe

    outreg2 using `v'.xls, append label keep(l(0/2).d_pp2 l(1/1).d0`v' e(r2_w))
    }
    }
    e ambiguous abbreviation
    r(111);

    end of do-file




    many thanks in advance for your valuable time and advice.

    regards,

  • #2
    Perhaps moving e(r2_w) outside the keep() list, which should only contain variables, not summary statistics.
    Code:
    outreg2 using `v'.xls, replace label keep(l(0/2).d_pp2 l(1/1).d0`v') e(r2_w)
    or
    Code:
    outreg2 using `v'.xls, replace label drop(year) e(r2_w)

    Comment


    • #3
      @ William Lisowski many thanks.
      outreg2 using `v'.xls, replace label keep(l(0/2).d_pp2 l(1/1).d0`v') e(r2_w)
      it works. Many thanks. regards,

      Comment

      Working...
      X