Announcement

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

  • New on SSC: -xtsfkk- module to estimate endogenous panel stochastic frontier models in the style of Karakaplan and Kutlu (2017)

    Special thanks to the Amazing Kit Baum, -xtsfkk- is now available on SSC. You can install -xtsfkk- from SSC by entering the following command in Stata:
    Code:
    ssc install xtsfkk
    xtsfkk fits endogenous panel stochastic production or cost frontier models following the methodology provided by Karakaplan and Kutlu (2017). xtsfkk provides estimators for the parameters of a linear model with a disturbance that is assumed to be a mixture of two components: a measure of inefficiency which is strictly nonnegative and a two-sided error term from a symmetric distribution. xtsfkk can handle endogenous variables in the frontier and/or the inefficiency, and the xtsfkk estimates outperform the standard xtfrontier estimates that ignore endogeneity. See Karakaplan and Kutlu (2017) for a detailed explanation of their methodology and empirical analyses.

    + Karakaplan, Mustafa U. and Kutlu, Levent (2017) "Endogeneity in Panel Stochastic Frontier Models." Applied Economics

    If you use -xtsfkk- for your research, please make sure that you cite this paper in your research:
    Karakaplan, Mustafa U. "Panel Stochastic Frontier Models with Endogeneity." The Stata Journal 22, no. 3 (2022): 643-663.


    -xtsfkk- help file provides several examples and they can be viewed by typing the following command in Stata after installing the -xtsfkk- package:
    Code:
    help xtsfkk
    Below is an example of an -xtsfkk- output:
    Code:
    . use http://www.mukarakaplan.com/files/xtsfkkcost.dta, clear
    
    . xtset id t
           panel variable:  id (unbalanced)
            time variable:  t, 2011 to 2015, but with gaps
                    delta:  1 unit
    
    . xtsfkk y x1 z1, cost u(z2) en(z1 z2) i(iv1 iv2) compare nicely timer header
    
    
    4 Jan 2018 05:51:22
    
    
    ENDOGENOUS PANEL STOCHASTIC COST FRONTIER MODEL (Model EN)
    
    Dependent Variable: y
    
    Frontier Variables: Constant x1 z1
    
    U Variables: Constant z2
    
    W Variable: Constant
    
    Endogenous Variables: z1 z2
    
    Added Instruments: iv1 iv2
    
    Exogenous Variables: iv1 iv2 x1
    
    Panel Variable: id
    
    Time Variable: t
    
    
    initial:       log likelihood = -1103.6189
    rescale:       log likelihood = -1103.6189
    rescale eq:    log likelihood = -1103.6189
    Iteration 0:   log likelihood = -1103.6189  
    Iteration 1:   log likelihood = -1070.1439  (backed up)
    [...]
    Iteration 30:  log likelihood = -782.62356  
    
    
    Analyzing the exogenous comparison model (Model EX)...
    
    initial:       log likelihood =  -588.8592
    rescale:       log likelihood =  -588.8592
    rescale eq:    log likelihood =  -588.8592
    Iteration 0:   log likelihood =  -588.8592  
    [...]
    Iteration 19:  log likelihood = -302.44416  
    
    
    Table: Estimation Results
    ----------------------------------------------------------------
                                  Model EX             Model EN    
    ----------------------------------------------------------------
    Dep.var: y                                                      
    Constant                  0.391**   (0.129)    0.295*    (0.136)
    x1                        0.136*    (0.068)    0.494***  (0.092)
    z1                        0.963***  (0.047)    0.746***  (0.097)
    ----------------------------------------------------------------
    Dep.var: ln(σ²_u)                                              
    Constant                 -0.544*    (0.251)   -0.945***  (0.215)
    z2                        1.190***  (0.068)    1.131***  (0.063)
    ----------------------------------------------------------------
    Dep.var: ln(σ²_v)                                              
    Constant                 -1.503***  (0.097)                    
    ----------------------------------------------------------------
    Dep.var: ln(σ²_w)                                              
    Constant                                      -1.918***  (0.094)
    ----------------------------------------------------------------
    eta1 (z1)                                      0.421***  (0.109)
    eta2 (z2)                                      0.568***  (0.055)
    ----------------------------------------------------------------
    eta Endogeneity Test                          X2=138.68  p=0.000
    ----------------------------------------------------------------
    Observations                    300                   300        
    Log Likelihood                -302.44              -782.62      
    Mean Cost Efficiency           0.3625               0.4838      
    Median Cost Efficiency         0.3341               0.4976      
    ----------------------------------------------------------------
    Notes: Standard errors are in parentheses. Asterisks indicate
    significance at the 0.1% (***), 1% (**) and 5% (*) levels.
    ----------------------------------------------------------------
    
    Completed in 26 seconds.
    Last edited by sladmin; 12 Oct 2022, 08:14. Reason: added reference

  • #2
    I use this command in my research. I'd be glad if you told me how to obtain F-statistics to measure instrument's strength. I do not see these values in the output produced by the command.

    Comment


    • #3
      Dear Dr Karakaplan,

      thank you very much for providing the community with this new methodology.

      I'm using the -xtsfkk-, and I was wondering how this estimator differs from the -sfkk-, that is, whether it allows disentangling time-varying (in)efficiency from unit-specific time-invariant unobserved heterogeneity (the true fixed effect).

      Any suggestion would be of great help,
      Thank in advance.
      Kind regards,

      Federico

      Comment


      • #4
        Originally posted by Lukasz Dabros View Post
        I use this command in my research. I'd be glad if you told me how to obtain F-statistics to measure instrument's strength. I do not see these values in the output produced by the command.
        Hi Lukasz,

        I don't think the -xtsfkk- does that for you.
        You could use -xtivreg2- for running your 2sls and use first to display the f-statistics of the first stage.

        Hope this helps,
        cheers

        Comment


        • #5
          Dear Dr. Karakaplan,

          The link to your example data is broken. Can you please fix it? Many thanks!

          Cheers,
          Anh

          Comment


          • #6
            Originally posted by Quoc Anh Ho View Post
            Dear Dr. Karakaplan,

            The link to your example data is broken. Can you please fix it? Many thanks!

            Cheers,
            Anh
            I fixed the online files, so getting them through Stata or from my website should work now. Thanks for letting me know about the issue.

            Best,
            Mustafa

            Comment


            • #7
              Originally posted by Lukasz Dabros View Post
              I use this command in my research. I'd be glad if you told me how to obtain F-statistics to measure instrument's strength. I do not see these values in the output produced by the command.
              Originally posted by Federico Antonioli View Post
              I don't think the -xtsfkk- does that for you.
              You could use -xtivreg2- for running your 2sls and use first to display the f-statistics of the first stage.
              xtsfkk can actually do what Lukasz asked for. There is not a need to go through another route such as using xtivreg2 or another command. Here is how:
              When you run the xtsfkk command without choosing the "nicely" option, the results would be presented in the raw format. That raw format shows more details about the outcomes including the statistics about the strength of IVs.
              Alternatively, if you use the "nicely" option, after the results are displayed, to see the results in raw format, you can simply type:
              xtsfkk
              This is the replay syntax that shows the last estimation results in detail with more statistics. But if your last estimation is the exogenous comparison model, then the replay syntax would show that. So, to view the endogenous model in detail, you would need to type:
              estimates restore ModelEN
              or simply type:
              est res ModelEN
              Once you get the raw results for your endogenous model, you can type:
              test iv1
              where iv1 is the name of your instrumental variable. If the corresponding chi2 statistic is greater than 10, then as a rule of thumb, your IV is probably not weak.

              Comment


              • #8
                Originally posted by Federico Antonioli View Post
                I'm using the -xtsfkk-, and I was wondering how this estimator differs from the -sfkk-, that is, whether it allows disentangling time-varying (in)efficiency from unit-specific time-invariant unobserved heterogeneity (the true fixed effect).
                Federico, the estimator you need to use would depend on your research question, model and data. Without knowing much about your research, it is hard to say if xtsfkk would provide you the desired outcomes. I would recommend reading the published papers associated with these different methodologies to figure that. Feel free to send me an email at [email protected] with more details.

                Comment


                • #9
                  Dear. Mr. Karakaplan,

                  Thank you so much for providing a new method

                  I try to run the Xtsfkk for the production function using your example syntax, but the result I got was:

                  <istmt>: 3499 moptimize_init_eq_freeparm() not found

                  I still can't figure out why xtsfkk cannot obtain the output. Do you have any recommendations or advice on what I should do about the model, sir?

                  Comment


                  • #10
                    Hello Akbar,
                    Could you please tell me what verion of xtsfkk you are using? Please type:
                    xtsfkk, ver
                    Also, what is your Stata version? Which example gives you the error? It is hard to identify the issue without more details.

                    Comment


                    • #11
                      Hello sir,
                      Thanks for the reply,

                      my xtsfkk version 2.0.0 and Stata version is 14.1

                      about the sample, i also using
                      http://www.mukarakaplan.com/files/xtsfkkcost.dta, clear and trying this command
                      "xtsfkk y x1 z1, cost u(z2) en(z1 z2) i(iv1 iv2) compare nicely timer header"

                      but then get the same result "not found"

                      Comment


                      • #12
                        There is a recent change in my personal website. I have not updated the programs yet. The data should be at the same address but with https:// instead of http:// so you can try this:

                        In Stata, type:
                        https://www.mukarakaplan.com/files/xtsfkkcost.dta, clear

                        Once you make sure that the data is on Stata, then run:
                        xtsfkk y x1 z1, cost u(z2) en(z1 z2) i(iv1 iv2) compare nicely timer header

                        Please let me know it this works.

                        Comment


                        • #13
                          Hello sir, I've been try it and unfortunately, the results of the run data still show not found, which is shown in the following figure

                          Click image for larger version

Name:	Screen Shot 2021-05-25 at 3.30.34 PM.png
Views:	1
Size:	48.3 KB
ID:	1611500

                          Comment


                          • #14
                            Akbar,
                            I just tried running the command on Stata 14.2, and it gave me the same error. However, the command works with Stata 15, 16, and 17. So, I think moptimize_init_eq_freeparm() function is not a visible function in Stata 14. The most up-to-date version of xtsfkk (2.0.0) is built fully on mata commands, which means, you would need a newer version of Stata to be able to run the xtsfkk version 2.0.0. If you can get a newer version of Stata, this problem will be resolved. If you cannot get a newer version of Stata, please send me an email and I will send you an older version of xtsfkk that can work with Stata 14.2.

                            Comment


                            • #15
                              Dear Karakaplan,@Mustafa Ugur Karakaplan
                              I am reading your paper “Endogeneity in panel stochastic frontier models: an application to the Japanese cotton spinning industry”(2017).Can you share me the codes and data of this paper?I have sent you an email.

                              Best regards,
                              Raymond
                              Best regards.

                              Raymond Zhang
                              Stata 17.0,MP

                              Comment

                              Working...
                              X