Announcement

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

  • Panel Data: two-side censored Tobit model with non-constant limits

    Hi everyone!

    I'm using a Stata/SE version 15.1

    I'm using a British Household Panel Data, waves 10-18. I'm currently working on a dissertation to investigate whether the workers are able to adjust their working hours towards their stated preference and the role of the employer and job change in facilitating that adjustment.

    The Panel Data is unbalanced as the requirement is for the individuals to be interviewed for at least two consecutive waves.

    I observe two variables which help me to define my dependant variable:
    I observe their preferences towards working hours, hrpref (1– over-employed, 2– under-employed, 3 matched)
    Hours they actually work (towrkhrs)
    hours they prefer to work, (only observed when hrpref==3, lower censored when hrpref==1 and upper censored when hrpref==2), but this also means that the upper and lower limit is different for each individual.

    Work hour mismatches occur when preferred working hours don't match with their current working hours. I only observe the preferred working hours for individuals who are matched.

    The model looks like this.
    Click image for larger version

Name:	Screenshot 2020-04-20 21.34.39.png
Views:	1
Size:	61.3 KB
ID:	1548172



    Here is a sample of my data with some key variables: (empchng - changing employer; jbchng- changing job)


    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input long pid float(year towrkhrs hrpref hrpref_lag empchng jbchng)
    10023526 2002 45 1 . 0 0
    10023526 2003 32 3 1 0 0
    10028005 2002 37 3 . 0 0
    10028005 2003 43 3 3 0 1
    10028005 2004 38 3 3 0 1
    10049363 2003 36 3 . 0 0
    10049363 2004 36 3 3 0 0
    10049363 2005 39 3 3 0 0
    10055266 2000 45 2 . 0 0
    10055266 2001 47 1 2 0 1
    10055266 2002 47 1 1 0 0
    10055266 2003 42 1 1 0 0
    10055266 2005 35 1 . 0 0
    10055266 2006 55 1 1 0 0
    10055266 2007 35 1 1 0 0
    10055266 2008 35 1 1 0 0
    10060111 2003 35 3 . 0 0
    10060111 2004 35 3 3 0 0
    10060111 2005 35 3 3 0 0
    10060111 2006 12 2 3 1 0
    end

    My question is how do I generate my dependant variable 𝐻? the desired hours are censored a not observed over limits.


    What I have done is:

    Code:
    xtset pid year
    gen min=towrkhrs if hrpref==1
    gen max=towrkhrs if hrpref==2
    
    xttobit towrkhrs empchng#ib3.hrpref_lag jbchng#ib3.hrpref_lag unemp ib1.educ i.marstat i.spjb childno
    i.chu5 i.jbft  if sex==1 , ll(min) ul(max)
    end
    Code:
    xtset pid year
    replace hrpref=0 if hrpref==3
    replace hrpref=-1 if hrpref==2
    
    xttobit hrpref empchng#ib3.hrpref_lag jbchng#ib3.hrpref_lag unemp ib1.educ i.marstat i.spjb childno
    i.chu5 i.jbft  if sex==1 
    end
    However, none of these seems to do what I want. (not all control variables are included in the example)

    Thank you for your assistance!


  • #2
    update on the post:

    Code:
    xtset pid year
    replace hrpref=0 if hrpref==3
    replace hrpref=-1 if hrpref==2
    gen hrpref_lag=L1.hrpref+1
    
    xttobit hrpref empchng#ib3.hrpref_lag jbchng#ib3.hrpref_lag unemp ib1.educ i.marstat i.spjb childno
    i.chu5 i.jbft  if sex==1
    end
    My first code coefficients show the change in preferred time, so its not quite it.. (not all control variables are included in the example)

    My second code seems to be the most logical dependent var. For what I want to find.

    Therefore, if I go with the second code: I get an error saying factor variables may not contain negative values if I don't make depvar values positive to use it as an explanatory variable (the lagged depvar is meant to capture the persistence in work hour constraints). Does changing the values of my dependent variable affect its coefficients?

    Thank you in advance!
    Last edited by Nomuundalai Tsogtgerel; 20 Apr 2020, 17:01.

    Comment


    • #3
      The first thing I suspect you're doing wrong is you have a continuous variable in the interaction, but you're not identifying it as continuous. In this case, Stata will assume it is an indicator variable which is why it won't accept negative values for it. You want something like
      c.empchng#ib3.hrpref and the same for jbchgng.

      Anytime you change values of the dependent variable, you're going to influence the coefficients.

      I don't understand what is going on with your dependent variable. Tobit is normally used when a variable is limited but it looks like you've created a dummy variable. It's also not clear to me what adding one to the lagged value does. In general, I would think it simply creates confusion since you got a variable and what you're calling it's black but they are actually different variables.

      Comment


      • #4
        Thank you Phil!

        My dependent variable is derived from continuous variable where it takes a value of -1 when that value is below the lower limit and takes a value of 1 when that value is above the upper limit and a value of 0 when it's between the upper and lower limits. I only observe their actual working hours and their work hour preferences. So my real dependant variable is the difference between the actual working hours and desired working hours (Actual H – Desired H). I only observe their desired working hours when their desired working hours are same as their actual working hours (when hrpref==3); know that their actual working hours at the minimum boundary and their preferred working hours are censored below (when hrpref==1); and their actual working hours at max and their preferred working hours are censored from above (when hrpref==2). The SS of the model above captures it. The upper and lower limit is different for each individual.

        However, with hrpref I know directly in which range does the desired work hours lie, so that why Im using it as a dependant variable which takes three values. (below, matched, above) and I read that I have to make it in a range between (-1 to 1) to let Stata know that its censored from two sides.

        With my Tobit model, I want to estimate the likelihood of the individuals who stay above that limit in the previous period to remain above that limit. or adjust their working hours so it matches their desired hours. that why I'm using a lagged dependent variable to measure it.

        How do I tell Stata that hrpref is actually indicating continues range?

        Thank for your assistance!
        Last edited by Nomuundalai Tsogtgerel; 22 Apr 2020, 16:27.

        Comment


        • #5
          The code I'm currently using is:

          Full code:
          Code:
          xttobit hrpref ib3.hrpref_lag i.empchng#ib3.hrpref_lag i.jbchng#ib3.hrpref_lag i.unempl1 i.inacl1 i.ptl1 ib1.jbterm i.manual lnwage i.mngr i.unionmem i.unionben i.promop ib1.jbsize i.char i.perfomrt i.bonus i.ovtpay i.jbtrain jbten age agesq ib1.marstat childno i.chu5 ib1.educ ib1.spref unemp i.year if (sex==1 & jbft==1), tobit ll(-1) ul(1)
          end
          hrpref_lag is being taken as factor value, so to make it work I had to change its values into positive, but that changes it from being dependant value.

          Short Version:
          Code:
          xttobit hrpref ib3.hrpref_lag i.empchng#ib3.hrpref_lag i.jbchng#ib3.hrpref_lag ib1.spref i.year if (sex==1 & jbft==1), tobit ll(-1) ul(1)
          My aim is to recreate 'Rene Boheim, T. M. (2003). Option or Obligation? The Determinants of Labour Supply Preferences in Britain.' study. But the coefficients I'm getting seems to be low and not that accurate.

          Code:
          Fitting comparison model:
          
          Fitting constant-only model:
          
          Iteration 0:   log likelihood = -13442.313  
          Iteration 1:   log likelihood = -12018.019  
          Iteration 2:   log likelihood = -11939.013  
          Iteration 3:   log likelihood = -11938.945  
          Iteration 4:   log likelihood = -11938.945  
          
          Fitting full model:
          
          Iteration 0:   log likelihood = -12286.768  
          Iteration 1:   log likelihood = -10736.495  
          Iteration 2:   log likelihood = -10674.211  
          Iteration 3:   log likelihood = -10674.053  
          Iteration 4:   log likelihood = -10674.053  
          
          Obtaining starting values for full model:
          
          Iteration 0:   log likelihood = -7188.7541
          Iteration 1:   log likelihood = -7147.2788
          Iteration 2:   log likelihood = -7128.8362
          Iteration 3:   log likelihood = -7128.5489
          Iteration 4:   log likelihood = -7128.5489
          
          Fitting full model:
          
          Iteration 0:   log likelihood = -12039.769  
          Iteration 1:   log likelihood = -10659.829  
          Iteration 2:   log likelihood =  -10608.95  
          Iteration 3:   log likelihood =  -10568.41  
          Iteration 4:   log likelihood = -10568.138  
          Iteration 5:   log likelihood = -10568.138  
          
          Random-effects tobit regression                 Number of obs     =     10,387
                                                             Uncensored     =      6,223
          Limits: lower = -1                                 Left-censored  =        421
                  upper = 1                                  Right-censored =      3,743
          
          Group variable: pid                             Number of groups  =      3,115
          Random effects u_i ~ Gaussian                   Obs per group:
                                                                        min =          1
                                                                        avg =        3.3
                                                                        max =          8
          
          Integration method: mvaghermite                 Integration pts.  =         12
          
                                                          Wald chi2(50)     =     716.47
          Log likelihood  = -10568.138                    Prob > chi2       =     0.0000
          
          ------------------------------------------------------------------------------------
                      hrpref |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
          -------------------+----------------------------------------------------------------
                  hrpref_lag |
                          1  |   .3698372   .0275144    13.44   0.000       .31591    .4237645
                          2  |  -.2377009   .0421901    -5.63   0.000     -.320392   -.1550097
                             |
          empchng#hrpref_lag |
                        1 1  |  -.3045751   .0661911    -4.60   0.000    -.4343072   -.1748429
                        1 2  |   .0223457   .1078855     0.21   0.836     -.189106    .2337975
                        1 3  |     -.0288   .0438964    -0.66   0.512    -.1148353    .0572353
                             |
           jbchng#hrpref_lag |
                        1 1  |   .0410683   .1139157     0.36   0.718    -.1822023    .2643389
                        1 2  |  -.0481882   .1729777    -0.28   0.781    -.3872182    .2908418
                        1 3  |  -.0895245   .0728894    -1.23   0.219    -.2323851    .0533361
                             |
                   1.unempl1 |   -.108032   .0573048    -1.89   0.059    -.2203473    .0042834
                    1.inacl1 |   -.131874   .0864789    -1.52   0.127    -.3013695    .0376214
                      1.ptl1 |   .0693797   .1252771     0.55   0.580    -.1761588    .3149183
                             |
                      jbterm |
                          2  |  -.0942189   .0882499    -1.07   0.286    -.2671855    .0787477
                          3  |  -.0248646    .111287    -0.22   0.823    -.2429832     .193254
                          4  |  -.1108349   .1244942    -0.89   0.373     -.354839    .1331693
                             |
                    1.manual |  -.0477427   .0242336    -1.97   0.049    -.0952397   -.0002458
                      lnwage |   .0748761   .0262157     2.86   0.004     .0234942    .1262579
                      1.mngr |   .0664749   .0210663     3.16   0.002     .0251857    .1077641
                  1.unionmem |  -.0193184   .0286026    -0.68   0.499    -.0753785    .0367417
                  1.unionben |  -.0331603   .0264192    -1.26   0.209     -.084941    .0186203
                    1.promop |  -.0055315   .0188753    -0.29   0.769    -.0425264    .0314634
                             |
                      jbsize |
                          2  |  -.0131847   .0250809    -0.53   0.599    -.0623424     .035973
                          3  |  -.0453073   .0264889    -1.71   0.087    -.0972247      .00661
                          4  |  -.0658139   .0303395    -2.17   0.030    -.1252783   -.0063494
                             |
                      1.char |  -.1927435   .0719637    -2.68   0.007    -.3337896   -.0516973
                  1.perfomrt |   .0444396   .0240548     1.85   0.065    -.0027069    .0915862
                     1.bonus |   .0447158   .0189529     2.36   0.018     .0075688    .0818629
                    1.ovtpay |  -.0573348   .0221244    -2.59   0.010    -.1006979   -.0139717
                   1.jbtrain |  -.0123559   .0201893    -0.61   0.541    -.0519261    .0272144
                       jbten |  -.0014752   .0015477    -0.95   0.341    -.0045086    .0015582
                         age |    .029076   .0068946     4.22   0.000     .0155628    .0425891
                       agesq |  -.0246836   .0081241    -3.04   0.002    -.0406066   -.0087606
                             |
                     marstat |
                          2  |  -.0075135   .0605556    -0.12   0.901    -.1262002    .1111732
                          3  |  -.0801079   .0488314    -1.64   0.101    -.1758158    .0155999
                          4  |  -.0763485   .0428815    -1.78   0.075    -.1603947    .0076976
                             |
                     childno |  -.0266901   .0132611    -2.01   0.044    -.0526813   -.0006989
                      1.chu5 |   .0243096   .0301546     0.81   0.420    -.0347923    .0834114
                             |
                        educ |
                          2  |    .020272   .0310862     0.65   0.514    -.0406559    .0811998
                          3  |   .0183521   .0320787     0.57   0.567     -.044521    .0812252
                          4  |  -.0097963   .0362995    -0.27   0.787    -.0809421    .0613495
                             |
                       spref |
                          2  |  -.0555929   .0301691    -1.84   0.065    -.1147233    .0035376
                          3  |  -.1001912   .0577443    -1.74   0.083     -.213368    .0129855
                          4  |    .079227   .0335876     2.36   0.018     .0133964    .1450575
                             |
                       unemp |   .0047971    .010576     0.45   0.650    -.0159316    .0255257
                             |
                        year |
                       2002  |   -.133985   .0810134    -1.65   0.098    -.2927683    .0247983
                       2003  |  -.1980396   .0777317    -2.55   0.011    -.3503909   -.0456882
                       2004  |  -.1648671   .0780192    -2.11   0.035     -.317782   -.0119522
                       2005  |  -.2248274   .0781541    -2.88   0.004    -.3780067   -.0716481
                       2006  |  -.2449013   .0780324    -3.14   0.002    -.3978421   -.0919606
                       2007  |  -.2352557   .0782603    -3.01   0.003    -.3886431   -.0818683
                       2008  |  -.2553761   .0787176    -3.24   0.001    -.4096598   -.1010924
                             |
                       _cons |   -.260711   .1729206    -1.51   0.132     -.599629    .0782071
          -------------------+----------------------------------------------------------------
                    /sigma_u |    .394541   .0171336    23.03   0.000     .3609597    .4281223
                    /sigma_e |    .670623    .008374    80.08   0.000     .6542102    .6870358
          -------------------+----------------------------------------------------------------
                         rho |   .2571245   .0189424                      .2214349    .2955938
          ------------------------------------------------------------------------------------
          LR test of sigma_u=0: chibar2(01) = 211.83             Prob >= chibar2 = 0.000
          Code:
          end
          Last edited by Nomuundalai Tsogtgerel; 22 Apr 2020, 18:02.

          Comment

          Working...
          X