*! version 1.0 Fernando Rios-Avila April 2020
help ghsurv

Title

ghsurv -- Module for the estimation of survival model using repeated crosssection data

Syntax

Module for the model estimation.

ghsurv
indepvars [if] [in] [weight] [, gap(varname) alpha(varlist) cluster(varname)]

indepvar Declares all independent variables in the model. It should include the created variable _dur
or some transformation of it. This is created using ghsurv_set.

gap(varname) Indicates the variable to identify the gap between measured spells. Default uses gap=1. Use this only
if setting data with different gaps between data collection and spell measuring.

alpha(varlist) Declares variables that explain the unconditional cohort to cohort probability of transition.
Default assumes alpha is a constant. It typically contains _dur or transformation of such variable.

cluster(varname) Indicates the use of cluster standard errors using varname as clusters. The default is to use _id
as cluster. THis variable is created when using ghsurv_set

weight The command allows for all type of weights, however, standard errors obtained using clustered standard errors.

Module for setting up the data for the estimation.

ghsurv_set , dur(varname) time(varname) [nowarning]

dur(varname) Indicates the number of periods observation "i" has "survived" until the moment the information
is been collected (in the survey).

time(varname) Indicates the time period when the data has been collected.

nowarning Because this command modifies the data, the default will ask you to confirm before proceeding. This option bypasses this warning.

After the data has been set up, four variables are created: _id Observation ID; _dur Spell duration; _t Time variable;
_y01 base sample (=0) and continuation sample (=1) indicator.

Postestimaton

After the estimation, one can calculate either the probability of exit (for example exit unemployment) using the option p_exit
or probability of continuation p_cont. This can be used in combination with margins and predict.

Description

ghsurv is a command that implements the estimator proposed by Guell and Hu (2006) and described in detail in Mundra and Rios-Avila (2020)
for the estimation of duration type of models based on uncompleted spells using repeated cross-section data.

Consider the example proposed by Guell and Hu (2006) that focuses on analyzing determinants of unemployment duration.
when panel data is unavailable, it is not possible to use conventional models to estimate duration models.

Instead, Guell and Hu(2006) proposes to identify the determinants of continued
unemployment comparing the distribution of those who are unemployed across
two (or more) periods, using a pseudo panel model "linking" individuals based on
actual and potential number of periods of unemployment a person experiences in two
points in time.

For example, to analyze the probability of between two periods, one can analyze the distribution
of characteristics of everyone who was unemployed for S periods at time T and compare it to those
unemployed for S+1 periods at time T+1. Guell and Hu(2006) and Mundra and Rios-Avila (2020) call this
the base and continuation Samples.

If there are fewer individuals with characteristics X at time T+1 with unemployment length S+1, in relative terms,
then that characteristic is associated to an increase in the probability of exiting unemployment.

For the implementation of the command, one must take particular care identifying the base and continuation sample,
and the linking "duration" variable. There should always be a 1-1 linking between base con continuation samples.

Consider a case with 3 periods:

Observations in period 1 can be part of the base sample, but not the continuation sample.

Observations in period 2 can be part of the continuation sample for observations on period 1, or base sample for observations in period 3.

Observations in period 3 can be part of the continuation sample, but not the base sample.

If the periods between crossection data are measured in the same units as periods of unemployment, say data collected monthly with unemployment duration
measured in months, then ghsurv_set can be used to setup and prepare the data. This process modifies the data, and cannot be reversed.

ghsurb can be used to estimate models with different "gaps" in collected time and measured unemployment spell, but is the user responsability
to ensure the 1-1 relationship between all potential base and continuation samples.

The model reports clustered standard errors using individual identifiers (_id) as clusters. This can be superseeded using other relevant variables.

See Guell and Hu(2006) for the original article, and Mundra and Rios-Avila (2020) for a detailed revision of the methodology, simulation evidence
and empirical example analyzing unemployment duration among immigrants.

Examples

Setup

. ssc install estout, replace

. use http://cameron.econ.ucdavis.edu/mmabook/ema1996.dta, clear

