% usefile c:\oupbuch\nigeria\nigeria_ch6.prg dataset d d.infile, maxobs=12000 using c:\oupbuch\nigeria\nigeria_cox.raw map m m.infile using c:\oupbuch\nigeria\nigeria.bnd remlreg r delimiter=; % Continuous time analyses % purely spatial model without any further covariates r.outfile= c:\oupbuch\nigeria\results\reml_purespatial\reml_purespatial; logopen using c:\oupbuch\nigeria\results\reml_purespatial\reml_purespatial.log; r.regress censindinterval = heapingright(baseline, lambdastart=1000, gridchoice=equidistant, tgrid=500) + district(spatial,map=m,lambdastart=1000) ,family=cox leftint=heapingleft lefttrunc=trunctime using d; logclose; % complete model with heaping r.outfile= c:\oupbuch\nigeria\results\reml_heaping\reml_heaping; logopen using c:\oupbuch\nigeria\results\reml_heaping\reml_heaping.log; r.regress censindinterval = heapingright(baseline, lambdastart=1000, gridchoice=equidistant, tgrid=500) + district(spatial,map=m,lambdastart=1000) + bmimother(psplinerw2,lambdastart=1000) + ageatbirth(psplinerw2,lambdastart=1000) + birthorder(psplinerw2,lambdastart=1000) + householdsize(psplinerw2,lambdastart=1000) + breastfeedduration + sex + work + education + placeofdelivery + assistance + longbirth + bleeding + fever + convulsion + toilet + floormaterial + electricity + urban + religion1 + religion3 + weight2 + weight3 + weight4 + weight5 + wealth2 + wealth3 + wealth4 + wealth5 + watersource + initial1 + initial2 ,family=cox leftint=heapingleft lefttrunc=trunctime using d; logclose; % complete model with interval censoring but without heaping r.outfile= c:\oupbuch\nigeria\results\reml_interval\reml_interval; logopen using c:\oupbuch\nigeria\results\reml_interval\reml_interval.log; r.regress censindinterval = intervalright(baseline, lambdastart=1000, gridchoice=equidistant, tgrid=500) + district(spatial,map=m,lambdastart=1000) + bmimother(psplinerw2,lambdastart=1000) + ageatbirth(psplinerw2,lambdastart=1000) + birthorder(psplinerw2,lambdastart=1000) + householdsize(psplinerw2,lambdastart=1000) + breastfeedduration + sex + work + education + placeofdelivery + assistance + longbirth + bleeding + fever + convulsion + toilet + floormaterial + electricity + urban + religion1 + religion3 + weight2 + weight3 + weight4 + weight5 + wealth2 + wealth3 + wealth4 + wealth5 + watersource + initial1 + initial2 ,family=cox leftint=intervalleft lefttrunc=trunctime using d; logclose; % complete model with randomly distributed time points r.outfile= c:\oupbuch\nigeria\results\reml_right_random\reml_right_random; logopen using c:\oupbuch\nigeria\results\reml_right_random\reml_right_random.log; r.regress censind = survtimerandom(baseline, lambdastart=1000, gridchoice=equidistant, tgrid=500) + district(spatial,map=m,lambdastart=1000) + bmimother(psplinerw2,lambdastart=1000) + ageatbirth(psplinerw2,lambdastart=1000) + birthorder(psplinerw2,lambdastart=1000) + householdsize(psplinerw2,lambdastart=1000) + breastfeedduration + sex + work + education + placeofdelivery + assistance + longbirth + bleeding + fever + convulsion + toilet + floormaterial + electricity + urban + religion1 + religion3 + weight2 + weight3 + weight4 + weight5 + wealth2 + wealth3 + wealth4 + wealth5 + watersource + initial1 + initial2 ,family=cox lefttrunc=trunctime using d; logclose; r.outfile= c:\oupbuch\nigeria\results\reml_right\reml_right; logopen using c:\oupbuch\nigeria\results\reml_right\reml_right.log; r.regress censind = survtime(baseline, lambdastart=1000, gridchoice=equidistant, tgrid=500) + district(spatial,map=m,lambdastart=1000) + bmimother(psplinerw2,lambdastart=1000) + ageatbirth(psplinerw2,lambdastart=1000) + birthorder(psplinerw2,lambdastart=1000) + householdsize(psplinerw2,lambdastart=1000) + breastfeedduration + sex + work + education + placeofdelivery + assistance + longbirth + bleeding + fever + convulsion + toilet + floormaterial + electricity + urban + religion1 + religion3 + weight2 + weight3 + weight4 + weight5 + wealth2 + wealth3 + wealth4 + wealth5 + watersource + initial1 + initial2 ,family=cox lefttrunc=trunctime using d; logclose; delimiter=return; % Discrete time analyses d.infile, maxobs=80000 using c:\oupbuch\nigeria\discretetime.raw bayesreg b logopen using c:\oupbuch\nigeria\results\mcmc_discrete_logit\mcmclogit.log b.outfile = c:\oupbuch\nigeria\results\mcmc_discrete_logit\mcmclogit b.regress y = survtimemonths(psplinerw2) + district(spatial,map=m) + bmimother(psplinerw2) + ageatbirth(psplinerw2) + birthorder(psplinerw2) + householdsize(psplinerw2) + breastfeedduration + sex + work + education + placeofdelivery + assistance + longbirth + bleeding + fever + convulsion + toilet + floormaterial + electricity + urban + religion1 + religion3 + weight2 + weight3 + weight4 + weight5 + wealth2 + wealth3 + wealth4 + wealth5 + watersource + initial1 + initial2, family=binomial iterations=12000 burnin=2000 predict using d logclose logopen using c:\oupbuch\nigeria\results\mcmc_discrete_probit\mcmcprobit.log b.outfile = c:\oupbuch\nigeria\results\mcmc_discrete_probit\mcmcprobit b.regress y = survtimemonths(psplinerw2) + district(spatial,map=m) + bmimother(psplinerw2) + ageatbirth(psplinerw2) + birthorder(psplinerw2) + householdsize(psplinerw2) + breastfeedduration + sex + work + education + placeofdelivery + assistance + longbirth + bleeding + fever + convulsion + toilet + floormaterial + electricity + urban + religion1 + religion3 + weight2 + weight3 + weight4 + weight5 + wealth2 + wealth3 + wealth4 + wealth5 + watersource + initial1 + initial2, family=binomialprobit iterations=12000 burnin=2000 predict using d logclose