We need to set-up R Markdown to run Stata. This is possible due to Doug Hemken’s package: https://www.ssc.wisc.edu/~hemken/Stataworkshops/Statamarkdown/stata-and-r-markdown.html
First, I gather data from SOEP. Much of this code is sourced from Kramer et al. (2024). I am very grateful to these authors for making their code public and saving me hundreds of hours of time. Their code can be found at: https://osf.io/qdtb5/
In particular, I implemented much of: https://osf.io/qdtb5/files/osfstorage/64b6939eb49dcb01557365fd https://osf.io/qdtb5/files/osfstorage/64b6939e465d14014aa31c19
My only changes I were:
1. I merged the occurrences of life events, such that: e.g., the 1st instance of bereavement was merged with the 2nd, 3rd etc.
2. I updated the code to collect data for 2021 and 2022.
A pdf for my data gathering script is available here: https://tinyurl.com/3ky8m8s2
quietly {
do "/Users/charlieharrison/Desktop/Dissertation/Final Docs/Gathering_Data.do"
}
The in-text comments are fairly descriptive. Unfortunately, RMarkdown doesn’t display the plots. Please contact me if you have any questions.
Note: I then extracted the results manually, and plotted using R. See: https://tinyurl.com/mvf672f9
cd "/Users/charlieharrison/Desktop/DissCoding"
pwd
// Global variable for where SOEP data is saved
global soep "/Users/charlieharrison/Desktop/DissCoding/SOEPFiles/Stata_DE/soepdata/raw"
// New directory for processed ("help") data
!mkdir "/Users/charlieharrison/Desktop/DissCoding/Processed_Data/"
// Shortcut for this directory
global helpdata "/Users/charlieharrison/Desktop/DissCoding/Processed_Data"
global soep_not_raw "/Users/charlieharrison/Desktop/DissCoding/SOEPFiles/Stata_DE/soepdata/"
use "$helpdata/dataset_lifesat_analyses.dta", clear
// *** Step 1: Create Decadal Period Dummies ***
*** Step 2: First-Difference Life Satisfaction ***
sort pid syear
tsset pid syear
gen d_lifesat = lifesat - L.lifesat
// List of event variables with numeric conversion
local variables ///
retire_1 unemployed_1 partner_died_1 father_died_1 mother_died_1 ///
child_died_1 child_moved_out_1 first_job_1 ///
divorced_1 newpartner_1 ///
cohabnew_1 separation_1 ///
childbirth_1 ///
retire_n unemployed_n partner_died_n father_died_n mother_died_n ///
child_died_n child_moved_out_n first_job_n ///
divorced_n newpartner_n ///
cohabnew_n separation_n ///
childbirth_n
// Destring variables safely
foreach var in `variables' {
capture confirm numeric variable `var'
if _rc {
replace `var' = "" if `var' == "."
destring `var', replace force
}
}
drop if syear<1990
//
count
gen period = .
replace period = 1990 if inrange(syear, 1990, 1994) // 5-year bin
replace period = 1995 if inrange(syear, 1995, 1999) // 5-year bin
replace period = 2000 if inrange(syear, 2000, 2004) // 5-year bin
replace period = 2005 if inrange(syear, 2005, 2009) // 5-year bin
replace period = 2010 if inrange(syear, 2010, 2014) // 5-year bin
replace period = 2015 if inrange(syear, 2015, 2019) // 5-year bin
replace period = 2020 if inrange(syear, 2020, 2022) // 3-year bin (to balance recent years)
// Regression for all events
// // Interaction Regressions
foreach event in separation_n ///
child_moved_out_n retire_1 unemployed_n partner_died_n first_job_1 ///
divorced_n newpartner_n cohabnew_n childbirth_1{ ///
// Define exclusion variable
local excl_var "`event'_excl"
// Preserve original dataset
preserve
// Apply exclusion rule only if the variable exists
capture confirm variable `excl_var'
if _rc == 0 {
drop if `excl_var' == 1
}
// Additional exclusion for childbirth_1: drop men
if "`event'" == "childbirth_1" {
drop if sex == 1
}
di "Processing event: `event'"
// Identify available periods
levelsof period if `event' == 1, local(periods)
// Run regression
reg d_lifesat i.`event'##i.period, cluster(pid)
// Restore dataset
restore
}
// Plots for Final 5 "Core" Events
foreach event in separation_n ///
unemployed_n partner_died_n ///
newpartner_n cohabnew_n{ ///
// Define exclusion variable
local excl_var "`event'_excl"
// Preserve original dataset
preserve
// Apply exclusion rule only if the variable exists
capture confirm variable `excl_var'
if _rc == 0 {
drop if `excl_var' == 1
}
di "Processing event: `event'"
// Identify available periods
levelsof period if `event' == 1, local(periods)
// Run regression
reg d_lifesat i.`event'##i.period, cluster(pid)
// Perform Chow test
testparm i.`event'#i.period
local F_stat = r(F)
local p_value = r(p)
// Display results
di "Chow Test for `event': F-statistic = " `F_stat'
di "p-value = " `p_value'
// Get readable event title
local event_title ""
if "`event'" == "unemployed_n" local event_title "Treatment Effect of Unemployment in Each Period"
if "`event'" == "partner_died_n" local event_title "Treatment Effect of Partner's Death in Each Period"
if "`event'" == "newpartner_n" local event_title "Treatment Effect of a New Partnership in Each Period"
if "`event'" == "cohabnew_n" local event_title "Treatment Effect of Moving in with a Partner in Each Period"
if "`event'" == "separation_n" local event_title "Treatment Effect of Separation in Each Period"
//
// // Compute marginal effects
margins period, dydx(`event')
// Generate improved margins plot
marginsplot, xdimension(period) ///
title("`event_title'", size(large)) ///
xtitle("Time Period", size(medium)) ///
ytitle("Estimated Effect", size(medium)) ///
yline(0, lcolor(gs8) lwidth(thin)) /// Add reference line at y=0
ylabel(, angle(0)) /// Keep y-axis labels horizontal
xscale(noline) yscale(noline) /// Remove unnecessary box lines
plotopts(lwidth(thick) msize(large)) /// Thicker lines & bigger markers
legend(pos(6) ring(0)) ///
name(plot_`event', replace)
// Save graph instead of displaying in loop
graph display plot_`event'
// Restore dataset
restore
}
* Step 1: Generate a variable for the unemployment rate
gen unemployment_rate = . // Create the variable
* Example: Assign unemployment rates based on period or year
replace unemployment_rate = 7.01025 if period == 1990
replace unemployment_rate = 9.0964 if period == 1995
replace unemployment_rate = 8.9356 if period == 2000
replace unemployment_rate = 9.0684 if period == 2005
replace unemployment_rate = 5.6766 if period == 2010
replace unemployment_rate = 3.8024 if period == 2015
replace unemployment_rate = 3.543 if period == 2020
* Step 2: Run regression with unemployment and interaction term
reg d_lifesat i.unemployed_n##c.unemployment_rate, cluster(pid)
reg d_lifesat i.unemployed_n##i.period, cluster(pid)
// Sensitivity Analysis
gen period_8 = .
replace period_8 = 1990 if inrange(syear, 1990, 1997) // 8-year bin
replace period_8 = 1998 if inrange(syear, 1998, 2005) // 8-year bin
replace period_8 = 2006 if inrange(syear, 2006, 2013) // 8-year bin
replace period_8 = 2014 if inrange(syear, 2014, 2022) // 9-year bin
// Results: Final 5
foreach event in separation_n ///
unemployed_n partner_died_n ///
newpartner_n cohabnew_n{ ///
// Define exclusion variable
local excl_var "`event'_excl"
// Preserve original dataset
preserve
// Apply exclusion rule only if the variable exists
capture confirm variable `excl_var'
if _rc == 0 {
drop if `excl_var' == 1
}
di "Processing event: `event'"
// Identify available periods
levelsof period_8 if `event' == 1, local(period_8)
// Run regression
reg d_lifesat i.`event'##i.period_8, cluster(pid)
// Perform Chow test
testparm i.`event'#i.period_8
local F_stat = r(F)
local p_value = r(p)
// Display results
di "Chow Test for `event': F-statistic = " `F_stat'
di "p-value = " `p_value'
// Get readable event title
local event_title ""
local event_title ""
if "`event'" == "unemployed_n" local event_title "Treatment Effect of Unemployment in Each Period"
if "`event'" == "partner_died_n" local event_title "Treatment Effect of Partner's Death in Each Period"
if "`event'" == "newpartner_n" local event_title "Treatment Effect of a New Partnership in Each Period"
if "`event'" == "cohabnew_n" local event_title "Treatment Effect of Moving in with a Partner in Each Period"
if "`event'" == "separation_n" local event_title "Treatment Effect of Separation in Each Period"
//
margins period_8, dydx(`event')
// Generate improved margins plot
marginsplot, xdimension(period_8) ///
title("`event_title'", size(large)) ///
xtitle("Time Period", size(medium)) ///
ytitle("Estimated Effect", size(medium)) ///
yline(0, lcolor(gs8) lwidth(thin)) /// Add reference line at y=0
ylabel(, angle(0)) /// Keep y-axis labels horizontal
xscale(noline) yscale(noline) /// Remove unnecessary box lines
plotopts(lwidth(thick) msize(large)) /// Thicker lines & bigger markers
legend(pos(6) ring(0)) ///
name(plot_`event', replace)
// Save graph instead of displaying in loop
graph display plot_`event'
// Restore dataset
restore
}
// Pairwise correlations to assess collinearity between events
pwcorr separation_n unemployed_n partner_died_n newpartner_n cohabnew_n, sig star(.05)
// Calculate the proportion of never-treated individuals
foreach event in separation_n unemployed_n partner_died_n newpartner_n cohabnew_n {
sum `event'_ever
local total_obs = r(N)
local never_treated = r(N) - r(sum) // Count of never-treated individuals
local prop_never_treated = `never_treated' / `total_obs' * 100
di "Proportion of never-treated individuals for `event': " `prop_never_treated' "%"
}
// Calculate the counts for events in each period
foreach event in separation_n unemployed_n partner_died_n newpartner_n cohabnew_n {
tab `event' period
}
local events separation_n unemployed_n partner_died_n newpartner_n cohabnew_n
local total_events = 0
foreach event of local events {
quietly count if `event' == 1
local total_events = `total_events' + r(N)
}
display "Total number of life events (==1): `total_events'"
// Calculate mean LS in each period
preserve
collapse (mean) lifesat, by(period)
// Display results
list period lifesat, clean
restore
/Users/charlieharrison/Desktop/DissCoding
/Users/charlieharrison/Desktop/DissCoding
mkdir: /Users/charlieharrison/Desktop/DissCoding/Processed_Data/: File exists
(PreWghts: SOEP-Core, v39 (EU Edition), doi:10.5684/soep.core.v39eu)
Panel variable: pid (unbalanced)
Time variable: syear, 1984 to 2022, but with gaps
Delta: 1 unit
(121,862 missing values generated)
(63,994 observations deleted)
689,492
(689,492 missing values generated)
(62,778 real changes made)
(69,127 real changes made)
(115,183 real changes made)
(104,534 real changes made)
(137,789 real changes made)
(130,276 real changes made)
(69,805 real changes made)
2. // Define exclusion variable
(70,709 observations deleted)
Processing event: separation_n
1990 1995 2000 2005 2010 2015 2020
Linear regression Number of obs = 158,235
F(13, 21640) = 31.66
Prob > F = 0.0000
R-squared = 0.0021
Root MSE = 1.6387
(Std. err. adjusted for 21,641 clusters in pid)
------------------------------------------------------------------------------
| Robust
d_lifesat | Coefficient std. err. t P>|t| [95% conf. interval]
-------------+----------------------------------------------------------------
1.separati~n | -.2154436 .0787505 -2.74 0.006 -.3698004 -.0610868
|
period |
1995 | .0450805 .0186811 2.41 0.016 .0084642 .0816967
2000 | -.0478381 .015627 -3.06 0.002 -.0784681 -.0172081
2005 | .0450119 .0151235 2.98 0.003 .0153687 .0746551
2010 | .0231424 .0143374 1.61 0.107 -.0049599 .0512448
2015 | .0618164 .0137369 4.50 0.000 .0348912 .0887417
2020 | -.0517848 .0153025 -3.38 0.001 -.0817789 -.0217907
|
separation_n#|
period |
1 1995 | -.0323073 .0981598 -0.33 0.742 -.2247078 .1600931
1 2000 | -.034968 .0915107 -0.38 0.702 -.2143356 .1443997
1 2005 | -.0087807 .090524 -0.10 0.923 -.1862145 .1686531
1 2010 | -.0459934 .0893656 -0.51 0.607 -.2211566 .1291699
1 2015 | -.0301602 .0893182 -0.34 0.736 -.2052304 .14491
1 2020 | .024059 .1024239 0.23 0.814 -.1766994 .2248175
|
_cons | -.0314358 .0128533 -2.45 0.014 -.0566291 -.0062424
------------------------------------------------------------------------------
(0 observations deleted)
Processing event: child_moved_out_n
1990 1995 2000 2005 2010 2015 2020
Linear regression Number of obs = 582,801
F(13, 71464) = 93.93
Prob > F = 0.0000
R-squared = 0.0008
Root MSE = 1.5992
(Std. err. adjusted for 71,465 clusters in pid)
------------------------------------------------------------------------------
| Robust
d_lifesat | Coefficient std. err. t P>|t| [95% conf. interval]
-------------+----------------------------------------------------------------
1.child_mo~n | -.0346367 .046105 -0.75 0.453 -.1250023 .0557289
|
period |
1995 | -.0020225 .0070246 -0.29 0.773 -.0157907 .0117456
2000 | -.0965499 .0057657 -16.75 0.000 -.1078507 -.0852491
2005 | -.0019834 .0056905 -0.35 0.727 -.0131367 .0091699
2010 | .0026801 .005728 0.47 0.640 -.0085467 .0139069
2015 | .0395778 .005569 7.11 0.000 .0286625 .050493
2020 | -.0610224 .0070615 -8.64 0.000 -.0748628 -.047182
|
child_move~n#|
period |
1 1995 | .0132036 .0621869 0.21 0.832 -.1086826 .1350897
1 2000 | .0193354 .0564469 0.34 0.732 -.0913003 .1299712
1 2005 | .0621694 .0566067 1.10 0.272 -.0487796 .1731183
1 2010 | .0483681 .0551509 0.88 0.380 -.0597275 .1564637
1 2015 | .0643127 .0548453 1.17 0.241 -.043184 .1718094
1 2020 | .0765759 .0599837 1.28 0.202 -.0409919 .1941437
|
_cons | -.0221742 .0047648 -4.65 0.000 -.0315132 -.0128351
------------------------------------------------------------------------------
(0 observations deleted)
Processing event: retire_1
1990 1995 2000 2005 2010 2015 2020
Linear regression Number of obs = 582,794
F(13, 71464) = 98.10
Prob > F = 0.0000
R-squared = 0.0009
Root MSE = 1.5991
(Std. err. adjusted for 71,465 clusters in pid)
------------------------------------------------------------------------------
| Robust
d_lifesat | Coefficient std. err. t P>|t| [95% conf. interval]
-------------+----------------------------------------------------------------
1.retire_1 | .1381941 .0899959 1.54 0.125 -.0381976 .3145859
|
period |
1995 | -.0001422 .0068733 -0.02 0.983 -.0136139 .0133295
2000 | -.0953616 .0056123 -16.99 0.000 -.1063617 -.0843615
2005 | .0004915 .0055399 0.09 0.929 -.0103667 .0113497
2010 | .004742 .0055694 0.85 0.395 -.006174 .0156579
2015 | .0400574 .0054163 7.40 0.000 .0294414 .0506734
2020 | -.0589903 .0068785 -8.58 0.000 -.0724722 -.0455084
|
retire_1#|
period |
1 1995 | -.1941221 .1222261 -1.59 0.112 -.4336849 .0454406
1 2000 | -.0524328 .1086063 -0.48 0.629 -.265301 .1604353
1 2005 | -.107756 .1077711 -1.00 0.317 -.318987 .103475
1 2010 | -.0692658 .1139104 -0.61 0.543 -.2925298 .1539983
1 2015 | .2414372 .1065092 2.27 0.023 .0326795 .4501949
1 2020 | .0078388 .117492 0.07 0.947 -.2224451 .2381226
|
_cons | -.0242406 .0046213 -5.25 0.000 -.0332985 -.0151828
------------------------------------------------------------------------------
(126,911 observations deleted)
Processing event: unemployed_n
1990 1995 2000 2005 2010 2015 2020
Linear regression Number of obs = 466,281
F(13, 62453) = 112.79
Prob > F = 0.0000
R-squared = 0.0028
Root MSE = 1.5799
(Std. err. adjusted for 62,454 clusters in pid)
------------------------------------------------------------------------------
| Robust
d_lifesat | Coefficient std. err. t P>|t| [95% conf. interval]
-------------+----------------------------------------------------------------
1.unemploy~n | -.4512095 .0521007 -8.66 0.000 -.5533271 -.349092
|
period |
1995 | .0035625 .0078179 0.46 0.649 -.0117607 .0188856
2000 | -.0969359 .0064718 -14.98 0.000 -.1096208 -.0842511
2005 | -.0039737 .0064303 -0.62 0.537 -.016577 .0086297
2010 | -.0077409 .0064549 -1.20 0.230 -.0203925 .0049107
2015 | .0284684 .0062686 4.54 0.000 .016182 .0407548
2020 | -.0894458 .0078827 -11.35 0.000 -.1048958 -.0739957
|
unemployed_n#|
period |
1 1995 | -.0898311 .0713225 -1.26 0.208 -.2296234 .0499612
1 2000 | -.0863151 .0669166 -1.29 0.197 -.2174718 .0448416
1 2005 | .024465 .0705342 0.35 0.729 -.1137822 .1627121
1 2010 | .0960771 .068726 1.40 0.162 -.0386261 .2307803
1 2015 | .2245257 .0705603 3.18 0.001 .0862274 .362824
1 2020 | .2812839 .0901226 3.12 0.002 .1046435 .4579243
|
_cons | -.0004601 .0053537 -0.09 0.932 -.0109534 .0100333
------------------------------------------------------------------------------
(128,371 observations deleted)
Processing event: partner_died_n
1990 1995 2000 2005 2010 2015 2020
Linear regression Number of obs = 480,075
F(13, 62505) = 90.30
Prob > F = 0.0000
R-squared = 0.0020
Root MSE = 1.5605
(Std. err. adjusted for 62,506 clusters in pid)
------------------------------------------------------------------------------
| Robust
d_lifesat | Coefficient std. err. t P>|t| [95% conf. interval]
-------------+----------------------------------------------------------------
1.partner_~n | -.5859408 .1804029 -3.25 0.001 -.9395308 -.2323508
|
period |
1995 | .0028845 .0074923 0.38 0.700 -.0118004 .0175694
2000 | -.0925613 .006227 -14.86 0.000 -.1047662 -.0803564
2005 | -.002569 .0061311 -0.42 0.675 -.0145859 .0094479
2010 | .0009427 .0061627 0.15 0.878 -.0111363 .0130216
2015 | .0421069 .0059769 7.04 0.000 .0303922 .0538215
2020 | -.0652516 .0075878 -8.60 0.000 -.0801236 -.0503795
|
partner_di~n#|
period |
1 1995 | -.0790644 .233973 -0.34 0.735 -.5376519 .3795232
1 2000 | -.4562036 .2320928 -1.97 0.049 -.911106 -.0013012
1 2005 | -.1470603 .2213169 -0.66 0.506 -.5808417 .2867212
1 2010 | -.3748004 .2283075 -1.64 0.101 -.8222835 .0726826
1 2015 | -.3103297 .2269725 -1.37 0.172 -.7551962 .1345367
1 2020 | -.1928575 .2528381 -0.76 0.446 -.6884206 .3027056
|
_cons | -.013093 .0051096 -2.56 0.010 -.0231078 -.0030782
------------------------------------------------------------------------------
(0 observations deleted)
Processing event: first_job_1
1990 1995 2000 2005 2010 2015 2020
Linear regression Number of obs = 582,796
F(13, 71463) = 94.96
Prob > F = 0.0000
R-squared = 0.0008
Root MSE = 1.5992
(Std. err. adjusted for 71,464 clusters in pid)
------------------------------------------------------------------------------
| Robust
d_lifesat | Coefficient std. err. t P>|t| [95% conf. interval]
-------------+----------------------------------------------------------------
1.first_j~_1 | .0748228 .0721567 1.04 0.300 -.0666041 .2162498
|
period |
1995 | -.0025429 .0068895 -0.37 0.712 -.0160463 .0109605
2000 | -.095672 .0056327 -16.99 0.000 -.1067121 -.0846319
2005 | -.0001477 .0055646 -0.03 0.979 -.0110543 .010759
2010 | .004725 .0055949 0.84 0.398 -.006241 .015691
2015 | .0413425 .0054353 7.61 0.000 .0306892 .0519957
2020 | -.0577548 .0068923 -8.38 0.000 -.0712636 -.0442459
|
first_job_1#|
period |
1 1995 | .1140648 .1034845 1.10 0.270 -.0887646 .3168941
1 2000 | -.0051048 .0920117 -0.06 0.956 -.1854476 .175238
1 2005 | .0026145 .0929591 0.03 0.978 -.1795851 .1848141
1 2010 | -.0498879 .0918155 -0.54 0.587 -.2298461 .1300703
1 2015 | .0266953 .0878419 0.30 0.761 -.1454745 .1988652
1 2020 | -.0791318 .1150153 -0.69 0.491 -.3045614 .1462979
|
_cons | -.0240982 .0046423 -5.19 0.000 -.0331971 -.0149992
------------------------------------------------------------------------------
(0 observations deleted)
Processing event: divorced_n
1990 1995 2000 2005 2010 2015 2020
Linear regression Number of obs = 577,099
F(13, 70661) = 96.48
Prob > F = 0.0000
R-squared = 0.0009
Root MSE = 1.598
(Std. err. adjusted for 70,662 clusters in pid)
------------------------------------------------------------------------------
| Robust
d_lifesat | Coefficient std. err. t P>|t| [95% conf. interval]
-------------+----------------------------------------------------------------
1.divorced_n | .1555418 .1378224 1.13 0.259 -.1145897 .4256733
|
period |
1995 | -.00132 .0068589 -0.19 0.847 -.0147635 .0121235
2000 | -.0969894 .0056095 -17.29 0.000 -.107984 -.0859947
2005 | -.0004628 .0055343 -0.08 0.933 -.01131 .0103844
2010 | .0060388 .0055852 1.08 0.280 -.0049082 .0169858
2015 | .0399499 .00542 7.37 0.000 .0293266 .0505731
2020 | -.058938 .0068946 -8.55 0.000 -.0724513 -.0454246
|
divorced_n#|
period |
1 1995 | .0182326 .1823563 0.10 0.920 -.3391853 .3756504
1 2000 | .1443281 .1644766 0.88 0.380 -.1780456 .4667019
1 2005 | .0656248 .1653301 0.40 0.691 -.2584219 .3896714
1 2010 | -.0390486 .1570028 -0.25 0.804 -.3467738 .2686766
1 2015 | .1494609 .1610457 0.93 0.353 -.1661883 .46511
1 2020 | -.0767368 .178467 -0.43 0.667 -.4265317 .2730581
|
_cons | -.0240864 .0046118 -5.22 0.000 -.0331256 -.0150472
------------------------------------------------------------------------------
(170,900 observations deleted)
Processing event: newpartner_n
1990 1995 2000 2005 2010 2015 2020
Linear regression Number of obs = 130,034
F(13, 13261) = 39.37
Prob > F = 0.0000
R-squared = 0.0034
Root MSE = 1.6381
(Std. err. adjusted for 13,262 clusters in pid)
------------------------------------------------------------------------------
| Robust
d_lifesat | Coefficient std. err. t P>|t| [95% conf. interval]
-------------+----------------------------------------------------------------
1.newpartn~n | .2681379 .0522609 5.13 0.000 .1656991 .3705767
|
period |
1995 | .0137543 .0161719 0.85 0.395 -.017945 .0454536
2000 | -.0790885 .0140932 -5.61 0.000 -.1067133 -.0514638
2005 | .0345758 .0137094 2.52 0.012 .0077035 .0614482
2010 | .0363456 .013855 2.62 0.009 .0091879 .0635033
2015 | .0394649 .0138966 2.84 0.005 .0122256 .0667042
2020 | -.0498355 .0173258 -2.88 0.004 -.0837964 -.0158745
|
newpartner_n#|
period |
1 1995 | .0224678 .0709177 0.32 0.751 -.116541 .1614765
1 2000 | .0005609 .065003 0.01 0.993 -.1268542 .127976
1 2005 | -.0360547 .0643829 -0.56 0.575 -.1622543 .0901449
1 2010 | .0471614 .0652543 0.72 0.470 -.0807463 .1750691
1 2015 | .0343976 .0683887 0.50 0.615 -.099654 .1684492
1 2020 | -.027765 .0866138 -0.32 0.749 -.1975404 .1420104
|
_cons | -.0552434 .0117677 -4.69 0.000 -.0783097 -.0321771
------------------------------------------------------------------------------
(152,204 observations deleted)
Processing event: cohabnew_n
1990 1995 2000 2005 2010 2015 2020
Linear regression Number of obs = 123,427
F(13, 12492) = 36.07
Prob > F = 0.0000
R-squared = 0.0028
Root MSE = 1.6237
(Std. err. adjusted for 12,493 clusters in pid)
------------------------------------------------------------------------------
| Robust
d_lifesat | Coefficient std. err. t P>|t| [95% conf. interval]
-------------+----------------------------------------------------------------
1.cohabnew_n | .301201 .0625741 4.81 0.000 .1785461 .4238558
|
period |
1995 | .023526 .0158066 1.49 0.137 -.0074574 .0545094
2000 | -.0739091 .0135441 -5.46 0.000 -.1004576 -.0473605
2005 | .0415508 .0131636 3.16 0.002 .0157482 .0673534
2010 | .0482369 .0134557 3.58 0.000 .0218616 .0746122
2015 | .0650351 .0132086 4.92 0.000 .0391443 .090926
2020 | -.057879 .0167993 -3.45 0.001 -.0908082 -.0249498
|
cohabnew_n#|
period |
1 1995 | .0205178 .0826619 0.25 0.804 -.1415122 .1825477
1 2000 | .025362 .0802633 0.32 0.752 -.1319665 .1826905
1 2005 | .0253048 .0795145 0.32 0.750 -.1305558 .1811655
1 2010 | -.0231427 .0809751 -0.29 0.775 -.1818664 .135581
1 2015 | -.0976479 .078717 -1.24 0.215 -.2519454 .0566495
1 2020 | -.1945056 .0890179 -2.19 0.029 -.3689944 -.0200168
|
_cons | -.054547 .0112717 -4.84 0.000 -.0766413 -.0324527
------------------------------------------------------------------------------
(393,219 observations deleted)
(135,115 observations deleted)
Processing event: childbirth_1
1990 1995 2000 2005 2010 2015 2020
Linear regression Number of obs = 133,294
F(13, 16874) = 21.63
Prob > F = 0.0000
R-squared = 0.0009
Root MSE = 1.5904
(Std. err. adjusted for 16,875 clusters in pid)
------------------------------------------------------------------------------
| Robust
d_lifesat | Coefficient std. err. t P>|t| [95% conf. interval]
-------------+----------------------------------------------------------------
1.childbi~_1 | .0555891 .1252257 0.44 0.657 -.1898664 .3010446
|
period |
1995 | .0009018 .0129903 0.07 0.945 -.0245605 .0263641
2000 | -.0803303 .0108975 -7.37 0.000 -.1016906 -.0589701
2005 | .0148356 .0108633 1.37 0.172 -.0064576 .0361288
2010 | .0319531 .0113053 2.83 0.005 .0097935 .0541128
2015 | .0378367 .0110029 3.44 0.001 .0162699 .0594036
2020 | -.0818688 .0145144 -5.64 0.000 -.1103185 -.0534191
|
childbirth_1#|
period |
1 1995 | .0754659 .1618136 0.47 0.641 -.2417055 .3926374
1 2000 | -.0594525 .1459597 -0.41 0.684 -.3455487 .2266438
1 2005 | -.0597843 .1457837 -0.41 0.682 -.3455356 .225967
1 2010 | .1251952 .1485078 0.84 0.399 -.1658956 .4162861
1 2015 | .0039163 .1455868 0.03 0.979 -.281449 .2892816
1 2020 | .0115343 .161596 0.07 0.943 -.3052108 .3282793
|
_cons | -.0415046 .0088079 -4.71 0.000 -.0587691 -.0242402
------------------------------------------------------------------------------
2. local excl_var "`event'_excl"
3.
18. if "`event'" == "partner_died_n" local event_title "Treatment Effect o
> f Partner's Death in Each Period"
19. if "`event'" == "newpartner_n" local event_title "Treatment Effect of
> a New Partnership in Each Period"
20. if "`event'" == "cohabnew_n" local event_title "Treatment Effect of Mo
> ving in with a Partner in Each Period"
21. if "`event'" == "separation_n" local event_title "Treatment Effect of
> Separation in Each Period"
22. //
24.
(70,709 observations deleted)
Processing event: separation_n
1990 1995 2000 2005 2010 2015 2020
Linear regression Number of obs = 158,235
F(13, 21640) = 31.66
Prob > F = 0.0000
R-squared = 0.0021
Root MSE = 1.6387
(Std. err. adjusted for 21,641 clusters in pid)
------------------------------------------------------------------------------
| Robust
d_lifesat | Coefficient std. err. t P>|t| [95% conf. interval]
-------------+----------------------------------------------------------------
1.separati~n | -.2154436 .0787505 -2.74 0.006 -.3698004 -.0610868
|
period |
1995 | .0450805 .0186811 2.41 0.016 .0084642 .0816967
2000 | -.0478381 .015627 -3.06 0.002 -.0784681 -.0172081
2005 | .0450119 .0151235 2.98 0.003 .0153687 .0746551
2010 | .0231424 .0143374 1.61 0.107 -.0049599 .0512448
2015 | .0618164 .0137369 4.50 0.000 .0348912 .0887417
2020 | -.0517848 .0153025 -3.38 0.001 -.0817789 -.0217907
|
separation_n#|
period |
1 1995 | -.0323073 .0981598 -0.33 0.742 -.2247078 .1600931
1 2000 | -.034968 .0915107 -0.38 0.702 -.2143356 .1443997
1 2005 | -.0087807 .090524 -0.10 0.923 -.1862145 .1686531
1 2010 | -.0459934 .0893656 -0.51 0.607 -.2211566 .1291699
1 2015 | -.0301602 .0893182 -0.34 0.736 -.2052304 .14491
1 2020 | .024059 .1024239 0.23 0.814 -.1766994 .2248175
|
_cons | -.0314358 .0128533 -2.45 0.014 -.0566291 -.0062424
------------------------------------------------------------------------------
( 1) 1.separation_n#1995.period = 0
( 2) 1.separation_n#2000.period = 0
( 3) 1.separation_n#2005.period = 0
( 4) 1.separation_n#2010.period = 0
( 5) 1.separation_n#2015.period = 0
( 6) 1.separation_n#2020.period = 0
F( 6, 21640) = 0.19
Prob > F = 0.9799
Chow Test for separation_n: F-statistic = .18935317
p-value = .97991895
Conditional marginal effects Number of obs = 158,235
Model VCE: Robust
Expression: Linear prediction, predict()
dy/dx wrt: 1.separation_n
------------------------------------------------------------------------------
| Delta-method
| dy/dx std. err. t P>|t| [95% conf. interval]
-------------+----------------------------------------------------------------
0.separati~n | (base outcome)
-------------+----------------------------------------------------------------
1.separati~n |
period |
1990 | -.2154436 .0787505 -2.74 0.006 -.3698004 -.0610868
1995 | -.2477509 .0587025 -4.22 0.000 -.3628121 -.1326897
2000 | -.2504115 .0457402 -5.47 0.000 -.3400657 -.1607573
2005 | -.2242243 .0442187 -5.07 0.000 -.3108962 -.1375524
2010 | -.2614369 .0428591 -6.10 0.000 -.3454439 -.17743
2015 | -.2456038 .0423023 -5.81 0.000 -.3285193 -.1626882
2020 | -.1913845 .0655011 -2.92 0.003 -.3197716 -.0629975
------------------------------------------------------------------------------
Note: dy/dx for factor levels is the discrete change from the base level.
Variables that uniquely identify margins: period
(126,911 observations deleted)
Processing event: unemployed_n
1990 1995 2000 2005 2010 2015 2020
Linear regression Number of obs = 466,281
F(13, 62453) = 112.79
Prob > F = 0.0000
R-squared = 0.0028
Root MSE = 1.5799
(Std. err. adjusted for 62,454 clusters in pid)
------------------------------------------------------------------------------
| Robust
d_lifesat | Coefficient std. err. t P>|t| [95% conf. interval]
-------------+----------------------------------------------------------------
1.unemploy~n | -.4512095 .0521007 -8.66 0.000 -.5533271 -.349092
|
period |
1995 | .0035625 .0078179 0.46 0.649 -.0117607 .0188856
2000 | -.0969359 .0064718 -14.98 0.000 -.1096208 -.0842511
2005 | -.0039737 .0064303 -0.62 0.537 -.016577 .0086297
2010 | -.0077409 .0064549 -1.20 0.230 -.0203925 .0049107
2015 | .0284684 .0062686 4.54 0.000 .016182 .0407548
2020 | -.0894458 .0078827 -11.35 0.000 -.1048958 -.0739957
|
unemployed_n#|
period |
1 1995 | -.0898311 .0713225 -1.26 0.208 -.2296234 .0499612
1 2000 | -.0863151 .0669166 -1.29 0.197 -.2174718 .0448416
1 2005 | .024465 .0705342 0.35 0.729 -.1137822 .1627121
1 2010 | .0960771 .068726 1.40 0.162 -.0386261 .2307803
1 2015 | .2245257 .0705603 3.18 0.001 .0862274 .362824
1 2020 | .2812839 .0901226 3.12 0.002 .1046435 .4579243
|
_cons | -.0004601 .0053537 -0.09 0.932 -.0109534 .0100333
------------------------------------------------------------------------------
( 1) 1.unemployed_n#1995.period = 0
( 2) 1.unemployed_n#2000.period = 0
( 3) 1.unemployed_n#2005.period = 0
( 4) 1.unemployed_n#2010.period = 0
( 5) 1.unemployed_n#2015.period = 0
( 6) 1.unemployed_n#2020.period = 0
F( 6, 62453) = 7.15
Prob > F = 0.0000
Chow Test for unemployed_n: F-statistic = 7.1500201
p-value = 1.228e-07
Conditional marginal effects Number of obs = 466,281
Model VCE: Robust
Expression: Linear prediction, predict()
dy/dx wrt: 1.unemployed_n
------------------------------------------------------------------------------
| Delta-method
| dy/dx std. err. t P>|t| [95% conf. interval]
-------------+----------------------------------------------------------------
0.unemploy~n | (base outcome)
-------------+----------------------------------------------------------------
1.unemploy~n |
period |
1990 | -.4512095 .0521007 -8.66 0.000 -.5533271 -.349092
1995 | -.5410407 .0496802 -10.89 0.000 -.638414 -.4436673
2000 | -.5375246 .0425188 -12.64 0.000 -.6208616 -.4541877
2005 | -.4267446 .0476386 -8.96 0.000 -.5201164 -.3333728
2010 | -.3551324 .0447734 -7.93 0.000 -.4428885 -.2673764
2015 | -.2266838 .047636 -4.76 0.000 -.3200505 -.1333172
2020 | -.1699256 .0736773 -2.31 0.021 -.3143333 -.0255179
------------------------------------------------------------------------------
Note: dy/dx for factor levels is the discrete change from the base level.
Variables that uniquely identify margins: period
(128,371 observations deleted)
Processing event: partner_died_n
1990 1995 2000 2005 2010 2015 2020
Linear regression Number of obs = 480,075
F(13, 62505) = 90.30
Prob > F = 0.0000
R-squared = 0.0020
Root MSE = 1.5605
(Std. err. adjusted for 62,506 clusters in pid)
------------------------------------------------------------------------------
| Robust
d_lifesat | Coefficient std. err. t P>|t| [95% conf. interval]
-------------+----------------------------------------------------------------
1.partner_~n | -.5859408 .1804029 -3.25 0.001 -.9395308 -.2323508
|
period |
1995 | .0028845 .0074923 0.38 0.700 -.0118004 .0175694
2000 | -.0925613 .006227 -14.86 0.000 -.1047662 -.0803564
2005 | -.002569 .0061311 -0.42 0.675 -.0145859 .0094479
2010 | .0009427 .0061627 0.15 0.878 -.0111363 .0130216
2015 | .0421069 .0059769 7.04 0.000 .0303922 .0538215
2020 | -.0652516 .0075878 -8.60 0.000 -.0801236 -.0503795
|
partner_di~n#|
period |
1 1995 | -.0790644 .233973 -0.34 0.735 -.5376519 .3795232
1 2000 | -.4562036 .2320928 -1.97 0.049 -.911106 -.0013012
1 2005 | -.1470603 .2213169 -0.66 0.506 -.5808417 .2867212
1 2010 | -.3748004 .2283075 -1.64 0.101 -.8222835 .0726826
1 2015 | -.3103297 .2269725 -1.37 0.172 -.7551962 .1345367
1 2020 | -.1928575 .2528381 -0.76 0.446 -.6884206 .3027056
|
_cons | -.013093 .0051096 -2.56 0.010 -.0231078 -.0030782
------------------------------------------------------------------------------
( 1) 1.partner_died_n#1995.period = 0
( 2) 1.partner_died_n#2000.period = 0
( 3) 1.partner_died_n#2005.period = 0
( 4) 1.partner_died_n#2010.period = 0
( 5) 1.partner_died_n#2015.period = 0
( 6) 1.partner_died_n#2020.period = 0
F( 6, 62505) = 1.16
Prob > F = 0.3264
Chow Test for partner_died_n: F-statistic = 1.1567044
p-value = .32642571
Conditional marginal effects Number of obs = 480,075
Model VCE: Robust
Expression: Linear prediction, predict()
dy/dx wrt: 1.partner_died_n
------------------------------------------------------------------------------
| Delta-method
| dy/dx std. err. t P>|t| [95% conf. interval]
-------------+----------------------------------------------------------------
0.partner_~n | (base outcome)
-------------+----------------------------------------------------------------
1.partner_~n |
period |
1990 | -.5859408 .1804029 -3.25 0.001 -.9395308 -.2323508
1995 | -.6650052 .1495722 -4.45 0.000 -.9581669 -.3718434
2000 | -1.042144 .1460042 -7.14 0.000 -1.328313 -.7559759
2005 | -.7330011 .1271447 -5.77 0.000 -.9822049 -.4837972
2010 | -.9607412 .1398965 -6.87 0.000 -1.234939 -.6865439
2015 | -.8962705 .1377707 -6.51 0.000 -1.166301 -.6262397
2020 | -.7787983 .1768133 -4.40 0.000 -1.125353 -.4322439
------------------------------------------------------------------------------
Note: dy/dx for factor levels is the discrete change from the base level.
Variables that uniquely identify margins: period
(170,900 observations deleted)
Processing event: newpartner_n
1990 1995 2000 2005 2010 2015 2020
Linear regression Number of obs = 130,034
F(13, 13261) = 39.37
Prob > F = 0.0000
R-squared = 0.0034
Root MSE = 1.6381
(Std. err. adjusted for 13,262 clusters in pid)
------------------------------------------------------------------------------
| Robust
d_lifesat | Coefficient std. err. t P>|t| [95% conf. interval]
-------------+----------------------------------------------------------------
1.newpartn~n | .2681379 .0522609 5.13 0.000 .1656991 .3705767
|
period |
1995 | .0137543 .0161719 0.85 0.395 -.017945 .0454536
2000 | -.0790885 .0140932 -5.61 0.000 -.1067133 -.0514638
2005 | .0345758 .0137094 2.52 0.012 .0077035 .0614482
2010 | .0363456 .013855 2.62 0.009 .0091879 .0635033
2015 | .0394649 .0138966 2.84 0.005 .0122256 .0667042
2020 | -.0498355 .0173258 -2.88 0.004 -.0837964 -.0158745
|
newpartner_n#|
period |
1 1995 | .0224678 .0709177 0.32 0.751 -.116541 .1614765
1 2000 | .0005609 .065003 0.01 0.993 -.1268542 .127976
1 2005 | -.0360547 .0643829 -0.56 0.575 -.1622543 .0901449
1 2010 | .0471614 .0652543 0.72 0.470 -.0807463 .1750691
1 2015 | .0343976 .0683887 0.50 0.615 -.099654 .1684492
1 2020 | -.027765 .0866138 -0.32 0.749 -.1975404 .1420104
|
_cons | -.0552434 .0117677 -4.69 0.000 -.0783097 -.0321771
------------------------------------------------------------------------------
( 1) 1.newpartner_n#1995.period = 0
( 2) 1.newpartner_n#2000.period = 0
( 3) 1.newpartner_n#2005.period = 0
( 4) 1.newpartner_n#2010.period = 0
( 5) 1.newpartner_n#2015.period = 0
( 6) 1.newpartner_n#2020.period = 0
F( 6, 13261) = 0.53
Prob > F = 0.7895
Chow Test for newpartner_n: F-statistic = .52537781
p-value = .78949451
Conditional marginal effects Number of obs = 130,034
Model VCE: Robust
Expression: Linear prediction, predict()
dy/dx wrt: 1.newpartner_n
------------------------------------------------------------------------------
| Delta-method
| dy/dx std. err. t P>|t| [95% conf. interval]
-------------+----------------------------------------------------------------
0.newpartn~n | (base outcome)
-------------+----------------------------------------------------------------
1.newpartn~n |
period |
1990 | .2681379 .0522609 5.13 0.000 .1656991 .3705767
1995 | .2906057 .0482873 6.02 0.000 .1959557 .3852556
2000 | .2686988 .0388137 6.92 0.000 .1926184 .3447792
2005 | .2320832 .0376602 6.16 0.000 .1582639 .3059025
2010 | .3152993 .0396053 7.96 0.000 .2376672 .3929314
2015 | .3025355 .0443121 6.83 0.000 .2156775 .3893935
2020 | .2403729 .0691529 3.48 0.001 .1048234 .3759225
------------------------------------------------------------------------------
Note: dy/dx for factor levels is the discrete change from the base level.
Variables that uniquely identify margins: period
(152,204 observations deleted)
Processing event: cohabnew_n
1990 1995 2000 2005 2010 2015 2020
Linear regression Number of obs = 123,427
F(13, 12492) = 36.07
Prob > F = 0.0000
R-squared = 0.0028
Root MSE = 1.6237
(Std. err. adjusted for 12,493 clusters in pid)
------------------------------------------------------------------------------
| Robust
d_lifesat | Coefficient std. err. t P>|t| [95% conf. interval]
-------------+----------------------------------------------------------------
1.cohabnew_n | .301201 .0625741 4.81 0.000 .1785461 .4238558
|
period |
1995 | .023526 .0158066 1.49 0.137 -.0074574 .0545094
2000 | -.0739091 .0135441 -5.46 0.000 -.1004576 -.0473605
2005 | .0415508 .0131636 3.16 0.002 .0157482 .0673534
2010 | .0482369 .0134557 3.58 0.000 .0218616 .0746122
2015 | .0650351 .0132086 4.92 0.000 .0391443 .090926
2020 | -.057879 .0167993 -3.45 0.001 -.0908082 -.0249498
|
cohabnew_n#|
period |
1 1995 | .0205178 .0826619 0.25 0.804 -.1415122 .1825477
1 2000 | .025362 .0802633 0.32 0.752 -.1319665 .1826905
1 2005 | .0253048 .0795145 0.32 0.750 -.1305558 .1811655
1 2010 | -.0231427 .0809751 -0.29 0.775 -.1818664 .135581
1 2015 | -.0976479 .078717 -1.24 0.215 -.2519454 .0566495
1 2020 | -.1945056 .0890179 -2.19 0.029 -.3689944 -.0200168
|
_cons | -.054547 .0112717 -4.84 0.000 -.0766413 -.0324527
------------------------------------------------------------------------------
( 1) 1.cohabnew_n#1995.period = 0
( 2) 1.cohabnew_n#2000.period = 0
( 3) 1.cohabnew_n#2005.period = 0
( 4) 1.cohabnew_n#2010.period = 0
( 5) 1.cohabnew_n#2015.period = 0
( 6) 1.cohabnew_n#2020.period = 0
F( 6, 12492) = 2.06
Prob > F = 0.0540
Chow Test for cohabnew_n: F-statistic = 2.0641088
p-value = .05399913
Conditional marginal effects Number of obs = 123,427
Model VCE: Robust
Expression: Linear prediction, predict()
dy/dx wrt: 1.cohabnew_n
------------------------------------------------------------------------------
| Delta-method
| dy/dx std. err. t P>|t| [95% conf. interval]
-------------+----------------------------------------------------------------
0.cohabnew_n | (base outcome)
-------------+----------------------------------------------------------------
1.cohabnew_n |
period |
1990 | .301201 .0625741 4.81 0.000 .1785461 .4238558
1995 | .3217187 .0553709 5.81 0.000 .2131833 .4302542
2000 | .3265629 .0502909 6.49 0.000 .2279851 .4251408
2005 | .3265058 .0497973 6.56 0.000 .2288955 .4241161
2010 | .2780583 .0517037 5.38 0.000 .1767111 .3794055
2015 | .203553 .0478383 4.26 0.000 .1097825 .2973235
2020 | .1066954 .0625381 1.71 0.088 -.0158889 .2292797
------------------------------------------------------------------------------
Note: dy/dx for factor levels is the discrete change from the base level.
Variables that uniquely identify margins: period
(689,492 missing values generated)
(62,778 real changes made)
(69,127 real changes made)
(115,183 real changes made)
(104,534 real changes made)
(137,789 real changes made)
(130,276 real changes made)
(69,805 real changes made)
Linear regression Number of obs = 581,091
F(3, 71417) = 265.49
Prob > F = 0.0000
R-squared = 0.0016
Root MSE = 1.5976
(Std. err. adjusted for 71,418 clusters in pid)
------------------------------------------------------------------------------
| Robust
d_lifesat | Coefficient std. err. t P>|t| [95% conf. interval]
-------------+----------------------------------------------------------------
1.unemploy~n | -.0313354 .0641921 -0.49 0.625 -.1571518 .094481
unemployme~e | -.0068852 .0004978 -13.83 0.000 -.0078609 -.0059095
|
unemployed_n#|
c. |
unemployme~e |
1 | -.0523879 .0087289 -6.00 0.000 -.0694966 -.0352793
|
_cons | .0193117 .0035694 5.41 0.000 .0123157 .0263076
------------------------------------------------------------------------------
Linear regression Number of obs = 581,091
F(13, 71417) = 129.95
Prob > F = 0.0000
R-squared = 0.0023
Root MSE = 1.5971
(Std. err. adjusted for 71,418 clusters in pid)
------------------------------------------------------------------------------
| Robust
d_lifesat | Coefficient std. err. t P>|t| [95% conf. interval]
-------------+----------------------------------------------------------------
1.unemploy~n | -.4413417 .0518628 -8.51 0.000 -.5429925 -.3396908
|
period |
1995 | .0024988 .0071506 0.35 0.727 -.0115163 .0165139
2000 | -.0955723 .0058866 -16.24 0.000 -.10711 -.0840347
2005 | -.0048327 .0058102 -0.83 0.406 -.0162207 .0065553
2010 | -.0020784 .0058378 -0.36 0.722 -.0135204 .0093637
2015 | .0321681 .005676 5.67 0.000 .0210432 .0432931
2020 | -.0689079 .0070881 -9.72 0.000 -.0828005 -.0550152
|
unemployed_n#|
period |
1 1995 | -.0887675 .071034 -1.25 0.211 -.2279939 .050459
1 2000 | -.0876787 .0666172 -1.32 0.188 -.2182482 .0428908
1 2005 | .025324 .0702327 0.36 0.718 -.112332 .1629799
1 2010 | .0904146 .0684454 1.32 0.187 -.0437382 .2245674
1 2015 | .220826 .0702918 3.14 0.002 .0830543 .3585977
1 2020 | .260746 .0898536 2.90 0.004 .0846331 .4368589
|
_cons | -.0103279 .0049038 -2.11 0.035 -.0199393 -.0007166
------------------------------------------------------------------------------
(689,492 missing values generated)
(103,220 real changes made)
(164,908 real changes made)
(193,916 real changes made)
(227,448 real changes made)
2. local excl_var "`event'_excl"
3.
19. if "`event'" == "partner_died_n" local event_title "Treatment Effect o
> f Partner's Death in Each Period"
20. if "`event'" == "newpartner_n" local event_title "Treatment Effect of
> a New Partnership in Each Period"
21. if "`event'" == "cohabnew_n" local event_title "Treatment Effect of Mo
> ving in with a Partner in Each Period"
22. if "`event'" == "separation_n" local event_title "Treatment Effect of
> Separation in Each Period"
23. //
25. // Save graph instead of displaying in loop
(70,709 observations deleted)
Processing event: separation_n
1990 1998 2006 2014
Linear regression Number of obs = 158,235
F(7, 21640) = 26.43
Prob > F = 0.0000
R-squared = 0.0015
Root MSE = 1.6392
(Std. err. adjusted for 21,641 clusters in pid)
------------------------------------------------------------------------------
| Robust
d_lifesat | Coefficient std. err. t P>|t| [95% conf. interval]
-------------+----------------------------------------------------------------
1.separati~n | -.2226498 .0562389 -3.96 0.000 -.3328821 -.1124175
|
period_8 |
1998 | .0155184 .0112726 1.38 0.169 -.0065767 .0376135
2006 | .0276423 .0099064 2.79 0.005 .0082251 .0470596
2014 | .0202351 .0091284 2.22 0.027 .0023429 .0381274
|
separation_n#|
period_8 |
1 1998 | -.0290472 .0671883 -0.43 0.666 -.1607412 .1026467
1 2006 | -.0144531 .0659578 -0.22 0.827 -.1437351 .114829
1 2014 | -.0245637 .0658545 -0.37 0.709 -.1536434 .1045159
|
_cons | -.0314486 .0084023 -3.74 0.000 -.0479176 -.0149795
------------------------------------------------------------------------------
( 1) 1.separation_n#1998.period_8 = 0
( 2) 1.separation_n#2006.period_8 = 0
( 3) 1.separation_n#2014.period_8 = 0
F( 3, 21640) = 0.08
Prob > F = 0.9722
Chow Test for separation_n: F-statistic = .07749815
p-value = .97217986
Conditional marginal effects Number of obs = 158,235
Model VCE: Robust
Expression: Linear prediction, predict()
dy/dx wrt: 1.separation_n
------------------------------------------------------------------------------
| Delta-method
| dy/dx std. err. t P>|t| [95% conf. interval]
-------------+----------------------------------------------------------------
0.separati~n | (base outcome)
-------------+----------------------------------------------------------------
1.separati~n |
period_8 |
1990 | -.2226498 .0562389 -3.96 0.000 -.3328821 -.1124175
1998 | -.251697 .037086 -6.79 0.000 -.3243883 -.1790058
2006 | -.2371028 .0343152 -6.91 0.000 -.3043631 -.1698426
2014 | -.2472135 .0342643 -7.21 0.000 -.3143741 -.180053
------------------------------------------------------------------------------
Note: dy/dx for factor levels is the discrete change from the base level.
Variables that uniquely identify margins: period_8
(126,911 observations deleted)
Processing event: unemployed_n
1990 1998 2006 2014
Linear regression Number of obs = 466,281
F(7, 62453) = 86.87
Prob > F = 0.0000
R-squared = 0.0020
Root MSE = 1.5805
(Std. err. adjusted for 62,454 clusters in pid)
------------------------------------------------------------------------------
| Robust
d_lifesat | Coefficient std. err. t P>|t| [95% conf. interval]
-------------+----------------------------------------------------------------
1.unemploy~n | -.4844811 .0402007 -12.05 0.000 -.5632745 -.4056877
|
period_8 |
1998 | -.0242254 .0048096 -5.04 0.000 -.0336521 -.0147986
2006 | .0056302 .0044496 1.27 0.206 -.003091 .0143514
2014 | -.0048396 .0042831 -1.13 0.259 -.0132345 .0035553
|
unemployed_n#|
period_8 |
1 1998 | -.0448241 .0525949 -0.85 0.394 -.1479101 .058262
1 2006 | .0825526 .0551955 1.50 0.135 -.0256308 .1907359
1 2014 | .265979 .0545311 4.88 0.000 .1590981 .37286
|
_cons | -.0144872 .0035691 -4.06 0.000 -.0214827 -.0074918
------------------------------------------------------------------------------
( 1) 1.unemployed_n#1998.period_8 = 0
( 2) 1.unemployed_n#2006.period_8 = 0
( 3) 1.unemployed_n#2014.period_8 = 0
F( 3, 62453) = 13.92
Prob > F = 0.0000
Chow Test for unemployed_n: F-statistic = 13.921279
p-value = 4.533e-09
Conditional marginal effects Number of obs = 466,281
Model VCE: Robust
Expression: Linear prediction, predict()
dy/dx wrt: 1.unemployed_n
------------------------------------------------------------------------------
| Delta-method
| dy/dx std. err. t P>|t| [95% conf. interval]
-------------+----------------------------------------------------------------
0.unemploy~n | (base outcome)
-------------+----------------------------------------------------------------
1.unemploy~n |
period_8 |
1990 | -.4844811 .0402007 -12.05 0.000 -.5632745 -.4056877
1998 | -.5293052 .0349488 -15.15 0.000 -.5978049 -.4608054
2006 | -.4019286 .0377789 -10.64 0.000 -.4759752 -.3278819
2014 | -.2185021 .0369327 -5.92 0.000 -.2908902 -.146114
------------------------------------------------------------------------------
Note: dy/dx for factor levels is the discrete change from the base level.
Variables that uniquely identify margins: period_8
(128,371 observations deleted)
Processing event: partner_died_n
1990 1998 2006 2014
Linear regression Number of obs = 480,075
F(7, 62505) = 49.85
Prob > F = 0.0000
R-squared = 0.0013
Root MSE = 1.5611
(Std. err. adjusted for 62,506 clusters in pid)
------------------------------------------------------------------------------
| Robust
d_lifesat | Coefficient std. err. t P>|t| [95% conf. interval]
-------------+----------------------------------------------------------------
1.partner_~n | -.5747657 .1340709 -4.29 0.000 -.8375448 -.3119865
|
period_8 |
1998 | -.0252413 .0046317 -5.45 0.000 -.0343194 -.0161631
2006 | .007727 .0042528 1.82 0.069 -.0006084 .0160625
2014 | .0091963 .0041092 2.24 0.025 .0011422 .0172504
|
partner_di~n#|
period_8 |
1 1998 | -.3855649 .1744798 -2.21 0.027 -.7275456 -.0435841
1 2006 | -.2858383 .1739271 -1.64 0.100 -.6267357 .0550591
1 2014 | -.2734676 .1678085 -1.63 0.103 -.6023725 .0554374
|
_cons | -.0246741 .0034264 -7.20 0.000 -.03139 -.0179583
------------------------------------------------------------------------------
( 1) 1.partner_died_n#1998.period_8 = 0
( 2) 1.partner_died_n#2006.period_8 = 0
( 3) 1.partner_died_n#2014.period_8 = 0
F( 3, 62505) = 1.70
Prob > F = 0.1654
Chow Test for partner_died_n: F-statistic = 1.6963468
p-value = .16540385
Conditional marginal effects Number of obs = 480,075
Model VCE: Robust
Expression: Linear prediction, predict()
dy/dx wrt: 1.partner_died_n
------------------------------------------------------------------------------
| Delta-method
| dy/dx std. err. t P>|t| [95% conf. interval]
-------------+----------------------------------------------------------------
0.partner_~n | (base outcome)
-------------+----------------------------------------------------------------
1.partner_~n |
period_8 |
1990 | -.5747657 .1340709 -4.29 0.000 -.8375448 -.3119865
1998 | -.9603305 .1110093 -8.65 0.000 -1.177909 -.7427521
2006 | -.8606039 .1108439 -7.76 0.000 -1.077858 -.6433497
2014 | -.8482332 .1003859 -8.45 0.000 -1.04499 -.6514766
------------------------------------------------------------------------------
Note: dy/dx for factor levels is the discrete change from the base level.
Variables that uniquely identify margins: period_8
(170,900 observations deleted)
Processing event: newpartner_n
1990 1998 2006 2014
Linear regression Number of obs = 130,034
F(7, 13261) = 40.06
Prob > F = 0.0000
R-squared = 0.0026
Root MSE = 1.6386
(Std. err. adjusted for 13,262 clusters in pid)
------------------------------------------------------------------------------
| Robust
d_lifesat | Coefficient std. err. t P>|t| [95% conf. interval]
-------------+----------------------------------------------------------------
1.newpartn~n | .3129241 .0405508 7.72 0.000 .2334388 .3924094
|
period_8 |
1998 | .0022904 .0099435 0.23 0.818 -.0172004 .0217811
2006 | .0299711 .0090721 3.30 0.001 .0121884 .0477537
2014 | .0252335 .0092095 2.74 0.006 .0071815 .0432855
|
newpartner_n#|
period_8 |
1 1998 | -.0719397 .0511872 -1.41 0.160 -.1722738 .0283944
1 2006 | -.0414135 .050535 -0.82 0.413 -.1404693 .0576423
1 2014 | -.0223335 .0535321 -0.42 0.677 -.127264 .0825971
|
_cons | -.0682432 .0074161 -9.20 0.000 -.0827798 -.0537066
------------------------------------------------------------------------------
( 1) 1.newpartner_n#1998.period_8 = 0
( 2) 1.newpartner_n#2006.period_8 = 0
( 3) 1.newpartner_n#2014.period_8 = 0
F( 3, 13261) = 0.75
Prob > F = 0.5228
Chow Test for newpartner_n: F-statistic = .74893985
p-value = .52280588
Conditional marginal effects Number of obs = 130,034
Model VCE: Robust
Expression: Linear prediction, predict()
dy/dx wrt: 1.newpartner_n
------------------------------------------------------------------------------
| Delta-method
| dy/dx std. err. t P>|t| [95% conf. interval]
-------------+----------------------------------------------------------------
0.newpartn~n | (base outcome)
-------------+----------------------------------------------------------------
1.newpartn~n |
period_8 |
1990 | .3129241 .0405508 7.72 0.000 .2334388 .3924094
1998 | .2409844 .0320746 7.51 0.000 .1781137 .3038551
2006 | .2715106 .0302269 8.98 0.000 .2122615 .3307597
2014 | .2905906 .0351199 8.27 0.000 .2217507 .3594306
------------------------------------------------------------------------------
Note: dy/dx for factor levels is the discrete change from the base level.
Variables that uniquely identify margins: period_8
(152,204 observations deleted)
Processing event: cohabnew_n
1990 1998 2006 2014
Linear regression Number of obs = 123,427
F(7, 12492) = 28.98
Prob > F = 0.0000
R-squared = 0.0019
Root MSE = 1.6244
(Std. err. adjusted for 12,493 clusters in pid)
------------------------------------------------------------------------------
| Robust
d_lifesat | Coefficient std. err. t P>|t| [95% conf. interval]
-------------+----------------------------------------------------------------
1.cohabnew_n | .2972206 .0477812 6.22 0.000 .2035622 .3908791
|
period_8 |
1998 | -.0025797 .0096776 -0.27 0.790 -.0215494 .01639
2006 | .036633 .008813 4.16 0.000 .0193583 .0539078
2014 | .0276894 .0087499 3.16 0.002 .0105383 .0448404
|
cohabnew_n#|
period_8 |
1 1998 | .0451554 .0623838 0.72 0.469 -.0771265 .1674373
1 2006 | -.0146166 .0625553 -0.23 0.815 -.1372346 .1080013
1 2014 | -.1155542 .0600345 -1.92 0.054 -.2332311 .0021227
|
_cons | -.059237 .0071223 -8.32 0.000 -.0731978 -.0452763
------------------------------------------------------------------------------
( 1) 1.cohabnew_n#1998.period_8 = 0
( 2) 1.cohabnew_n#2006.period_8 = 0
( 3) 1.cohabnew_n#2014.period_8 = 0
F( 3, 12492) = 3.15
Prob > F = 0.0240
Chow Test for cohabnew_n: F-statistic = 3.1463176
p-value = .02402461
Conditional marginal effects Number of obs = 123,427
Model VCE: Robust
Expression: Linear prediction, predict()
dy/dx wrt: 1.cohabnew_n
------------------------------------------------------------------------------
| Delta-method
| dy/dx std. err. t P>|t| [95% conf. interval]
-------------+----------------------------------------------------------------
0.cohabnew_n | (base outcome)
-------------+----------------------------------------------------------------
1.cohabnew_n |
period_8 |
1990 | .2972206 .0477812 6.22 0.000 .2035622 .3908791
1998 | .3423761 .0408009 8.39 0.000 .2624 .4223522
2006 | .282604 .0403827 7.00 0.000 .2034477 .3617603
2014 | .1816664 .0364641 4.98 0.000 .1101912 .2531417
------------------------------------------------------------------------------
Note: dy/dx for factor levels is the discrete change from the base level.
Variables that uniquely identify margins: period_8
| separa~n unempl~n partne~n newpar~n cohabn~n
-------------+---------------------------------------------
separation_n | 1.0000
|
|
unemployed_n | 0.0267* 1.0000
| 0.0000
|
partner_di~n | 0.0623* -0.0036* 1.0000
| 0.0000 0.0028
|
newpartner_n | 0.0203* 0.0219* 0.0013 1.0000
| 0.0000 0.0000 0.4825
|
cohabnew_n | 0.0102* 0.0222* -0.0069* 0.0101* 1.0000
| 0.0000 0.0000 0.0003 0.0000
|
2. sum `event'_ever
3. local total_obs = r(N)
4. local never_treated = r(N) - r(sum) // Count of never-treated individ
> uals
5. local prop_never_treated = `never_treated' / `total_obs' * 100
6.
7. }
Variable | Obs Mean Std. dev. Min Max
-------------+---------------------------------------------------------
separ~n_ever | 327,928 .348607 .47653 0 1
Proportion of never-treated individuals for separation_n: 65.139299%
Variable | Obs Mean Std. dev. Min Max
-------------+---------------------------------------------------------
unemp~n_ever | 689,428 .2175688 .4125928 0 1
Proportion of never-treated individuals for unemployed_n: 78.243123%
Variable | Obs Mean Std. dev. Min Max
-------------+---------------------------------------------------------
partn~n_ever | 685,835 .0576115 .2330075 0 1
Proportion of never-treated individuals for partner_died_n: 94.238848%
Variable | Obs Mean Std. dev. Min Max
-------------+---------------------------------------------------------
newpa~n_ever | 338,153 .4302875 .495117 0 1
Proportion of never-treated individuals for newpartner_n: 56.971253%
Variable | Obs Mean Std. dev. Min Max
-------------+---------------------------------------------------------
cohabnew_n~r | 336,968 .3682575 .4823325 0 1
Proportion of never-treated individuals for cohabnew_n: 63.174248%
2. tab `event' period
3. }
separation | period
_n | 1990 1995 2000 2005 2010 | Total
-----------+-------------------------------------------------------+----------
0 | 10,238 12,655 19,283 19,641 67,440 | 250,266
1 | 773 1,385 2,286 2,241 2,668 | 13,470
-----------+-------------------------------------------------------+----------
Total | 11,011 14,040 21,569 21,882 70,108 | 263,736
separation | period
_n | 2015 2020 | Total
-----------+----------------------+----------
0 | 77,158 43,851 | 250,266
1 | 2,744 1,373 | 13,470
-----------+----------------------+----------
Total | 79,902 45,224 | 263,736
unemployed | period
_n | 1990 1995 2000 2005 2010 | Total
-----------+-------------------------------------------------------+----------
0 | 59,912 66,559 112,784 102,610 135,604 | 674,861
1 | 1,715 1,914 2,396 1,922 2,174 | 12,648
-----------+-------------------------------------------------------+----------
Total | 61,627 68,473 115,180 104,532 137,778 | 687,509
unemployed | period
_n | 2015 2020 | Total
-----------+----------------------+----------
0 | 128,437 68,955 | 674,861
1 | 1,814 713 | 12,648
-----------+----------------------+----------
Total | 130,251 69,668 | 687,509
partner_di | period
ed_n | 1990 1995 2000 2005 2010 | Total
-----------+-------------------------------------------------------+----------
0 | 62,536 68,855 114,775 104,107 123,218 | 670,855
1 | 242 272 408 427 392 | 2,384
-----------+-------------------------------------------------------+----------
Total | 62,778 69,127 115,183 104,534 123,610 | 673,239
partner_di | period
ed_n | 2015 2020 | Total
-----------+----------------------+----------
0 | 127,806 69,558 | 670,855
1 | 398 245 | 2,384
-----------+----------------------+----------
Total | 128,204 69,803 | 673,239
newpartner | period
_n | 1990 1995 2000 2005 2010 | Total
-----------+-------------------------------------------------------+----------
0 | 12,259 16,716 24,781 24,863 79,413 | 302,864
1 | 1,741 1,754 2,825 2,790 3,172 | 17,161
-----------+-------------------------------------------------------+----------
Total | 14,000 18,470 27,606 27,653 82,585 | 320,025
newpartner | period
_n | 2015 2020 | Total
-----------+----------------------+----------
0 | 91,615 53,217 | 302,864
1 | 3,398 1,481 | 17,161
-----------+----------------------+----------
Total | 95,013 54,698 | 320,025
| period
cohabnew_n | 1990 1995 2000 2005 2010 | Total
-----------+-------------------------------------------------------+----------
0 | 13,360 16,680 22,869 22,836 74,466 | 283,640
1 | 1,362 1,196 1,600 1,475 1,800 | 10,558
-----------+-------------------------------------------------------+----------
Total | 14,722 17,876 24,469 24,311 76,266 | 294,198
| period
cohabnew_n | 2015 2020 | Total
-----------+----------------------+----------
0 | 85,549 47,880 | 283,640
1 | 1,890 1,235 | 10,558
-----------+----------------------+----------
Total | 87,439 49,115 | 294,198
Total number of life events (==1): 56221
period lifesat
1. 1990 6.95721435546875
2. 1995 6.901616096496582031
3. 2000 7.003602981567382812
4. 2005 6.952503681182861328
5. 2010 7.238335609436035156
6. 2015 7.423738956451416016
7. 2020 7.474206924438476562
# # do "/Users/charlieharrison/Desktop/Dissertation/Final Docs/Analysing_Data.do"
> .do"
Unknown #command