. global xvars logwage tenure slack explose houshead married female ychild nonwhite age schgt12

I first restructure the data

. gen id=_n

. expand 2 if censor1==0

. bysort id:gen time=_n

. replace spell=spell+1 if time==2

. gen logspell=log(spell)

. gen exit=1 if censor1==1 & time==1

. replace exit=0 if exit==.

. bysort id (time):gen spell0=spell[1]-1

I will use "event" as the only Failure option. First estimate model with Logit

. logit censor1 $xvars logspell if time==1

. est sto m1

Second, I estimate the model using streg for comparison

. stset spell, failure(exit) enter(spell0) id(id)

. streg $xvars , distribution(exponential) nohr

. est sto m2

Third, I use ghsurv to estimate the model assuming we do not observe the panel data information.

. stset, clear

. ghsurv_set, dur(spell) time(time) nowarning

. gen logdur=log(_dur)

. ghsurv $xvars logdur, alpha(logdur) technique(nr bhhh)

. est sto m3

But also compare it to the case where standard errors are clustered using original ID indicator, instead of _id (the default)

. ghsurv $xvars logdur, alpha(logdur) technique(nr bhhh) cluster(id)

. est sto m4

. esttab m1 m2 m3 m4, se star(* 0.1 ** 0.05 *** 0.01) nogaps

(1) (2) (3) (4)
censor1 _t _y01 _y01

main
logwage 0.372*** 0.251*** 0.470* 0.470***
(0.0847) (0.0659) (0.242) (0.136)
tenure 0.00329 -0.000538 0.000689 0.000689
(0.00759) (0.00598) (0.0160) (0.00907)
slack -0.318*** -0.313*** -0.302 -0.302**
(0.0807) (0.0642) (0.221) (0.120)
explose 0.0402 0.0881 0.187 0.187
(0.0783) (0.0616) (0.264) (0.144)
houshead 0.305*** 0.294*** 0.330 0.330**
(0.0966) (0.0779) (0.298) (0.155)
married 0.367*** 0.307*** 0.505 0.505***
(0.0892) (0.0711) (0.342) (0.184)
female 0.209** 0.178** 0.227 0.227
(0.0967) (0.0776) (0.269) (0.142)
ychild -0.178 -0.160* -0.198 -0.198
(0.109) (0.0852) (0.252) (0.140)
nonwhite -0.420*** -0.431*** -0.452 -0.452*
(0.128) (0.109) (0.484) (0.238)
age -0.0145*** -0.0160*** -0.00966 -0.00966
(0.00462) (0.00366) (0.0112) (0.00614)
schgt12 0.354*** 0.274*** 0.292 0.292***
(0.0835) (0.0649) (0.196) (0.111)
logspell -0.471***
(0.0440)
logdur -0.954*** -0.954***
(0.340) (0.182)
_cons -2.124*** -2.878*** -2.700 -2.700**
(0.481) (0.376) (2.087) (1.094)

alpha
logdur 0.0861 0.0861**
(0.0969) (0.0401)
_cons -0.0670 -0.0670
(0.339) (0.153)

N 3343 5613 5613 5613

Standard errors in parentheses
* p<0.1, ** p<0.05, *** p<0.01

References

Mundra, K & Rios-Avila, F. 2020. Using repeated cross-sectional data to examine the role
of immigrant birth-country networks on unemployment
duration: an application of Guell and Hu (2006) approach. Empirical Economics. https://doi.org/10.1007/s00181-020-01855-x

Güell, M. & Hu, L. 2006. Estimating the probability of leaving unemployment using uncompleted spells from repeated
cross-section data. Journal of Econometrics, 133(1), 307–341. doi:10.1016/j.jeconom.2005.03.017

Author

Fernando Rios-Avila

Levy Economics Institute of Bard College

Annandale-on-Hudson, NY

friosavi@levy.org

Acknowledgments

All errors are my own.

If you find the program useful and use in your research, please consider citing Mundra & Rios-Avila (2020).