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.
Array
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!