. * nwsaom tutorial 5: testing and comparing effects . * Requires the core nwcommands and the package nwsaom. . . nwwebuse glasgow, nwclear . . * The full model: its coefficient order gives the theta0() order . nwsaom, waves(glasgow1 glasgow2 glasgow3) outdegree reciprocity transtrip egox(alcohol1) altx(alcohol1) simx(alcohol1) > seed(1) ------------------------------------------------------------------------------------------------------------------------- SAOM (Method of Moments, conditional), waves: glasgow1 glasgow2 glasgow3 Actors: 50 Periods: 2 ------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------- glasgow1_to~3 | Coefficient Std. err. z P>|z| [95% conf. interval] --------------+---------------------------------------------------------------- outdegree | -2.704605 .1132713 -23.88 0.000 -2.926613 -2.482598 reciprocity | 2.42243 .1930407 12.55 0.000 2.044077 2.800782 altx_alcohol1 | -.0519366 .0711545 -0.73 0.465 -.1913969 .0875238 egox_alcohol1 | .0463259 .0742919 0.62 0.533 -.0992835 .1919354 transtrip | .6295243 .0734725 8.57 0.000 .4855209 .7735277 simx_alcohol1 | .628046 .3094458 2.03 0.042 .0215433 1.234549 ------------------------------------------------------------------------------------------------------------------------- Rate parameters (estimated, one per inter-wave period): | period1 period2 -------------+--------------------- rate | 6.6271 5.2678 se | 1.1235 0.8810 Overall maximum convergence ratio: 0.096 (criterion: below 0.25; met) Convergence t-ratios (criterion: all below 0.1 in absolute value): met . matrix b = e(b) . matrix list b b[1,6] outdegree reciprocity altx_alcoh~1 egox_alcoh~1 transtrip simx_alcoh~1 y1 -2.7046054 2.4224296 -.05193656 .04632593 .62952427 .62804597 . . * Restricted model: the three alcohol effects held at zero . matrix b0 = b . foreach c in egox_alcohol1 altx_alcohol1 simx_alcohol1 { 2. matrix b0[1, colnumb(b0, "`c'")] = 0 3. } . local th . forvalues j = 1/`=colsof(b0)' { 2. local th `th' `=b0[1,`j']' 3. } . nwsaom, waves(glasgow1 glasgow2 glasgow3) outdegree reciprocity transtrip egox(alcohol1) altx(alcohol1) simx(alcohol1) > theta0(`th') fix(egox(alcohol1) altx(alcohol1) simx(alcohol1)) seed(1) ------------------------------------------------------------------------------------------------------------------------- SAOM (Method of Moments, conditional), waves: glasgow1 glasgow2 glasgow3 Actors: 50 Periods: 2 ------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------- glasgow1_to~3 | Coefficient Std. err. z P>|z| [95% conf. interval] --------------+---------------------------------------------------------------- outdegree | -2.679504 .1231556 -21.76 0.000 -2.920885 -2.438124 reciprocity | 2.456962 .1990359 12.34 0.000 2.066859 2.847065 altx_alcohol1 | 0 (omitted) egox_alcohol1 | 0 (omitted) transtrip | .6242752 .0814667 7.66 0.000 .4646033 .783947 simx_alcohol1 | 0 (omitted) ------------------------------------------------------------------------------------------------------------------------- Rate parameters (estimated, one per inter-wave period): | period1 period2 -------------+--------------------- rate | 6.4818 5.2182 se | 1.0877 0.8728 Overall maximum convergence ratio: 0.095 (criterion: below 0.25; met) Convergence t-ratios (criterion: all below 0.1 in absolute value): not met for altx_alcohol1 (0.462) simx_alcohol1 (-1.9 > 87) Convergence is good only if both criteria are met. Refit starting from these estimates with theta0(); see nwsaom. . estat score Generalised score-type test of the model restricted by: (1) altx_alcohol1 = 0.0000 (2) egox_alcohol1 = 0.0000 (3) simx_alcohol1 = 0.0000 ------------------------------------------------------------------------------------------------------------------------- Joint test: c = 4.9899 d.f. = 3 p-value = 0.1725 (1) altx_alcohol1 separately: c = 0.2070 d.f. = 1 p-value = 0.6491 one-sided: -0.4550 (2) egox_alcohol1 separately: c = 0.0017 d.f. = 1 p-value = 0.9671 one-sided: 0.0412 (3) simx_alcohol1 separately: c = 4.4401 d.f. = 1 p-value = 0.0351 one-sided: 2.1072 One-step estimates (restricted estimate plus the one-step correction): outdegree -2.6811 reciprocity 2.4278 altx_alcohol1 -0.0427 egox_alcohol1 0.0264 transtrip 0.6133 simx_alcohol1 0.5837 . . * Time heterogeneity and relative importance in the full model . nwsaom, waves(glasgow1 glasgow2 glasgow3) outdegree reciprocity transtrip egox(alcohol1) altx(alcohol1) simx(alcohol1) > seed(1) ------------------------------------------------------------------------------------------------------------------------- SAOM (Method of Moments, conditional), waves: glasgow1 glasgow2 glasgow3 Actors: 50 Periods: 2 ------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------- glasgow1_to~3 | Coefficient Std. err. z P>|z| [95% conf. interval] --------------+---------------------------------------------------------------- outdegree | -2.704605 .1132713 -23.88 0.000 -2.926613 -2.482598 reciprocity | 2.42243 .1930407 12.55 0.000 2.044077 2.800782 altx_alcohol1 | -.0519366 .0711545 -0.73 0.465 -.1913969 .0875238 egox_alcohol1 | .0463259 .0742919 0.62 0.533 -.0992835 .1919354 transtrip | .6295243 .0734725 8.57 0.000 .4855209 .7735277 simx_alcohol1 | .628046 .3094458 2.03 0.042 .0215433 1.234549 ------------------------------------------------------------------------------------------------------------------------- Rate parameters (estimated, one per inter-wave period): | period1 period2 -------------+--------------------- rate | 6.6271 5.2678 se | 1.1235 0.8810 Overall maximum convergence ratio: 0.096 (criterion: below 0.25; met) Convergence t-ratios (criterion: all below 0.1 in absolute value): met . estat timetest Test of time heterogeneity (score-type test; RSiena's sienaTimeTest) ------------------------------------------------------------------------------------------------------------------------- Joint test of all period-specific deviations: c = 8.0217 d.f. = 6 p-value = 0.2365 Test of each effect (is its parameter the same in all periods?) effect c d.f. p-value outdegree 0.017 1 0.8955 reciprocity 0.755 1 0.3848 altx_alcohol1 2.449 1 0.1176 egox_alcohol1 1.631 1 0.2016 transtrip 0.330 1 0.5657 simx_alcohol1 1.292 1 0.2557 Period-specific deviations (one-step estimates) and separate tests effect period deviation c p-value outdegree 2 -0.3116 0.017 0.8955 reciprocity 2 0.7407 0.755 0.3848 altx_alcohol1 2 0.1365 2.449 0.1176 egox_alcohol1 2 0.0821 1.631 0.2016 transtrip 2 0.0519 0.330 0.5657 simx_alcohol1 2 -0.8234 1.292 0.2557 . estat importance Relative importance of effects (RSiena's sienaRI); expected over the actors at the start of each period ------------------------------------------------------------------------------------------------------------------------- effect estimate s.e. sigma semi-std. RI p1 RI p2 outdegree -2.7046 0.1133 0.4384 -1.1857 0.4083 0.4719 reciprocity 2.4224 0.1930 0.2140 0.5184 0.3510 0.2906 altx_alcohol1 -0.0519 0.0712 1.1027 -0.0573 0.0204 0.0193 egox_alcohol1 0.0463 0.0743 0.4948 0.0229 0.0137 0.0128 transtrip 0.6295 0.0735 0.6514 0.4101 0.1577 0.1584 simx_alcohol1 0.6280 0.3094 0.2259 0.1419 0.0489 0.0469 ------------------------------------------------------------------------------------------------------------------------- Certainty R_H of the actors' choices: 0.2765 0.3479 RI: expected relative importance of the effect (shares sum to 1 within a period); semi-std. = estimate x sigma. .