Announcement

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

  • Convergence issue modelling with eteffects

    Dear Statalisters,

    Who has some hands on experience modelling with eteffects?
    I am working with a large data set about personal income data, demographic variables as well as psychometric measures.
    Models using regress or probit run just fine (i.e. my data should not be problematic for eteffects).
    But, I have some concerns about endogeneity investigating a 'treatment effect' in my data and therefore I want to run an eteffects model as explained by Stata (see link).

    But, running eteffects is somewhat problematic as the model does not converge for reasons like: "(not concave)" or "missing values are encountered in analytic gradient" and "gmm estimation failed".

    These problems particularly occur when the dependent variable of the outcome model has its original values (salary data in a ratio scale).
    When I transform the dependent variable to a scale within 0-10 bounds, the eteffects model converges with only 4 iterations.
    Or, when I transform the dependent variable to a logarithmic scale, the eteffects model converges also with only 4 iterations.

    So, I wonder, is the eteffects model (as such) less able to compute with a dependent variable in a ratio scale and more able to deal with data in a logarithmic scale (i.e. does eteffects then converge more easy)? Or might this be a Stata problem (hard for me to accept)?

    I have looked around for any material or examples (beside the Stata help file) but did not find anything yet.
    Therefore, I am looking here for someone who has more experience working with eteffects and possibly understands more about the 'inner workings' of this (promising) methodology.

    Any recommendations are much welcome.

    Best regards,
    Eric
    Explore the new features of our latest release.
    http://publicationslist.org/eric.melse

  • #2
    Dear Eric,

    I would be glad to help you. If you could email [email protected] with your data and do-file so that I could replicate your problem I would look into it and give you advice.

    Comment


    • #3
      Hello everybody,

      I encountered with a similar problem as Eric described it earlier.

      Using -eteffects-, Stata keeps telling me that the function is "not concave" when I apply a linear outcome model, while the estimation fails almost immediately if I use a probit outcome model (error message: "missing values encountered in analytic gradient gmm estimation failed". My outcome variable is binary, but since linear models are generally easier to interpret, I tried to estimate the linear outcome model as well.

      This happens despite the fact that I use a test dataset which is much smaller than the real dataset, and I also included only very few covariates.

      Does anybody have an idea how I can solve this problem?

      My (main) code looks like the following and the dataset can be downloaded here (I don't think is makes much sense to use -dataex- in this case): https://we.tl/7ARbmUk6v4

      Code:
      * Load data
      use "${data}/SIAB_7514_v1_panel.dta", clear
      
      * Install -rangestat-
      ssc install rangestat, replace
      
      * For test puropses: mark 10 % of the sample randomly as treated (otherwise to few treated)
      generate random = runiform()
      gen treat = .
      replace treat = 0
      replace treat = 1 if random<=0.10
      drop random
      
      * Define age restriction
      gen age_restrict = (age<18 | age>55)                                            // Mark observations according to age restriction
      
      * Generate additional outcome variables (used later)
      gen laborforce = 1                     // Labor force participation (is always 1 since we only have data if the participate; zeros are generated in the loop if we do not have a observation of the individual for a specific period)
      label var laborforce "Labor force participation dummy"
      
      * Covariates of treatment model (matching & control function)
      global treatcov        frau age temp5yr
      
      * Covariates of outcome model (control function only)
      global outcov         frau age
      
      foreach year of numlist $startyear/2010 {
      
          foreach     outcome of varlist    reg_empl_full empl_full unempl laborforce temps {        // Select outcome
              
                  forvalues post         = 1/48 {   
                  
                      * Generate outcome variable
                      cap: drop outvar                                                // Write value of outcome value x months after treatment to the observation of the treatment period
                      gen outvar = 0
                      cap: drop low high                                
                      gen low  = time + `post'                                        // Define post-treatment period; note: only one possible observation because "low" and "high" of the range are identical
                      gen high = time + `post'
                      format %tm low high
                      rangestat (mean) `outcome', interval(time low high) by(persnr)
                      replace outvar = `outcome'_mean if !mi(`outcome'_mean)            // Finalize outcome variable (if no value available for x months after treatment, value "0" assumed)
                      drop `outcome'_mean
                      
                      * Coontrol-Function Approach Estimation
                      eteffects                                ///
                          (outvar ${outcov} i.month, linear)   /// Outcome model
                          (treat  ${treatcov} i.month)         /// Treatment model
                          if jahr==`year' & age_restrict==0    /// if condition: only observations of the treatment period & only if age restriction does not apply
                          , vce(robust)                        /// Robust standard errors
                          atet                                    /// Compute ATT (average treatment effect on the treated, ATET); POmean = mean if no one gets treatment; ATT/ATET = effect that the treatment had on those actually treated
                          aequations                           // Show full results
      
                      * Test endogenity (Wald test)
                      estat endogenous                                // Wald test: if H0 is rejected then endogenity is present
      
      }    // End post loop
      }    // End outcome loop
      }   // End treatment period loop

      Best regards,
      Sebastian

      Comment


      • #4
        Dear Sebastian,

        Note that one more line is required before the foreach syntax will run:
        Code:
        global startyear ####
        where #### is, of course, the start year.
        I can confirm the model will not converge on my system as well (running Stata 14.1 MP12 64-bit 19-May-2016), running with the startyear 2000 and 2009, but I cannot advise you how to resolve this problem.

        Regards,
        Eric Melse
        http://publicationslist.org/eric.melse

        Comment


        • #5
          Eric,

          Of course, you are right. I have defined $startyear in my master do-file. I just forgot to include it in my post above. Unfortunately, this was not the cause for the problem which I described.

          Were you able to solve your problem? Or did you get any response from Stata Corp. regarding your problem?

          Thanks!

          Best regards,
          Sebastian

          Comment

          Working...
          X