Announcement

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

  • #16

    Code:
    esttab using table_1ji.rtf, keep(`e(depvar)') stats(N Chi2c vs1_1_1 ///
    vs2_1_1 vsig_e, labels(Observations "Chi2-LR stat." "Variance level 3" ///
    "Variance level 2" "Variance level 1")) modelwidth(20) noabbrev

    Comment


    • #17
      foreach v in s1_1_1 s2_1_1 sig_e{
      estadd scalar v`v'= (exp(`=e(b)[1, "ln`v':_cons"]'))^2
      } ,
      local Chi2c = cond(e(p_c)<0.01,"`:di %5.3f `=e(chi2_c)''***", ///
      cond(e(p_c)<0.05,"`:di %5.3f `=e(chi2_c)''**", ///
      cond(e(p_c)<0.1,"`:di %5.3f `=e(chi2_c)''*", "`:di %5.3f `=e(chi2_c)'''")))

      esttab using table_1ji.rtf, keep(`e(depvar)' : ) scalars(vs1_1_1 vs2_1_1 vsig_e) stats(N Chi2c, labels(Observations "Chi2-LR stat.")) modelwidth(20) noabbrev

      one part is missing in the output

      Comment


      • #18
        Originally posted by Andrew Musau View Post
        Code:
        esttab using table_1ji.rtf, keep(`e(depvar)') stats(N Chi2c vs1_1_1 ///
        vs2_1_1 vsig_e, labels(Observations "Chi2-LR stat." "Variance level 3" ///
        "Variance level 2" "Variance level 1")) modelwidth(20) noabbrev

        Ok Thanks. Let me run it again

        Comment


        • #19
          I ran the code and now I'm getting a different error: Can kindly help me sort the whole code out for both var and LR test:

          webuse productivity, clear
          mixed gsp private emp hwy water other unemp || region: || state:, reml
          foreach v in s1_1_1 s2_1_1 sig_e{
          estadd scalar v`v'= (exp(`=e(b)[1, "ln`v':_cons"]'))^2
          }
          estadd local Chi2c = cond(e(p_c)<0.01,"`:di %5.3f `=e(chi2_c)''***", ///
          cond(e(p_c)<0.05,"`:di %5.3f `=e(chi2_c)''**", ///
          cond(e(p_c)<0.1,"`:di %5.3f `=e(chi2_c)''*", "`:di %5.3f `=e(chi2_c)'''")))

          esttab using ta.rtf, keep(`e(depvar)') stats(N Chi2c vs1_1_1 ///
          vs2_1_1 vsig_e, labels(Observations "Chi2-LR stat." "Variance level 3" ///
          "Variance level 2" "Variance level 1")) modelwidth(20) noabbrev



          error:

          coefficient gsp not found
          r(111);

          Comment


          • #20
            You need a colon after `e(depvar)' to identify the equation of the outcome. Sorry, I missed that in #16.

            Code:
            esttab using ta.rtf, keep(`e(depvar)':) stats(N Chi2c vs1_1_1 ///
            vs2_1_1 vsig_e, labels(Observations "Chi2-LR stat." "Variance level 3" ///
            "Variance level 2" "Variance level 1")) modelwidth(20) noabbrev

            Comment


            • #21
              is this part ok?

              foreach v in s1_1_1 s2_1_1 sig_e{
              estadd scalar v`v'= (exp(`=e(b)[1, "ln`v':_cons"]'))^2
              }
              estadd local Chi2c = cond(e(p_c)<0.01,"`:di %5.3f `=e(chi2_c)''***", ///
              cond(e(p_c)<0.05,"`:di %5.3f `=e(chi2_c)''**", ///
              cond(e(p_c)<0.1,"`:di %5.3f `=e(chi2_c)''*", "`:di %5.3f `=e(chi2_c)'''")))

              Comment


              • #22
                something is wrong. I'm getting this error:

                estadd local Chi2c = cond(e(p_c)<0.01,"`:di %5.3f `=e(chi2_c)''***", ///
                invalid subcommand: unmatched open parenthesis or bracket

                r(198);

                .
                . cond(e(p_c)<0.05,"`:di %5.3f `=e(chi2_c)''**", ///
                command cond is unrecognized
                r(199);

                .
                . cond(e(p_c)<0.1,"`:di %5.3f `=e(chi2_c)''*", "`:di %5.3f `=e(chi2_c)'''")))
                command cond is unrecognized
                r(199);

                .
                .
                .
                .
                .
                . foreach v in s1_1_1 s2_1_1 sig_e{
                2.
                . estadd scalar v`v'= (exp(`=e(b)[1, "ln`v':_cons"]'))^2
                3.
                . }
                e(vs1_1_1) already defined
                r(110);

                .
                . estadd local Chi2c = cond(e(p_c)<0.01,"`:di %5.3f `=e(chi2_c)''***", ///
                invalid subcommand: unmatched open parenthesis or bracket

                r(198);

                .
                . cond(e(p_c)<0.05,"`:di %5.3f `=e(chi2_c)''**", ///
                command cond is unrecognized
                r(199);

                .
                . cond(e(p_c)<0.1,"`:di %5.3f `=e(chi2_c)''*", "`:di %5.3f `=e(chi2_c)'''")))
                command cond is unrecognized
                r(199);

                Comment


                • #23
                  Andrew,
                  Thanks a lot for the help.
                  The code works:

                  foreach v in s1_1_1 s2_1_1 sig_e{
                  estadd scalar v`v'= (exp(`=e(b)[1, "ln`v':_cons"]'))^2
                  }
                  estadd local Chi2c = cond(e(p_c)<0.01,"`:di %5.3f `=e(chi2_c)''***", ///
                  cond(e(p_c)<0.05,"`:di %5.3f `=e(chi2_c)''**", ///
                  cond(e(p_c)<0.1,"`:di %5.3f `=e(chi2_c)''*", "`:di %5.3f `=e(chi2_c)'''")))

                  esttab using ta.rtf, keep(`e(depvar)' stats(N Chi2c vs1_1_1 ///
                  vs2_1_1 vsig_e, labels(Observations "Chi2-LR stat." "Variance level 3" ///
                  "Variance level 2" "Variance level 1")) modelwidth(20) noabbrev


                  But I need also to add the respective standard errors to the variances.
                  Kindly help with that as well. Like get everything plus the standard errors. I need to report that also to confirm the statistical significance

                  Comment


                  • #24
                    at of ICC, can it also be included?

                    Comment


                    • #25
                      There are a lot of posts showing how to pick up stored estimation results and output using esttab, including previous posts in this thread. Look at #4 of https://www.statalist.org/forums/for...-stage-outcome which explains the procedure in some detail.

                      Comment

                      Working...
                      X