hello Statalisters,
I am currently using the excellent Ariel Linden's itsa package to compute interrupted time series analyses, on my entire cohort and on several subgroups.
I took advantage of the recent inclusion of GLM within itsa to apply the family function that best fit the series, choosing between gaussian, gamma and negative binomial. Since they will appear in the same table of the article, I always required results in eform, so that they could be comparable in terms of relative variation. And I am requiring all the coefficients that itsa can provide, including the posttrend coefficient.
Now, a reviewer asked to provide also 95% confidence intervals of the estimated coefficients. I am having difficulties in calculating those around the coefficient of the post-intervention trend, because itsa provides the non-exponentiated coefficient for posttrend, even when the option eform is present.
As you see in the end of the code, I can quite easily compute the exponentiated coefficient because I can retrieve _b[_t] and _b[_x_t49] from the stored results. However, I cannot do the same with the 95% CI because I don't see its coefficients in the matrix of stored results.
Can anyone point me to a solution quicker than doing calculations at hand?
Furthermore, I would suggest as an update to itsa to provide all the results in exp form when the eform option is specified, including those of the post-intervention trend. And possibly to correct the headings of the posttrend table, which currently remains "Linear trend" also when a negative binomial funcion is used
thanks!
I am currently using the excellent Ariel Linden's itsa package to compute interrupted time series analyses, on my entire cohort and on several subgroups.
I took advantage of the recent inclusion of GLM within itsa to apply the family function that best fit the series, choosing between gaussian, gamma and negative binomial. Since they will appear in the same table of the article, I always required results in eform, so that they could be comparable in terms of relative variation. And I am requiring all the coefficients that itsa can provide, including the posttrend coefficient.
Now, a reviewer asked to provide also 95% confidence intervals of the estimated coefficients. I am having difficulties in calculating those around the coefficient of the post-intervention trend, because itsa provides the non-exponentiated coefficient for posttrend, even when the option eform is present.
Code:
. itsa ricpaz, single trperiod(49) posttrend replace family(nbinomial) link(log) lag(4) eform
Time variable: month, 1 to 96
Delta: 1 unit
note: _ricpaz has noninteger values
Iteration 0: Log likelihood = -463.75394
Iteration 1: Log likelihood = -463.75136
Iteration 2: Log likelihood = -463.75136
Generalized linear models Number of obs = 96
Optimization : ML Residual df = 92
Scale parameter = 1
Deviance = .6191476732 (1/df) Deviance = .0067299
Pearson = .646802594 (1/df) Pearson = .0070305
Variance function: V(u) = u+(1)u^2 [Neg. Binomial]
Link function : g(u) = ln(u) [Log]
HAC kernel (lags): Newey–West (4)
AIC = 9.74482
Log likelihood = -463.7513565 BIC = -419.3009
------------------------------------------------------------------------------
| HAC
_ricpaz | IRR std. err. z P>|z| [95% conf. interval]
-------------+----------------------------------------------------------------
_t | 1.019932 .0023396 8.60 0.000 1.015357 1.024528
_x49 | .8233198 .0587424 -2.72 0.006 .7158745 .9468916
_x_t49 | .9756744 .0026896 -8.93 0.000 .9704171 .9809603
_cons | 26.27674 1.264258 67.94 0.000 23.91208 28.87523
------------------------------------------------------------------------------
Note: _cons estimates baseline incidence rate.
Postintervention Linear Trend: 49
Treated: _b[_t]+_b[_x_t49]
------------------------------------------------------------------------------
Linear Trend | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
Treated | -.0048906 .0010322 -4.74 0.000 -.0069137 -.0028675
------------------------------------------------------------------------------
.
. display exp(_b[_t] + _b[_x_t49])
.99512137
As you see in the end of the code, I can quite easily compute the exponentiated coefficient because I can retrieve _b[_t] and _b[_x_t49] from the stored results. However, I cannot do the same with the 95% CI because I don't see its coefficients in the matrix of stored results.
Can anyone point me to a solution quicker than doing calculations at hand?
Furthermore, I would suggest as an update to itsa to provide all the results in exp form when the eform option is specified, including those of the post-intervention trend. And possibly to correct the headings of the posttrend table, which currently remains "Linear trend" also when a negative binomial funcion is used
thanks!

Comment