Announcement

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

  • #16
    Paolo:
    the two codes are different:
    Code:
    . use https://www.stata-press.com/data/r17/union. . use https://www.stata-press.com/data/r17/union
    (NLS Women 14-24 in 1968)
    
    . xtlogit union age grade not_smsa i.south##c.year, fe vce(bootstrap, reps(200) seed(12345) dots(1))
    (running xtlogit on estimation sample)
    
    Bootstrap replications (200)
    ----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5 
    ..................................................    50
    ..................................................   100
    ..................................................   150
    ..................................................   200
    
    Conditional fixed-effects logistic regression        Number of obs    = 12,035
                                                         Replications     =    200
    Group variable: idcode                               Number of groups =  1,690
    
                                                         Obs per group:
                                                                      min =      2
                                                                      avg =    7.1
                                                                      max =     12
    
                                                         Wald chi2(6)     =  38.72
    Log likelihood = -4510.888                           Prob > chi2      = 0.0000
    
                                  (Replications based on 1,690 clusters in idcode)
    ------------------------------------------------------------------------------
                 |   Observed   Bootstrap                         Normal-based
           union | coefficient  std. err.      z    P>|z|     [95% conf. interval]
    -------------+----------------------------------------------------------------
             age |   .0710973   .0945357     0.75   0.452    -.1141894    .2563839
           grade |   .0816111     .05568     1.47   0.143    -.0275198    .1907419
        not_smsa |   .0224809   .1536343     0.15   0.884    -.2786368    .3235986
         1.south |  -2.856488    .879619    -3.25   0.001    -4.580509   -1.132466
            year |  -.0636853   .0952784    -0.67   0.504    -.2504275    .1230568
                 |
    south#c.year |
              1  |   .0264136   .0109133     2.42   0.016     .0050239    .0478032
    ------------------------------------------------------------------------------
    
    . bootstrap, reps(200) seed(12345): xtlogit union age grade not_smsa i.south##c.year, fe
    (running xtlogit on estimation sample)
    
    Bootstrap replications (200)
    ----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5 
    ..................................................    50
    ..................................................   100
    ..................................................   150
    ..................................................   200
    
    Conditional fixed-effects logistic regression        Number of obs    = 12,035
                                                         Replications     =    200
    Group variable: idcode                               Number of groups =  1,690
    
                                                         Obs per group:
                                                                      min =      2
                                                                      avg =    7.1
                                                                      max =     12
    
                                                         Wald chi2(6)     =  44.14
    Log likelihood = -4510.888                           Prob > chi2      = 0.0000
    
                                      (Replications based on clustering on idcode)
    ------------------------------------------------------------------------------
                 |   Observed   Bootstrap                         Normal-based
           union | coefficient  std. err.      z    P>|z|     [95% conf. interval]
    -------------+----------------------------------------------------------------
             age |   .0710973   .1149636     0.62   0.536    -.1542272    .2964217
           grade |   .0816111    .057185     1.43   0.154    -.0304694    .1936915
        not_smsa |   .0224809   .1352539     0.17   0.868    -.2426119    .2875738
         1.south |  -2.856488   .8285044    -3.45   0.001    -4.480326   -1.232649
            year |  -.0636853   .1161776    -0.55   0.584    -.2913893    .1640186
                 |
    south#c.year |
              1  |   .0264136   .0101533     2.60   0.009     .0065135    .0463136
    ------------------------------------------------------------------------------
    
    .
    That sais, I do not get why Stata complains about your first code.
    Last edited by Carlo Lazzaro; 21 Feb 2023, 08:32.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #17
      Originally posted by Carlo Lazzaro View Post
      Paolo:
      the two codes are different:
      Code:
      . use https://www.stata-press.com/data/r17/union. . use https://www.stata-press.com/data/r17/union
      (NLS Women 14-24 in 1968)
      
      . xtlogit union age grade not_smsa i.south##c.year, fe vce(bootstrap, reps(200) seed(12345) dots(1))
      (running xtlogit on estimation sample)
      
      Bootstrap replications (200)
      ----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5
      .................................................. 50
      .................................................. 100
      .................................................. 150
      .................................................. 200
      
      Conditional fixed-effects logistic regression Number of obs = 12,035
      Replications = 200
      Group variable: idcode Number of groups = 1,690
      
      Obs per group:
      min = 2
      avg = 7.1
      max = 12
      
      Wald chi2(6) = 38.72
      Log likelihood = -4510.888 Prob > chi2 = 0.0000
      
      (Replications based on 1,690 clusters in idcode)
      ------------------------------------------------------------------------------
      | Observed Bootstrap Normal-based
      union | coefficient std. err. z P>|z| [95% conf. interval]
      -------------+----------------------------------------------------------------
      age | .0710973 .0945357 0.75 0.452 -.1141894 .2563839
      grade | .0816111 .05568 1.47 0.143 -.0275198 .1907419
      not_smsa | .0224809 .1536343 0.15 0.884 -.2786368 .3235986
      1.south | -2.856488 .879619 -3.25 0.001 -4.580509 -1.132466
      year | -.0636853 .0952784 -0.67 0.504 -.2504275 .1230568
      |
      south#c.year |
      1 | .0264136 .0109133 2.42 0.016 .0050239 .0478032
      ------------------------------------------------------------------------------
      
      . bootstrap, reps(200) seed(12345): xtlogit union age grade not_smsa i.south##c.year, fe
      (running xtlogit on estimation sample)
      
      Bootstrap replications (200)
      ----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5
      .................................................. 50
      .................................................. 100
      .................................................. 150
      .................................................. 200
      
      Conditional fixed-effects logistic regression Number of obs = 12,035
      Replications = 200
      Group variable: idcode Number of groups = 1,690
      
      Obs per group:
      min = 2
      avg = 7.1
      max = 12
      
      Wald chi2(6) = 44.14
      Log likelihood = -4510.888 Prob > chi2 = 0.0000
      
      (Replications based on clustering on idcode)
      ------------------------------------------------------------------------------
      | Observed Bootstrap Normal-based
      union | coefficient std. err. z P>|z| [95% conf. interval]
      -------------+----------------------------------------------------------------
      age | .0710973 .1149636 0.62 0.536 -.1542272 .2964217
      grade | .0816111 .057185 1.43 0.154 -.0304694 .1936915
      not_smsa | .0224809 .1352539 0.17 0.868 -.2426119 .2875738
      1.south | -2.856488 .8285044 -3.45 0.001 -4.480326 -1.232649
      year | -.0636853 .1161776 -0.55 0.584 -.2913893 .1640186
      |
      south#c.year |
      1 | .0264136 .0101533 2.60 0.009 .0065135 .0463136
      ------------------------------------------------------------------------------
      
      .
      That sais, I do not get why Stata complains about your first code.
      Thanks for the clarification that the two models are different. Yes, I am puzzled as well as to why the STATA is struggling with the first code but not the second.

      Comment


      • #18
        Paolo:
        the usual trivial question: is your copy of Stata fully updated?
        Kind regards,
        Carlo
        (Stata 19.0)

        Comment


        • #19
          Originally posted by Carlo Lazzaro View Post
          Paolo:
          the usual trivial question: is your copy of Stata fully updated?
          Good point and indeed, I have checked as follows and it seems up to date:
          Code:
          update query
          (contacting http://www.stata.com)
          
          Update status
              Last check for updates:  21 Feb 2023
              New update available:    none         (as of 21 Feb 2023)
              Current update level:    10 Jan 2023  (what's new)
          
          Possible actions
          
              Do nothing; all files are up to date.

          Comment


          • #20
            Paolo:
            are you copying and pasting the instructions for your first code from a .do file or are you coding them directly in the Stata Command window?
            Kind regards,
            Carlo
            (Stata 19.0)

            Comment


            • #21
              Originally posted by Carlo Lazzaro View Post
              Paolo:
              are you copying and pasting the instructions for your first code from a .do file or are you coding them directly in the Stata Command window?
              Thanks Carlo for the follow up!
              I always code in a do.file, is it generally recommended to code in the Stata command window?

              Comment


              • #22
                Paolo:
                do you let the .do file run the whole code or you just copy each chunck of code form the .do file and then past it in the Stata command window?
                Kind regards,
                Carlo
                (Stata 19.0)

                Comment


                • #23
                  Originally posted by Carlo Lazzaro View Post
                  Paolo:
                  do you let the .do file run the whole code or you just copy each chunck of code form the .do file and then past it in the Stata command window?
                  I both write & run the entire code in the do.file, I never paste it on the Stata command window. However, I have just tried the Stata command window and I receive the same error message,
                  Code:
                  an error occurred when bootstrap executed xtlogit

                  Comment


                  • #24
                    Paolo:
                    I'd bring this issue up to https://www.stata.com/support/tech-support/contact.
                    Kind regards,
                    Carlo
                    (Stata 19.0)

                    Comment


                    • #25
                      Thanks Carlo Lazzaro for the support!
                      Indeed, I have also checked several times that my Stata is up to date and all looks good.

                      Comment


                      • #26
                        Originally posted by Carlo Lazzaro View Post
                        Paolo:
                        I'd bring this issue up to https://www.stata.com/support/tech-support/contact.
                        Hello Professor Carlo Lazzaro, I am still facing this technical error unfortunately despite running the same code with Stata 17 on different devices, do you happen to have any updates from the tech support team?

                        Comment


                        • #27
                          Paolo;
                          no news, unfortunately.
                          The usual request to call me Carlo still applies 😀!
                          Kind regards,
                          Carlo
                          (Stata 19.0)

                          Comment


                          • #28
                            The two specifications
                            Code:
                            use https://www.stata-press.com/data/r17/union
                            
                            xtlogit union age grade not_smsa i.south##c.year, fe      ///
                              vce(bootstrap, reps(200) seed(12345) dots(1))
                              
                            bootstrap, reps(200) seed(12345):                         ///
                              xtlogit union age grade not_smsa i.south##c.year, fe
                            yield different standard errors because they apply different bootstraps. xtlogit with vce(bootstrap) correctly resamples the panel units, that is, performs a clustered bootstrap, whereas the bootstrap prefix specification resamples individual observations. The following bootstrap specification yields the same results as xtlogit, vce(bootstrap):
                            Code:
                            bootstrap, reps(200) seed(12345)                         ///
                              cluster(idcode) idcluster(newid) group(idcode):        ///
                              xtlogit union age grade not_smsa i.south##c.year, fe
                            Please see help bootstrap for further information.

                            Comment

                            Working...
                            X