Announcement

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

  • #16

    Code:
    corr r `X' [fw=hhw], c
    is my best guess at the problematic command. Very likely, you have several variables whose names begin with r.

    Code:
    describe r*
    will tell you.

    Comment


    • #17
      Hi there,

      I'm having the same error message but am having trouble using these suggestions to solve my problem. Here's my task: I am looping a list of keywords through the "lookfor" command and appending the return list to an empty local macro.

      I can't figure out how to add in code the way you all do, it actually froze my computer when I tried clicking some of the "source" button- i'm not sure if that was the right one so forgive me. Please keep in mind that this portion of the code is embedded in another loop that loops through 20 different years of data and I'm trying to identify common variables. I'm pretty sure that the last two lines are causing the "varlist not allowed" error r(101). Thanks. Here goes:


      lookfor unique
      return list
      local savevars=r(varlist)

      local keywords "hunger pension food"

      foreach keyword of local keywords{
      print("`keyword'")
      lookfor `keyword'
      quietly return list
      savevars= "`savevars'"+" "+ r(varlist)
      }

      Comment


      • #18
        I've not seen the print command in an age but at best it prints a file. Perhaps your code should end

        Code:
        foreach keyword of local keywords {
            display "`keyword'"
            lookfor `keyword'
            local savevars  `savevars'  `r(varlist)'
        }
        The most obvious error is omitting the command local.

        quietly return list asks for a display and then suppresses it, so does no harm but does nothing useful either.

        Comment


        • #19
          Thanks Nick Cox. This worked. I ended up with:

          lookfor unique
          return list
          local savevars=r(varlist)

          local keywords "hunger pension food"
          foreach keyword of local keywords{
          quietly display "`keyword'"
          quietly lookfor `keyword'
          local savevars `savevars' r(varlist)
          }

          Comment


          • #20
            If that's your final code it needs fixing. Each time around the loop the literal text r(varlist) will get added to the local macro.


            Code:
            local savevars `savevars' `r(varlist)'


            Comment


            • #21
              Hi,

              My goal is to run a loop that is similar to #11 and #12.

              I have the following global list of x variables:

              Code:
               global X "age fem sah hc mob sym"
              I then use the following loop:

              Code:
              set trace on 
              
              . foreach x of global X {
                2. qui {
                3. scal b_`x' = _b[`x']
                4. corr rank `x' [aw=dw_w6], c
                5. sca cov_`x' = r(cov_12)
                6. sum `x' [aw=dw_w6]
                7. sca elas_`x' = (b_`x'*r(mean))
                8. sca CI_`x' = 8*cov_`x'
                9. sca CI_`x' = 2*cov_`x'/r(mean)
               10. sca con_`x' = 4*(elas_`x'*CI_`x')
               11. sca prcnt_`x' = (con_`x'/CI_`x')*100
               12. }
               13. di “`x' elasticity:”, elas_`x'
               14. di “`x' concentration index:”, CI_`x'
               15. di “`x' contribution:”, con_`x'
               16. di “`x' percentage contribution:”, prcnt_`x'
               17. matrix Aaa = nullmat(Aaa)\///
               18. (elas_`x', CI_`x', con_`x', prcnt_`x')
               19. }
              The trace shows me that after line 13, "age is an invalid name". If I use the pre-specified code as shown by #12, I get the error "CI not found", like was the case for #12.
              Steps 1-3 like in #11 work just fine, it is the loop in particular that I cannot seem to get to work.

              Thanks in advance for the help!






              Comment


              • #22
                In the future, please post your example data using dataex as well as the code as seen in your do file, not the Stata terminal.

                Your issue here is that you need to use
                Code:
                `=CI_`x''
                See the reproducible example
                Code:
                sysuse auto, clear
                cls
                foreach x of var wei head {
                qui corr pri `x'
                
                sca pearr_`x' = r(rho)
                
                scatter pri `x', caption(`=pearr_`x'')
                
                di "correlation is `=pearr_`x''"
                }
                Welcome to Statalist, Siebe Dibbets

                Comment


                • #23
                  Originally posted by Jared Greathouse View Post
                  In the future, please post your example data using dataex as well as the code as seen in your do file, not the Stata terminal.

                  Your issue here is that you need to use
                  Code:
                  `=CI_`x''
                  See the reproducible example
                  Code:
                  sysuse auto, clear
                  cls
                  foreach x of var wei head {
                  qui corr pri `x'
                  
                  sca pearr_`x' = r(rho)
                  
                  scatter pri `x', caption(`=pearr_`x'')
                  
                  di "correlation is `=pearr_`x''"
                  }
                  Welcome to Statalist, Siebe Dibbets
                  Thanks for the warm welcome, Jared. Here is an example of the data (y-variable and x-variables used for global):

                  Code:
                  * Example generated by -dataex-. To install: ssc install dataex
                  clear
                  input byte y1skc int age byte(fem sah) float(hc mob sym)
                  0 77 1 1 0 4 1
                  0 77 0 3 1 2 0
                  0 89 0 4 1 2 0
                  0 69 1 4 1 1 0
                  0 89 1 3 3 1 1
                  0 79 1 5 1 5 4
                  0 81 1 2 2 0 1
                  0 82 0 2 1 2 0
                  0 81 0 3 1 0 0
                  0 71 1 2 1 0 0
                  end
                  label values y1skc dummi
                  label def dummi 0 "Not selected", modify
                  label values age age
                  label values fem gender
                  label def gender 0 "male", modify
                  label def gender 1 "female", modify
                  label values sah rate
                  label def rate 1 "Excellent", modify
                  label def rate 2 "Very good", modify
                  label def rate 3 "Good", modify
                  label def rate 4 "Fair", modify
                  label def rate 5 "Poor", modify
                  I was able to incorporate your suggestion (use `=CI_`x'') into the probit model I am trying to estimate.

                  Code:
                  *MEASURING HORIZONTAL EQUITY
                  
                  qui probit y2unskc $X $Z [pw=dw_w6]
                  foreach z of global Z {
                  gen copy_`z’=`z’
                  qui sum `z’ [aw=dw_w6]
                  replace `z’ = r(mean)
                  }
                  predict yhat
                  foreach z of global Z {
                  replace `z’ = copy_`z’
                  drop copy_`z’
                  }
                  sum m_yhat [aw=dw_w6]
                  gen yst = y-yhat + r(mean)
                  
                  *EXPLAINING HORIZONTAL EQUITY
                  
                  dprobit y1skc $X $Z [pw=dw_w6]
                  matrix dfdx=e(dfdx)
                  
                  sca need=0
                  foreach x of global X{
                  qui{
                      mat b_`x' = dfdx[1,"`x'"]
                      sca b_`x' = b_`x'[1,1]
                      corr r `x' [aw=dw_w6], c
                      sca cov_`x' = r(cov_12)
                      sum `x' [aw=dw_w6]
                      sca m_`x' = r(mean)
                      sca elas_`x' = (b_`x'*m_`x')/m_y
                      sca CI_`x' = 2*cov_`x'/m_`x'
                      sca con_`x' = elas_`x'*`=CI_`x''
                      sca prcnt_`x' = con_`x'/`=CI_`x''
                      sca need=need+con_`x'
                  }
                  di "`x' elasticity:", elas_`x'
                  di "`x' concentration index:", CI_`x'
                  di "`x' contribution:", con_`x'
                  di "`x' percentage contribution:", prcnt_`x'
                  }
                  di "Inequality due to need factors:", need

                  In measuring horizontal equity, I got the result for yhat (need-predicted utilization of skilled care) after removal of "m_".

                  Similarly, the loop for explaining horizontal equity won't be run as it says "m_y" cannot be found.

                  It does display the concentration index of the variables if I substitute "m_y" with "y1skc" (my y-variable), but then the elasticity and contribution are displayed as missing. It won't run m_y1skc either.

                  So, it seems that the elasticity is not produced for some reason, which makes that the contribution isn't either, since that is a product of x' concentration index and its elasticity with respect to y. Does it have something to do with this "m_", like suggested by the errors encountered by running the code for measurement of horizontal equity, or is it something else?

                  Any help will be much appreciated!







                  Comment


                  • #24
                    I'll look at this in a few minutes, soon as I've gotten up, gotten dressed, and made coffee

                    Comment


                    • #25
                      I can't replicate any of this. All of the outcomes are false, so my code doesn't even get past the logit regression.
                      Code:
                      * Example generated by -dataex-. To install: ssc install dataex
                      clear
                      qui {
                      input byte y1skc int age byte(fem sah) float(hc mob sym)
                      0 77 1 1 0 4 1
                      0 77 0 3 1 2 0
                      0 89 0 4 1 2 0
                      0 69 1 4 1 1 0
                      0 89 1 3 3 1 1
                      0 79 1 5 1 5 4
                      0 81 1 2 2 0 1
                      0 82 0 2 1 2 0
                      0 81 0 3 1 0 0
                      0 71 1 2 1 0 0
                      end
                      label values y1skc dummi
                      label def dummi 0 "Not selected", modify
                      label values age age
                      label values fem gender
                      label def gender 0 "male", modify
                      label def gender 1 "female", modify
                      label values sah rate
                      label def rate 1 "Excellent", modify
                      label def rate 2 "Very good", modify
                      label def rate 3 "Good", modify
                      label def rate 4 "Fair", modify
                      label def rate 5 "Poor", modify
                      }
                      
                       loc xs age fem sah hc mob sym
                      
                      *MEASURING HORIZONTAL EQUITY
                      
                      qui probit y1 `xs'
                      foreach x of loc xs {
                      gen copy_`x'=`x'
                      qui sum `x'
                      replace `x' = r(mean)
                      }
                      You also don't provide the variables in the global Z. So for us to meaningfully come to a solution, I need a fully reproducible example with data and code. That is, you need to provide a minimal worked example which gets us to the same point and the same error code.

                      Comment


                      • #26
                        Originally posted by Jared Greathouse View Post
                        I can't replicate any of this. All of the outcomes are false, so my code doesn't even get past the logit regression.
                        Code:
                        * Example generated by -dataex-. To install: ssc install dataex
                        clear
                        qui {
                        input byte y1skc int age byte(fem sah) float(hc mob sym)
                        0 77 1 1 0 4 1
                        0 77 0 3 1 2 0
                        0 89 0 4 1 2 0
                        0 69 1 4 1 1 0
                        0 89 1 3 3 1 1
                        0 79 1 5 1 5 4
                        0 81 1 2 2 0 1
                        0 82 0 2 1 2 0
                        0 81 0 3 1 0 0
                        0 71 1 2 1 0 0
                        end
                        label values y1skc dummi
                        label def dummi 0 "Not selected", modify
                        label values age age
                        label values fem gender
                        label def gender 0 "male", modify
                        label def gender 1 "female", modify
                        label values sah rate
                        label def rate 1 "Excellent", modify
                        label def rate 2 "Very good", modify
                        label def rate 3 "Good", modify
                        label def rate 4 "Fair", modify
                        label def rate 5 "Poor", modify
                        }
                        
                        loc xs age fem sah hc mob sym
                        
                        *MEASURING HORIZONTAL EQUITY
                        
                        qui probit y1 `xs'
                        foreach x of loc xs {
                        gen copy_`x'=`x'
                        qui sum `x'
                        replace `x' = r(mean)
                        }
                        You also don't provide the variables in the global Z. So for us to meaningfully come to a solution, I need a fully reproducible example with data and code. That is, you need to provide a minimal worked example which gets us to the same point and the same error code.
                        Thank you for getting back to me, Jared. I see why you weren't able to reproduce my errors. I've been able to solve them by applying a few steps I had overlooked in the guidelines. Nevertheless grateful for the time!

                        Comment


                        • #27
                          Hi,

                          i also have the same error "varlist not allowed" while trying to replicate Table 3 from Dell et al.,2012.

                          HTML Code:
                          clear
                          clear matrix
                          set more off
                          set matsize 800
                          set mem 200m
                          capture log close
                          
                          capture program drop createsamplemain
                          program define createsamplemain
                              * This sample is the sample of all countries
                              * Init GDP is defined based on your first year in the data
                              * Must have at least 20 years of GDP data
                              use climate_panel, clear
                              
                                
                              
                              * restrict to 2003
                              keep if year <= 2003
                              
                              encode parent, g(parent_num)
                              
                              * Generate log GDP
                              gen lgdppwt=ln(rgdpl)
                              g lngdpwdi = ln(gdpLCU)
                              
                              encode fips60_06, g(cc_num)
                              sort country_code year
                              tsset cc_num year
                                  
                              *calculate GDP growth (WDI)
                              gen temp1 = l.lngdpwdi
                              gen g=lngdpwdi-temp1
                              replace g = g * 100
                              drop temp1
                              summarize g
                          
                              *calculate GDP growth (PWT)
                              gen temp1 = l.lgdppwt
                              gen gpwt=lgdppwt-temp1
                              replace gpwt = gpwt * 100
                              drop temp1
                              summarize gpwt
                                  
                              g lnag = ln(gdpWDIGDPAGR)
                              g lnind = ln(gdpWDIGDPIND)
                                  g lninvest = ln(rgdpl*ki/100)
                              
                              foreach X in ag ind gdpwdi invest {
                                  g g`X' = (ln`X' - l.ln`X')*100
                              }
                          
                              
                              
                              
                              * Drop if less than 20 yrs of GDP data
                              g tempnonmis = 1 if g != .
                              replace tempnonmis = 0 if g == .
                              bys fips60_06: egen tempsumnonmis = sum(tempnonmis)
                              drop if tempsumnonmis  < 20
                                  
                              * Make sure all subcomponents are non-missing in a given year
                              g misdum = 0
                              for any ag ind : replace misdum = 1 if gX == .
                              for any ag ind : replace gX = . if misdum == 1
                          
                              * Generate initial income bins
                              preserve
                              keep if lnrgdpl_t0 < .
                              bys fips60_06: keep if _n == 1
                              xtile initgdpbin = ln(lnrgdpl_t0), nq(2)
                              keep fips60_06 initgdpbin
                              tempfile tempxtile
                              save `tempxtile',replace
                              restore
                              
                              mmerge fips60_06 using `tempxtile', type(n:1)
                              tab initgdpbin, g(initxtilegdp)
                              
                              * Generate initial temperature bins
                              preserve
                              keep if wtem50 < .
                              bys fips60_06: keep if _n == 1
                              xtile initwtem50bin = wtem50 , nq(2)
                              keep fips60_06 initwtem50bin
                              save `tempxtile',replace
                              restore
                              
                              mmerge fips60_06 using `tempxtile', type(n:1)
                              tab initwtem50bin, g(initxtilewtem)
                              
                              * Generate initial ag share bins
                              preserve
                              keep if year == 1995
                              sort fips60_06 year
                              by fips60_06: keep if _n == 1
                              g temp = gdpSHAREAG
                              *replace temp = ag_share0 if temp == .
                              xtile initagshare1995 = ln(temp), nq(2)
                              replace initagshare1995 = . if gdpSHAREAG == .
                              keep fips60_06 initagshare1995
                              tempfile tempxtile
                              save `tempxtile',replace
                              restore
                              
                              mmerge fips60_06 using `tempxtile', type(n:1)
                              tab initagshare1995 , g(initxtileagshare)
                              
                              
                              tsset
                              
                              
                              
                              foreach Y in wtem wpre  {
                                  gen `Y'Xlnrgdpl_t0 =`Y'*lnrgdpl_t0
                                  for var initxtile*: gen `Y'_X =`Y'*X
                                      
                                  label var `Y'Xlnrgdpl_t0 "`Y'.*inital GDP pc"
                                  for var initxtile*: label var `Y'_X "`Y'* X"
                              }
                          
                              *generate lags
                              capture {
                                  for var wtem* wpre*: g fdX = X - l.X \ label var fdX "Change in X"
                                  for var wtem* wpre*: g L1X = l1.X
                                  for var wtem* wpre*: g L2X = l2.X
                                  for var wtem* wpre*: g L3X = l3.X
                                  for var wtem* wpre*: g L4X = l4.X
                                  for var wtem* wpre*: g L5X = l5.X
                                  for var wtem* wpre*: g L6X = l6.X
                                  for var wtem* wpre*: g L7X = l7.X
                                  for var wtem* wpre*: g L8X = l8.X
                                  for var wtem* wpre*: g L9X = l9.X
                                  for var wtem* wpre*: g L10X = l10.X
                                  
                              }
                              
                              
                                  tab year, gen (yr)
                              local numyears = r(r) - 1
                              
                              *generate region x year FE
                              if $rfe == 1 {
                                  foreach X of num 1/`numyears' {
                                          foreach Y in MENA SSAF LAC WEOFF EECA SEAS {
                                              quietly gen RY`X'X`Y'=yr`X'*_`Y'
                                              quietly tab RY`X'X`Y'
                                          }
                                          quietly gen RYPX`X'=yr`X'*initxtilegdp1
                                      }
                              }
                              else if $rfe == 2 {
                                  foreach X of num 1/`numyears' {
                                          quietly gen RY`X'=yr`X'
                                          
                                      }
                              }
                          
                              
                              *--Create a region x year variable for clustering
                              
                              g region=""
                              foreach X in _MENA   _SSAF   _LAC    _WEOFF  _EECA   _SEAS {
                                  replace region="`X'" if `X'==1
                              }
                              
                              g regionyear=region+string(year)
                              encode regionyear, g(rynum)    
                          
                          end
                          
                          
                          capture program drop makestars
                          program define makestars, rclass
                              syntax , Pointest(real) PVal(real) [bdec(integer 3)]
                              **** Formats the coefficient with stars
                              ****
                          
                              local fullfloat = `bdec' + 1
                              
                              local outstr = string(`pointest',"%`fullfloat'.`bdec'f")
                              
                              if `pval' <= 0.01 {
                                  local outstr = "`outstr'" + "***"
                              }
                              else if `pval' <= 0.05 {
                                  local outstr = "`outstr'" + "**"
                              }
                              else if `pval' <= 0.1 {
                                  local outstr = "`outstr'" + "*"
                              }    
                                  
                              return local coeff = "`outstr'"
                                  
                          end
                          
                          global rfe = 1 /*1 for region*year, 2 for year only*/
                          global maineffectsonly = 0 /*1 to drop all interactions*/
                          
                          capture program drop maketable3
                          program define maketable3
                              syntax anything(name=filename)
                          
                              ********
                              * 0 lags, 1 lag, 3 lags, 5 lags, 10 lags
                              ********
                              
                              label var wtem_initxtilegdp1 "Temp * Poor"
                              label var wtem_initxtilegdp2 "Temp * Rich"
                              label var wpre_initxtilegdp1 "Precip. * Poor"
                              label var wpre_initxtilegdp2 "Precip * Rich"
                              
                              for num 1/10: label var LXwtem_initxtilegdp1 "LX: Temp * Poor"
                              for num 1/10: label var LXwtem_initxtilegdp2 "LX: Temp * Rich"
                              for num 1/10: label var LXwpre_initxtilegdp1 "LX: Precip. * Poor"
                              for num 1/10: label var LXwpre_initxtilegdp2 "LX: Precip * Rich"
                              
                              * 10 lags
                              cgmreg g wtem_initxtilegdp1 L1wtem_initxtilegdp1 L2wtem_initxtilegdp1 L3wtem_initxtilegdp1 L4wtem_initxtilegdp1 L5wtem_initxtilegdp1 L6wtem_initxtilegdp1 L7wtem_initxtilegdp1 L8wtem_initxtilegdp1 L9wtem_initxtilegdp1 L10wtem_initxtilegdp1 wtem_initxtilegdp2 L1wtem_initxtilegdp2 L2wtem_initxtilegdp2 L3wtem_initxtilegdp2 L4wtem_initxtilegdp2 L5wtem_initxtilegdp2 L6wtem_initxtilegdp2 L7wtem_initxtilegdp2 L8wtem_initxtilegdp2 L9wtem_initxtilegdp2 L10wtem_initxtilegdp2 RY* i.cc_num, cluster(parent_num rynum)
                              lincom wtem_initxtilegdp1 + L1wtem_initxtilegdp1 + L2wtem_initxtilegdp1 + L3wtem_initxtilegdp1 + L4wtem_initxtilegdp1 + L5wtem_initxtilegdp1 + L6wtem_initxtilegdp1 + L7wtem_initxtilegdp1 + L8wtem_initxtilegdp1 + L9wtem_initxtilegdp1 + L10wtem_initxtilegdp1
                              local temeffectpoor_coeff = r(estimate)
                              local temeffectpoor_se= r(se)
                              test wtem_initxtilegdp1 + L1wtem_initxtilegdp1 + L2wtem_initxtilegdp1 + L3wtem_initxtilegdp1 + L4wtem_initxtilegdp1 + L5wtem_initxtilegdp1 + L6wtem_initxtilegdp1 + L7wtem_initxtilegdp1 + L8wtem_initxtilegdp1 + L9wtem_initxtilegdp1 + L10wtem_initxtilegdp1 = 0
                              local temeffectpoor_p = r(p)
                                  
                              lincom wtem_initxtilegdp2 + L1wtem_initxtilegdp2 + L2wtem_initxtilegdp2 + L3wtem_initxtilegdp2 + L4wtem_initxtilegdp2 + L5wtem_initxtilegdp2 + L6wtem_initxtilegdp2 + L7wtem_initxtilegdp2 + L8wtem_initxtilegdp2 + L9wtem_initxtilegdp2 + L10wtem_initxtilegdp2
                              local temeffectrich_coeff = r(estimate)
                              local temeffectrich_se= r(se)
                              test wtem_initxtilegdp2 + L1wtem_initxtilegdp2 + L2wtem_initxtilegdp2 + L3wtem_initxtilegdp2 + L4wtem_initxtilegdp2 + L5wtem_initxtilegdp2 + L6wtem_initxtilegdp2 + L7wtem_initxtilegdp2 + L8wtem_initxtilegdp2 + L9wtem_initxtilegdp2 + L10wtem_initxtilegdp2= 0
                              local temeffectrich_p = r(p)
                                  
                              outreg wtem_initxtilegdp1 L1wtem_initxtilegdp1 L2wtem_initxtilegdp1 L3wtem_initxtilegdp1 L4wtem_initxtilegdp1 L5wtem_initxtilegdp1 L6wtem_initxtilegdp1 L7wtem_initxtilegdp1 L8wtem_initxtilegdp1 L9wtem_initxtilegdp1 L10wtem_initxtilegdp1 wtem_initxtilegdp2 L1wtem_initxtilegdp2 L2wtem_initxtilegdp2 L3wtem_initxtilegdp2 L4wtem_initxtilegdp2 L5wtem_initxtilegdp2 L6wtem_initxtilegdp2 L7wtem_initxtilegdp2 L8wtem_initxtilegdp2 L9wtem_initxtilegdp2 L10wtem_initxtilegdp2 using `filename', 3aster coefastr se  adec(3) adds("sum of all tem effects: poor",`temeffectpoor_coeff',"SE1",`temeffectpoor_se',"p1", `temeffectpoor_p') replace title("main table")
                              outreg wtem_initxtilegdp1 L1wtem_initxtilegdp1 L2wtem_initxtilegdp1 L3wtem_initxtilegdp1 L4wtem_initxtilegdp1 L5wtem_initxtilegdp1 L6wtem_initxtilegdp1 L7wtem_initxtilegdp1 L8wtem_initxtilegdp1 L9wtem_initxtilegdp1 L10wtem_initxtilegdp1 wtem_initxtilegdp2 L1wtem_initxtilegdp2 L2wtem_initxtilegdp2 L3wtem_initxtilegdp2 L4wtem_initxtilegdp2 L5wtem_initxtilegdp2 L6wtem_initxtilegdp2 L7wtem_initxtilegdp2 L8wtem_initxtilegdp2 L9wtem_initxtilegdp2 L10wtem_initxtilegdp2 using `filename'_rich, 3aster coefastr se  adec(3) adds("sum of all tem effects: rich",`temeffectrich_coeff',"SE1",`temeffectrich_se',"p1", `temeffectrich_p') replace title("main table")
                                      
                              
                              * no lags
                              cgmreg g wtem_initxtilegdp1 wtem_initxtilegdp2 RY* i.cc_num, cluster(parent_num rynum)
                              lincom wtem_initxtilegdp1
                              local temeffectpoor_coeff = r(estimate)
                              local temeffectpoor_se= r(se)
                              test wtem_initxtilegdp1 = 0
                              local temeffectpoor_p = r(p)
                              
                              lincom wtem_initxtilegdp2
                              local temeffectrich_coeff = r(estimate)
                              local temeffectrich_se= r(se)
                              test wtem_initxtilegdp2 = 0
                              local temeffectrich_p = r(p)
                                  
                              outreg wtem_initxtilegdp1 wtem_initxtilegdp2 using `filename', 3aster coefastr se  adec(3) adds("sum of all tem effects: poor",`temeffectpoor_coeff',"SE1",`temeffectpoor_se',"p1", `temeffectpoor_p') append
                              outreg wtem_initxtilegdp1 wtem_initxtilegdp2 using `filename'_rich, 3aster coefastr se  adec(3) adds("sum of all tem effects: rich",`temeffectrich_coeff',"SE1",`temeffectrich_se',"p1", `temeffectrich_p') append
                              
                              
                              
                              * 1 lags
                              cgmreg g wtem_initxtilegdp1 L1wtem_initxtilegdp1 wtem_initxtilegdp2 L1wtem_initxtilegdp2 RY* i.cc_num, cluster(parent_num rynum)
                              lincom wtem_initxtilegdp1 + L1wtem_initxtilegdp1
                              local temeffectpoor_coeff = r(estimate)
                              local temeffectpoor_se= r(se)
                              test wtem_initxtilegdp1 + L1wtem_initxtilegdp1 = 0
                              local temeffectpoor_p = r(p)
                              
                              lincom wtem_initxtilegdp2 + L1wtem_initxtilegdp2
                              local temeffectrich_coeff = r(estimate)
                              local temeffectrich_se= r(se)
                              test wtem_initxtilegdp2 + L1wtem_initxtilegdp2 = 0
                              local temeffectrich_p = r(p)
                                  
                              outreg wtem_initxtilegdp1 L1wtem_initxtilegdp1 wtem_initxtilegdp2 L1wtem_initxtilegdp2 using `filename', 3aster coefastr se  adec(3) adds("sum of all tem effects: poor",`temeffectpoor_coeff',"SE1",`temeffectpoor_se',"p1", `temeffectpoor_p') append
                              outreg wtem_initxtilegdp1 L1wtem_initxtilegdp1 wtem_initxtilegdp2 L1wtem_initxtilegdp2 using `filename'_rich, 3aster coefastr se  adec(3) adds("sum of all tem effects: rich",`temeffectrich_coeff',"SE1",`temeffectrich_se',"p1", `temeffectrich_p') append
                              
                              
                              
                              * 3 lags
                              cgmreg g wtem_initxtilegdp1 L1wtem_initxtilegdp1 L2wtem_initxtilegdp1 L3wtem_initxtilegdp1 wtem_initxtilegdp2 L1wtem_initxtilegdp2 L2wtem_initxtilegdp2 L3wtem_initxtilegdp2 RY* i.cc_num, cluster(parent_num rynum)
                              lincom wtem_initxtilegdp1 + L1wtem_initxtilegdp1 + L2wtem_initxtilegdp1 + L3wtem_initxtilegdp1
                              local temeffectpoor_coeff = r(estimate)
                              local temeffectpoor_se= r(se)
                              test wtem_initxtilegdp1 + L1wtem_initxtilegdp1 + L2wtem_initxtilegdp1 + L3wtem_initxtilegdp1 = 0
                              local temeffectpoor_p = r(p)
                              
                              lincom wtem_initxtilegdp2 + L1wtem_initxtilegdp2 + L2wtem_initxtilegdp2 + L3wtem_initxtilegdp2
                              local temeffectrich_coeff = r(estimate)
                              local temeffectrich_se= r(se)
                              test wtem_initxtilegdp2 + L1wtem_initxtilegdp2 + L2wtem_initxtilegdp2 + L3wtem_initxtilegdp2 = 0
                              local temeffectrich_p = r(p)
                              
                              
                              outreg wtem_initxtilegdp1 L1wtem_initxtilegdp1 L2wtem_initxtilegdp1 L3wtem_initxtilegdp1 wtem_initxtilegdp2 L1wtem_initxtilegdp2 L2wtem_initxtilegdp2 L3wtem_initxtilegdp2 using `filename', 3aster coefastr se  adec(3) adds("sum of all tem effects: poor",`temeffectpoor_coeff',"SE1",`temeffectpoor_se',"p1", `temeffectpoor_p') append
                              outreg wtem_initxtilegdp1 L1wtem_initxtilegdp1 L2wtem_initxtilegdp1 L3wtem_initxtilegdp1 wtem_initxtilegdp2 L1wtem_initxtilegdp2 L2wtem_initxtilegdp2 L3wtem_initxtilegdp2 using `filename'_rich, 3aster coefastr se  adec(3) adds("sum of all tem effects: rich",`temeffectrich_coeff',"SE1",`temeffectrich_se',"p1", `temeffectrich_p') append
                              
                              
                              * 5 lags
                              cgmreg g wtem_initxtilegdp1 L1wtem_initxtilegdp1 L2wtem_initxtilegdp1 L3wtem_initxtilegdp1 L4wtem_initxtilegdp1 L5wtem_initxtilegdp1 wtem_initxtilegdp2 L1wtem_initxtilegdp2 L2wtem_initxtilegdp2 L3wtem_initxtilegdp2 L4wtem_initxtilegdp2 L5wtem_initxtilegdp2 RY* i.cc_num, cluster(parent_num rynum)
                              lincom wtem_initxtilegdp1 + L1wtem_initxtilegdp1 + L2wtem_initxtilegdp1 + L3wtem_initxtilegdp1 + L4wtem_initxtilegdp1 + L5wtem_initxtilegdp1
                              local temeffectpoor_coeff = r(estimate)
                              local temeffectpoor_se= r(se)
                              test wtem_initxtilegdp1 + L1wtem_initxtilegdp1 + L2wtem_initxtilegdp1 + L3wtem_initxtilegdp1 + L4wtem_initxtilegdp1 + L5wtem_initxtilegdp1 = 0
                              local temeffectpoor_p = r(p)
                                  
                              lincom wtem_initxtilegdp2 + L1wtem_initxtilegdp2 + L2wtem_initxtilegdp2 + L3wtem_initxtilegdp2 + L4wtem_initxtilegdp2 + L5wtem_initxtilegdp2
                              local temeffectrich_coeff = r(estimate)
                              local temeffectrich_se= r(se)
                              test wtem_initxtilegdp2 + L1wtem_initxtilegdp2 + L2wtem_initxtilegdp2 + L3wtem_initxtilegdp2 + L4wtem_initxtilegdp2 + L5wtem_initxtilegdp2 = 0
                              local temeffectrich_p = r(p)
                                  
                              outreg wtem_initxtilegdp1 L1wtem_initxtilegdp1 L2wtem_initxtilegdp1 L3wtem_initxtilegdp1 L4wtem_initxtilegdp1 L5wtem_initxtilegdp1 wtem_initxtilegdp2 L1wtem_initxtilegdp2 L2wtem_initxtilegdp2 L3wtem_initxtilegdp2 L4wtem_initxtilegdp2 L5wtem_initxtilegdp2 using `filename', 3aster coefastr se  adec(3) adds("sum of all tem effects: poor",`temeffectpoor_coeff',"SE1",`temeffectpoor_se',"p1", `temeffectpoor_p') append
                              outreg wtem_initxtilegdp1 L1wtem_initxtilegdp1 L2wtem_initxtilegdp1 L3wtem_initxtilegdp1 L4wtem_initxtilegdp1 L5wtem_initxtilegdp1 wtem_initxtilegdp2 L1wtem_initxtilegdp2 L2wtem_initxtilegdp2 L3wtem_initxtilegdp2 L4wtem_initxtilegdp2 L5wtem_initxtilegdp2 using `filename'_rich, 3aster coefastr se  adec(3) adds("sum of all tem effects: rich",`temeffectrich_coeff',"SE1",`temeffectrich_se',"p1", `temeffectrich_p') append
                              
                              
                              
                              ****************
                              * Add precip
                              ****************
                              * no lags
                              cgmreg g wtem_initxtilegdp1 wtem_initxtilegdp2    wpre_initxtilegdp1 wpre_initxtilegdp2 RY* i.cc_num, cluster(parent_num rynum)
                              lincom wtem_initxtilegdp1
                              local temeffectpoor_coeff = r(estimate)
                              local temeffectpoor_se= r(se)
                              test wtem_initxtilegdp1 = 0
                              local temeffectpoor_p = r(p)
                              
                              lincom wtem_initxtilegdp2
                              local temeffectrich_coeff = r(estimate)
                              local temeffectrich_se= r(se)
                              test wtem_initxtilegdp2 = 0
                              local temeffectrich_p = r(p)
                                  
                              outreg wtem_initxtilegdp1 wtem_initxtilegdp2 using `filename', 3aster coefastr se  adec(3) adds("sum of all tem effects: poor",`temeffectpoor_coeff',"SE1",`temeffectpoor_se',"p1", `temeffectpoor_p') append
                              outreg wtem_initxtilegdp1 wtem_initxtilegdp2 using `filename'_rich, 3aster coefastr se  adec(3) adds("sum of all tem effects: rich",`temeffectrich_coeff',"SE1",`temeffectrich_se',"p1", `temeffectrich_p') append
                              
                              * 1 lags
                              cgmreg g wtem_initxtilegdp1 L1wtem_initxtilegdp1 wtem_initxtilegdp2 L1wtem_initxtilegdp2           wpre_initxtilegdp1 L1wpre_initxtilegdp1 wpre_initxtilegdp2 L1wpre_initxtilegdp2   RY* i.cc_num, cluster(parent_num rynum)
                              lincom wtem_initxtilegdp1 + L1wtem_initxtilegdp1
                              local temeffectpoor_coeff = r(estimate)
                              local temeffectpoor_se= r(se)
                              test wtem_initxtilegdp1 + L1wtem_initxtilegdp1 = 0
                              local temeffectpoor_p = r(p)
                              
                              lincom wtem_initxtilegdp2 + L1wtem_initxtilegdp2
                              local temeffectrich_coeff = r(estimate)
                              local temeffectrich_se= r(se)
                              test wtem_initxtilegdp2 + L1wtem_initxtilegdp2 = 0
                              local temeffectrich_p = r(p)
                                  
                              outreg wtem_initxtilegdp1 L1wtem_initxtilegdp1 wtem_initxtilegdp2 L1wtem_initxtilegdp2 using `filename', 3aster coefastr se  adec(3) adds("sum of all tem effects: poor",`temeffectpoor_coeff',"SE1",`temeffectpoor_se',"p1", `temeffectpoor_p') append
                              outreg wtem_initxtilegdp1 L1wtem_initxtilegdp1 wtem_initxtilegdp2 L1wtem_initxtilegdp2 using `filename'_rich, 3aster coefastr se  adec(3) adds("sum of all tem effects: rich",`temeffectrich_coeff',"SE1",`temeffectrich_se',"p1", `temeffectrich_p') append
                              
                              * 3 lags
                              cgmreg g wtem_initxtilegdp1 L1wtem_initxtilegdp1 L2wtem_initxtilegdp1 L3wtem_initxtilegdp1 wtem_initxtilegdp2 L1wtem_initxtilegdp2 L2wtem_initxtilegdp2 L3wtem_initxtilegdp2        wpre_initxtilegdp1 L1wpre_initxtilegdp1 L2wpre_initxtilegdp1 L3wpre_initxtilegdp1 wpre_initxtilegdp2 L1wpre_initxtilegdp2 L2wpre_initxtilegdp2 L3wpre_initxtilegdp2       RY* i.cc_num, cluster(parent_num rynum)
                              lincom wtem_initxtilegdp1 + L1wtem_initxtilegdp1 + L2wtem_initxtilegdp1 + L3wtem_initxtilegdp1
                              local temeffectpoor_coeff = r(estimate)
                              local temeffectpoor_se= r(se)
                              test wtem_initxtilegdp1 + L1wtem_initxtilegdp1 + L2wtem_initxtilegdp1 + L3wtem_initxtilegdp1 = 0
                              local temeffectpoor_p = r(p)
                              
                              lincom wtem_initxtilegdp2 + L1wtem_initxtilegdp2 + L2wtem_initxtilegdp2 + L3wtem_initxtilegdp2
                              local temeffectrich_coeff = r(estimate)
                              local temeffectrich_se= r(se)
                              test wtem_initxtilegdp2 + L1wtem_initxtilegdp2 + L2wtem_initxtilegdp2 + L3wtem_initxtilegdp2 = 0
                              local temeffectrich_p = r(p)
                              
                              
                              outreg wtem_initxtilegdp1 L1wtem_initxtilegdp1 L2wtem_initxtilegdp1 L3wtem_initxtilegdp1 wtem_initxtilegdp2 L1wtem_initxtilegdp2 L2wtem_initxtilegdp2 L3wtem_initxtilegdp2 using `filename', 3aster coefastr se  adec(3) adds("sum of all tem effects: poor",`temeffectpoor_coeff',"SE1",`temeffectpoor_se',"p1", `temeffectpoor_p') append
                              outreg wtem_initxtilegdp1 L1wtem_initxtilegdp1 L2wtem_initxtilegdp1 L3wtem_initxtilegdp1 wtem_initxtilegdp2 L1wtem_initxtilegdp2 L2wtem_initxtilegdp2 L3wtem_initxtilegdp2 using `filename'_rich, 3aster coefastr se  adec(3) adds("sum of all tem effects: rich",`temeffectrich_coeff',"SE1",`temeffectrich_se',"p1", `temeffectrich_p') append
                              
                              * 5 lags
                              cgmreg g wtem_initxtilegdp1 L1wtem_initxtilegdp1 L2wtem_initxtilegdp1 L3wtem_initxtilegdp1 L4wtem_initxtilegdp1 L5wtem_initxtilegdp1 wtem_initxtilegdp2 L1wtem_initxtilegdp2 L2wtem_initxtilegdp2 L3wtem_initxtilegdp2 L4wtem_initxtilegdp2 L5wtem_initxtilegdp2           wpre_initxtilegdp1 L1wpre_initxtilegdp1 L2wpre_initxtilegdp1 L3wpre_initxtilegdp1 L4wpre_initxtilegdp1 L5wpre_initxtilegdp1 wpre_initxtilegdp2 L1wpre_initxtilegdp2 L2wpre_initxtilegdp2 L3wpre_initxtilegdp2 L4wpre_initxtilegdp2 L5wpre_initxtilegdp2 RY* i.cc_num, cluster(parent_num rynum)
                              lincom wtem_initxtilegdp1 + L1wtem_initxtilegdp1 + L2wtem_initxtilegdp1 + L3wtem_initxtilegdp1 + L4wtem_initxtilegdp1 + L5wtem_initxtilegdp1
                              local temeffectpoor_coeff = r(estimate)
                              local temeffectpoor_se= r(se)
                              test wtem_initxtilegdp1 + L1wtem_initxtilegdp1 + L2wtem_initxtilegdp1 + L3wtem_initxtilegdp1 + L4wtem_initxtilegdp1 + L5wtem_initxtilegdp1 = 0
                              local temeffectpoor_p = r(p)
                                  
                              lincom wtem_initxtilegdp2 + L1wtem_initxtilegdp2 + L2wtem_initxtilegdp2 + L3wtem_initxtilegdp2 + L4wtem_initxtilegdp2 + L5wtem_initxtilegdp2
                              local temeffectrich_coeff = r(estimate)
                              local temeffectrich_se= r(se)
                              test wtem_initxtilegdp2 + L1wtem_initxtilegdp2 + L2wtem_initxtilegdp2 + L3wtem_initxtilegdp2 + L4wtem_initxtilegdp2 + L5wtem_initxtilegdp2 = 0
                              local temeffectrich_p = r(p)
                                  
                              outreg wtem_initxtilegdp1 L1wtem_initxtilegdp1 L2wtem_initxtilegdp1 L3wtem_initxtilegdp1 L4wtem_initxtilegdp1 L5wtem_initxtilegdp1 wtem_initxtilegdp2 L1wtem_initxtilegdp2 L2wtem_initxtilegdp2 L3wtem_initxtilegdp2 L4wtem_initxtilegdp2 L5wtem_initxtilegdp2 using `filename', 3aster coefastr se  adec(3) adds("sum of all tem effects: poor",`temeffectpoor_coeff',"SE1",`temeffectpoor_se',"p1", `temeffectpoor_p') append
                              outreg wtem_initxtilegdp1 L1wtem_initxtilegdp1 L2wtem_initxtilegdp1 L3wtem_initxtilegdp1 L4wtem_initxtilegdp1 L5wtem_initxtilegdp1 wtem_initxtilegdp2 L1wtem_initxtilegdp2 L2wtem_initxtilegdp2 L3wtem_initxtilegdp2 L4wtem_initxtilegdp2 L5wtem_initxtilegdp2 using `filename'_rich, 3aster coefastr se  adec(3) adds("sum of all tem effects: rich",`temeffectrich_coeff',"SE1",`temeffectrich_se',"p1", `temeffectrich_p') append
                              
                              * 10 lags
                              cgmreg g wtem_initxtilegdp1 L1wtem_initxtilegdp1 L2wtem_initxtilegdp1 L3wtem_initxtilegdp1 L4wtem_initxtilegdp1 L5wtem_initxtilegdp1 L6wtem_initxtilegdp1 L7wtem_initxtilegdp1 L8wtem_initxtilegdp1 L9wtem_initxtilegdp1 L10wtem_initxtilegdp1 wtem_initxtilegdp2 L1wtem_initxtilegdp2 L2wtem_initxtilegdp2 L3wtem_initxtilegdp2 L4wtem_initxtilegdp2 L5wtem_initxtilegdp2 L6wtem_initxtilegdp2 L7wtem_initxtilegdp2 L8wtem_initxtilegdp2 L9wtem_initxtilegdp2 L10wtem_initxtilegdp2 wpre_initxtilegdp1 L1wpre_initxtilegdp1 L2wpre_initxtilegdp1 L3wpre_initxtilegdp1 L4wpre_initxtilegdp1 L5wpre_initxtilegdp1 L6wpre_initxtilegdp1 L7wpre_initxtilegdp1 L8wpre_initxtilegdp1 L9wpre_initxtilegdp1 L10wpre_initxtilegdp1 wpre_initxtilegdp2 L1wpre_initxtilegdp2 L2wpre_initxtilegdp2 L3wpre_initxtilegdp2 L4wpre_initxtilegdp2 L5wpre_initxtilegdp2 L6wpre_initxtilegdp2 L7wpre_initxtilegdp2 L8wpre_initxtilegdp2 L9wpre_initxtilegdp2 L10wpre_initxtilegdp2 RY* i.cc_num, cluster(parent_num rynum)
                              lincom wtem_initxtilegdp1 + L1wtem_initxtilegdp1 + L2wtem_initxtilegdp1 + L3wtem_initxtilegdp1 + L4wtem_initxtilegdp1 + L5wtem_initxtilegdp1 + L6wtem_initxtilegdp1 + L7wtem_initxtilegdp1 + L8wtem_initxtilegdp1 + L9wtem_initxtilegdp1 + L10wtem_initxtilegdp1
                              local temeffectpoor_coeff = r(estimate)
                              local temeffectpoor_se= r(se)
                              test wtem_initxtilegdp1 + L1wtem_initxtilegdp1 + L2wtem_initxtilegdp1 + L3wtem_initxtilegdp1 + L4wtem_initxtilegdp1 + L5wtem_initxtilegdp1 + L6wtem_initxtilegdp1 + L7wtem_initxtilegdp1 + L8wtem_initxtilegdp1 + L9wtem_initxtilegdp1 + L10wtem_initxtilegdp1 = 0
                              local temeffectpoor_p = r(p)
                                  
                              lincom wtem_initxtilegdp2 + L1wtem_initxtilegdp2 + L2wtem_initxtilegdp2 + L3wtem_initxtilegdp2 + L4wtem_initxtilegdp2 + L5wtem_initxtilegdp2 + L6wtem_initxtilegdp2 + L7wtem_initxtilegdp2 + L8wtem_initxtilegdp2 + L9wtem_initxtilegdp2 + L10wtem_initxtilegdp2
                              local temeffectrich_coeff = r(estimate)
                              local temeffectrich_se= r(se)
                              test wtem_initxtilegdp2 + L1wtem_initxtilegdp2 + L2wtem_initxtilegdp2 + L3wtem_initxtilegdp2 + L4wtem_initxtilegdp2 + L5wtem_initxtilegdp2 + L6wtem_initxtilegdp2 + L7wtem_initxtilegdp2 + L8wtem_initxtilegdp2 + L9wtem_initxtilegdp2 + L10wtem_initxtilegdp2 = 0
                              local temeffectrich_p = r(p)
                                  
                              outreg wtem_initxtilegdp1 L1wtem_initxtilegdp1 L2wtem_initxtilegdp1 L3wtem_initxtilegdp1 L4wtem_initxtilegdp1 L5wtem_initxtilegdp1 L6wtem_initxtilegdp1 L7wtem_initxtilegdp1 L8wtem_initxtilegdp1 L9wtem_initxtilegdp1 L10wtem_initxtilegdp1 wtem_initxtilegdp2 L1wtem_initxtilegdp2 L2wtem_initxtilegdp2 L3wtem_initxtilegdp2 L4wtem_initxtilegdp2 L5wtem_initxtilegdp2 L6wtem_initxtilegdp2 L7wtem_initxtilegdp2 L8wtem_initxtilegdp2 L9wtem_initxtilegdp2 L10wtem_initxtilegdp2 using `filename', 3aster coefastr se  adec(3) adds("sum of all tem effects: poor",`temeffectpoor_coeff',"SE1",`temeffectpoor_se',"p1", `temeffectpoor_p') append
                              outreg wtem_initxtilegdp1 L1wtem_initxtilegdp1 L2wtem_initxtilegdp1 L3wtem_initxtilegdp1 L4wtem_initxtilegdp1 L5wtem_initxtilegdp1 L6wtem_initxtilegdp1 L7wtem_initxtilegdp1 L8wtem_initxtilegdp1 L9wtem_initxtilegdp1 L10wtem_initxtilegdp1 wtem_initxtilegdp2 L1wtem_initxtilegdp2 L2wtem_initxtilegdp2 L3wtem_initxtilegdp2 L4wtem_initxtilegdp2 L5wtem_initxtilegdp2 L6wtem_initxtilegdp2 L7wtem_initxtilegdp2 L8wtem_initxtilegdp2 L9wtem_initxtilegdp2 L10wtem_initxtilegdp2 using `filename'_rich, 3aster coefastr se  adec(3) adds("sum of all tem effects: rich",`temeffectrich_coeff',"SE1",`temeffectrich_se',"p1", `temeffectrich_p') append
                                      
                          
                          end
                          
                          createsamplemain
                          maketable3 table3
                          i used the help of trace and it showed me that this is where the problem occurs:

                          HTML Code:
                          - local temeffectrich_p = r(p)
                          - outreg wtem_initxtilegdp1 L1wtem_initxtilegdp1 L2wtem_initxtilegdp1 L3wtem_initxtilegdp
                          > 1 L4wtem_initxtilegdp1 L5wtem_initxtilegdp1 L6wtem_initxtilegdp1 L7wtem_initxtilegdp1 L8w
                          > tem_initxtilegdp1 L9wtem_initxtilegdp1 L10wtem_initxtilegdp1 wtem_initxtilegdp2 L1wtem_in
                          > itxtilegdp2 L2wtem_initxtilegdp2 L3wtem_initxtilegdp2 L4wtem_initxtilegdp2 L5wtem_initxti
                          > legdp2 L6wtem_initxtilegdp2 L7wtem_initxtilegdp2 L8wtem_initxtilegdp2 L9wtem_initxtilegdp
                          > 2 L10wtem_initxtilegdp2 using `filename', 3aster coefastr se adec(3) adds("sum of all tem
                          > effects: poor",`temeffectpoor_coeff',"SE1",`temeffectpoor_s e',"p1", `temeffectpoor_p') r
                          > eplace title("main table")
                          ---------------------------------------------------------------------- begin outreg ---
                          - version 10.1
                          - syntax [using], [Stats(string) se MArginal or IRr hr rrr BDec(numlist >=0 <=15) BFmt(
                          > string) TDec(numlist >=0 <=15 max=1) SDec(string) SFmt(string) Note(string asis) SUMMStat
                          > (string) SUMMDec(numlist >=0 <=15) SUMMTitles(string asis) noAUtosumm noCONS KEep(string)
                          > DRop(string) Eq_merge noSUBstat Level(cilevel) STARLEVels(numlist >0 <100 descending) ST
                          > ARLOC(int 2) MARGStars noSTARs noLEgend SIgsymbols(string asis) ANnotate(string) ASymbol(
                          > string asis) ADDRows(string asis) ADDRTc(int 0) noFIndcons BLankrows MErge MErge1(string)
                          > REplay REplay1(string) CLear CLear1(string asis) *]
                          varlist not allowed
                          Last edited by ben pflugpeil; 12 Dec 2024, 06:03.

                          Comment


                          • #28
                            EDIT The next post may be nearer the mark than this one.

                            You may be confusing outreg and outreg2. Despite the similarity of names, they're quite different commands. Syntax may be similar in some details. but not overall.

                            This is a very old story.

                            John Gallup first wrote outreg well over 20 years ago.

                            Roy Wada wrote outreg2 as an extension of outreg. Long and in some ways sad story short, the aim was to acknowledge that it had grown out of outreg but was different, and to allow John to keep going with his outreg if he wanted to come back to it. (Detail: Roy wanted to keep calling his version outreg and it was me who advised strongly that he really should not do that. He took the advice.)

                            Later John did indeed come back and rewrote outreg completely. He published a paper in the Stata Journal and maintains the program on SSC.

                            Roy has (as far as I know) only ever posted a version of outreg2 on SSC. The version on SSC hasn't been changed since 2014. Some of what it says in its help about outreg is incorrect (and was I think incorrect in 2014).

                            Offlist I tried to persuade the authors to differentiate their commands with names that were more different, but neither wanted to change.


                            Last edited by Nick Cox; 12 Dec 2024, 06:48.

                            Comment


                            • #29
                              I don't know what Dell et al. 2012 is. We've got an explicit request in our FAQ Advice not to use bare name (date) references.

                              More importantly for you, there is some very old code in there.

                              Goodness knows which version of outreg it was written for. That's likely to be your major headache. My guess is that you're trying to run code for an old version with a newer version of the program.

                              The for command was superseded by forvalues and foreach in Stata 7. It's not documented any more. It should still work.

                              mmerge is community-contributed.

                              Comment

                              Working...
                              X