0% found this document useful (0 votes)
183 views40 pages

Intervention Time-Series Model Using Transfer Functions: Xingwu Zhou & Nicola Orsini

The document presents a Stata command called tstf to estimate intervention time series models using transfer functions. It describes how the command can be used to analyze the longitudinal effects of interventions on a population level. As an example, it examines data on calling rates to the Swedish National Tobacco Quitline over time and how they were impacted by campaigns encouraging smoking cessation.

Uploaded by

geegeegeegee
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
183 views40 pages

Intervention Time-Series Model Using Transfer Functions: Xingwu Zhou & Nicola Orsini

The document presents a Stata command called tstf to estimate intervention time series models using transfer functions. It describes how the command can be used to analyze the longitudinal effects of interventions on a population level. As an example, it examines data on calling rates to the Swedish National Tobacco Quitline over time and how they were impacted by campaigns encouraging smoking cessation.

Uploaded by

geegeegeegee
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 40

Intervention time-series model using

transfer functions

Xingwu Zhou & Nicola Orsini


Biostatistics team, Department of Public Health Sciences

Sept 1, 2017
Introduction Models and algorithm The tstf command Summary and future work

Introduction

I I will present a Stata command tstf to estimate the intervention time


series with transfer functions.

I The method has been described by Box and Tiao (1975, JASA).

I Estimation, inference, and graphs will be given for both the original data
and the log-transformed data.

I The method will be illustrated using the Swedish National Tobacco


Quitline (SRL)

Xingwu Zhou (PHS-KI) Nordic and Baltic Stata Users Meeting-17


2
Introduction Models and algorithm The tstf command Summary and future work

Why time series design?

Xingwu Zhou (PHS-KI) Nordic and Baltic Stata Users Meeting-17


3
Introduction Models and algorithm The tstf command Summary and future work

Why time series design?

I RCT: Randomized controlled trials are considered the ideal approach for
assessing the effectiveness of interventions.

Xingwu Zhou (PHS-KI) Nordic and Baltic Stata Users Meeting-17


3
Introduction Models and algorithm The tstf command Summary and future work

Why time series design?

I RCT: Randomized controlled trials are considered the ideal approach for
assessing the effectiveness of interventions.

I Time series analysis is a quasi-experimental design useful to evaluate the


longitudinal effects of interventions on a population level.

Xingwu Zhou (PHS-KI) Nordic and Baltic Stata Users Meeting-17


3
Introduction Models and algorithm The tstf command Summary and future work

Why time series design?

I RCT: Randomized controlled trials are considered the ideal approach for
assessing the effectiveness of interventions.

I Time series analysis is a quasi-experimental design useful to evaluate the


longitudinal effects of interventions on a population level.

I Intervention time series analysis is widely used in areas like finance,


economics, labor markets, transportation, public health and so on .

Xingwu Zhou (PHS-KI) Nordic and Baltic Stata Users Meeting-17


3
Introduction Models and algorithm The tstf command Summary and future work

SRL

The Swedish National Tobacco Quitline (SRL) established in 1998 is a


nationwide, free service, providing telephone counseling for tobacco users who
want to quit the habit.
Xingwu Zhou (PHS-KI) Nordic and Baltic Stata Users Meeting-17
4
Introduction Models and algorithm The tstf command Summary and future work

SRL continue

According to Swedish proposition 2015/16:82, started from May 2016, new


cigarette packages sold in Sweden will have to display pictorial warnings
together with text warnings and the SRL telephone number.
Xingwu Zhou (PHS-KI) Nordic and Baltic Stata Users Meeting-17
5
Introduction Models and algorithm The tstf command Summary and future work

SRL, Calling per 100,000 smokers

Calling rate per 100,000 smokers 150

120

90

60

30

0
7

7
m

m
12

13

13

14

14

15

15

16

16

17

17
20

20

20

20

20

20

20

20

20

20

20
Calendar time

Xingwu Zhou (PHS-KI) Nordic and Baltic Stata Users Meeting-17


6
Introduction Models and algorithm The tstf command Summary and future work

SRL continue

I There is a need to understand how this new policy will affect the
care-seeking behavior of Swedish tobacco users.

Xingwu Zhou (PHS-KI) Nordic and Baltic Stata Users Meeting-17


7
Introduction Models and algorithm The tstf command Summary and future work

SRL continue

I There is a need to understand how this new policy will affect the
care-seeking behavior of Swedish tobacco users.

I To which extent this measure has been effective in inducing a behavioral


change among Swedish tobacco users is not known.

Xingwu Zhou (PHS-KI) Nordic and Baltic Stata Users Meeting-17


7
Introduction Models and algorithm The tstf command Summary and future work

SRL continue

I There is a need to understand how this new policy will affect the
care-seeking behavior of Swedish tobacco users.

I To which extent this measure has been effective in inducing a behavioral


change among Swedish tobacco users is not known.

I A change in the inflow of calls received at the quitline may be used as an


estimator of the population impact of policy measures.

Xingwu Zhou (PHS-KI) Nordic and Baltic Stata Users Meeting-17


7
Introduction Models and algorithm The tstf command Summary and future work

What already have in Stata?

Stata package itsa analyses interrupted time series using segmented regression.

Yt = β0 + β1 T + β2 Xt + β3 XTt (1)

β0 represents the baseline level at T = 0,


β1 is interpreted as the change in outcome associated with a time unit increase
β2 is the level change following the intervention
β3 indicates the slope change following the intervention.

shortcomings: hard to reduce the auto-correlation among the residuals.

Xingwu Zhou (PHS-KI) Nordic and Baltic Stata Users Meeting-17


8
Introduction Models and algorithm The tstf command Summary and future work

Intervention time series

The intervention time series model (Box and Tiao, 1975, JASA) can be
expressed as:
Yt = Mt + Xt , (2)

where Yt represents the monthly (log) calling rate per 100,000 smokers;

Xingwu Zhou (PHS-KI) Nordic and Baltic Stata Users Meeting-17


9
Introduction Models and algorithm The tstf command Summary and future work

Intervention time series

The intervention time series model (Box and Tiao, 1975, JASA) can be
expressed as:
Yt = Mt + Xt , (2)

where Yt represents the monthly (log) calling rate per 100,000 smokers;

Xt is a seasonal Box and Jenkin’s ARIMA (p, d, q)(P, D, Q) model which


represents the baseline or background monthly (log) calling rate per 100,000
smokers throughout the selected interval of time;

Xingwu Zhou (PHS-KI) Nordic and Baltic Stata Users Meeting-17


9
Introduction Models and algorithm The tstf command Summary and future work

Time series background

A Box and Jenkin’s ARIMA (p, d, q) model can be written as

φp (B)(1 − B)d Xt = θq (B)t , (3)

where B is the back-shift operator such that BXt = Xt−1 , d is the number of
trend differences, φp (B) and θq (B) are the polynomials in B of order p and q
Pp Pq
separately, that is φp (B) = 1 + i=1 φi B i , θq (B) = 1 − j=1 θj B j . If we
consider seasonality, Model (3) can be modified as

φp (B)ΦP (B s )(1 − B)d (1 − B s )D Xt = θq (B)ΘQ (B s )t , (4)

where D is the number of seasonal differences, s is the seasonal period, and


ΦP (B s ) and ΘQ (B s ) are polynomials in B s of order P and Q, respectively.

Xingwu Zhou (PHS-KI) Nordic and Baltic Stata Users Meeting-17


10
Introduction Models and algorithm The tstf command Summary and future work

Transfer function
Two types of interventions: step and pulse interventions (Box and Tiao, 1975)

Xingwu Zhou (PHS-KI) Nordic and Baltic Stata Users Meeting-17


11
Introduction Models and algorithm The tstf command Summary and future work

Transfer function: continue


Mt represents the additive change in the log calling rate due to the
intervention. In other words Mt is the log rate ratio at certain time t.

Mt is a transfer function of intervention (or dummy) variable It ,


(
1 if t >= T0 ,
It =
0 otherwise .

Xingwu Zhou (PHS-KI) Nordic and Baltic Stata Users Meeting-17


12
Introduction Models and algorithm The tstf command Summary and future work

Transfer function: continue


Mt represents the additive change in the log calling rate due to the
intervention. In other words Mt is the log rate ratio at certain time t.

Mt is a transfer function of intervention (or dummy) variable It ,


(
1 if t >= T0 ,
It =
0 otherwise .

A flexible yet parsimonious form of Mt could be a ”first order” dynamic process


of It , e.g., Mt = δMt−1 + ωIt . The value of the transfer function Mt is as
following:
ω(1−δ k+1 )
(
1−δ
if k >= 0,
Mt =
0 otherwise ,

Xingwu Zhou (PHS-KI) Nordic and Baltic Stata Users Meeting-17


12
Introduction Models and algorithm The tstf command Summary and future work

Transfer function: continue

Compared to the calling rates that would have been observed in the absence of
intervention, the relative change in the calling rate k months after intervention
is a non-linear function of two parameters (ω, δ)
( k+1
exp(ω( 1−δ
1−δ
)) if k ≥ 0
RRk =
1 otherwise

Xingwu Zhou (PHS-KI) Nordic and Baltic Stata Users Meeting-17


13
Introduction Models and algorithm The tstf command Summary and future work

Transfer function: continue

The limits of the function are


RR(ω, δ, k → 0) = exp(ω) ”immediate” intervention effect occurring exactly
the intervention month;

Xingwu Zhou (PHS-KI) Nordic and Baltic Stata Users Meeting-17


14
Introduction Models and algorithm The tstf command Summary and future work

Transfer function: continue

The limits of the function are


RR(ω, δ, k → 0) = exp(ω) ”immediate” intervention effect occurring exactly
the intervention month;

ω
RR(ω, δ, k → large) = exp( 1−δ ) ”permanent or long term” effect after k
months;

Xingwu Zhou (PHS-KI) Nordic and Baltic Stata Users Meeting-17


14
Introduction Models and algorithm The tstf command Summary and future work

Transfer function: continue

The limits of the function are


RR(ω, δ, k → 0) = exp(ω) ”immediate” intervention effect occurring exactly
the intervention month;

ω
RR(ω, δ, k → large) = exp( 1−δ ) ”permanent or long term” effect after k
months;

The parameter δ provides information about how quickly the rate ratio
converges toward its long-term value. The cloest δ to 0, the quickest is the
convergence.

Xingwu Zhou (PHS-KI) Nordic and Baltic Stata Users Meeting-17


14
Introduction Models and algorithm The tstf command Summary and future work

Transfer function: continue


(1) No intervention effect:
If ω = 0 the RRk = 1 regardless of the magnitude and sign of δ

(2) Immediate (either positive or negative) and no further effect over time:
If δ = 0 the RRk = exp(ω)

Xingwu Zhou (PHS-KI) Nordic and Baltic Stata Users Meeting-17


15
Introduction Models and algorithm The tstf command Summary and future work

Transfer function: continue


(3) Immediate positive effect plus a smooth and gradual increasing effect over
time or an oscillating effect over time

Xingwu Zhou (PHS-KI) Nordic and Baltic Stata Users Meeting-17


16
Introduction Models and algorithm The tstf command Summary and future work

Algorithm
Let θ = (θ10 , θ20 )0 , θ1 includes the parameters from the transfer function such
that θ1 = (δ, ω)0 ; and θ2 includes the parameters coming from the time series
models.

(1) Create the likelihood function in Mata


(a) Use θ1 to calculate mt , where mt = δ ∗ mt−1 + ω ∗ It ;
(b) Update yt∗ = yt − mt ;
(c) Use θ2 and yt∗ to calculate the likelihood, by calling Stata arima
command
(d) Return the likelihood
(2) Maximize the likelihood function using Mata optimize()
(i) Use the BFGS algorithm
(3) Inference on the intervention effects
(i) Delta method using nlcom
(4) Tabulate the estimated results, plot the graphs and so on
Xingwu Zhou (PHS-KI) Nordic and Baltic Stata Users Meeting-17
17
Introduction Models and algorithm The tstf command Summary and future work

Syntax

// Simple step function


tstf lograte after

Xingwu Zhou (PHS-KI) Nordic and Baltic Stata Users Meeting-17


18
Introduction Models and algorithm The tstf command Summary and future work

Syntax

// Simple step function


tstf lograte after

// Controlling the ARIMA and transfer parameters


tstf lograte after , arima(1,0,1) sarima(0,1,0,12) t(1,0)

Xingwu Zhou (PHS-KI) Nordic and Baltic Stata Users Meeting-17


18
Introduction Models and algorithm The tstf command Summary and future work

Syntax

// Simple step function


tstf lograte after

// Controlling the ARIMA and transfer parameters


tstf lograte after , arima(1,0,1) sarima(0,1,0,12) t(1,0)

// Graphs and tabulated


tstf lograte after , arima (1 ,0 ,1) sarima (0 ,1 ,0 ,12) t (1 ,0) method ( ML ) ///
greffect gredate tabulate

Xingwu Zhou (PHS-KI) Nordic and Baltic Stata Users Meeting-17


18
Introduction Models and algorithm The tstf command Summary and future work

Syntax

// Simple step function


tstf lograte after

// Controlling the ARIMA and transfer parameters


tstf lograte after , arima(1,0,1) sarima(0,1,0,12) t(1,0)

// Graphs and tabulated


tstf lograte after , arima (1 ,0 ,1) sarima (0 ,1 ,0 ,12) t (1 ,0) method ( ML ) ///
greffect gredate tabulate

// Graphs and tabulated , exponentitation


tstf lograte after , arima (1 ,0 ,1) sarima (0 ,1 ,0 , 12) t (1 ,0) method ( ML ) ///
gre grd eform tabulate

Xingwu Zhou (PHS-KI) Nordic and Baltic Stata Users Meeting-17


18
Introduction Models and algorithm The tstf command Summary and future work

Steps when using tstf command

I Choose the orders of the (seasonal) ARIMA background through the


pre-intervention time points;

I Choose an intervention model;

I Estimate the model through ML and get the common dynamic effect of
the intervention;

I Inference on the effect k-months after each intervention.

Xingwu Zhou (PHS-KI) Nordic and Baltic Stata Users Meeting-17


19
Introduction Models and algorithm The tstf command Summary and future work

Data: Calling rate per 100,000 smokers


150
Calling rate per 100,000 smokers

120

90

60

30

0
7

7
m

m
12

13

13

14

14

15

15

16

16

17

17
20

20

20

20

20

20

20

20

20

20

20
Calendar time

Larger pictorial warnings on cigarette packs (May 2016)


Xingwu Zhou (PHS-KI) Nordic and Baltic Stata Users Meeting-17
20
Introduction Models and algorithm The tstf command Summary and future work

Output

// Simple step function


tstf lograte after

ARIMA regression with a transfer function No . of obs = 67


Optimization = CSS - ML
Log likelihood = 26.707402
Sample = 2012 m2 - 2017 m8 Intervention starts = 2016 m5
------------------------------------------------------------------------------
lograte | Coef . Std . Err . z P >| z | [95% Conf . Interval ]
- - - - - - - - - - - - -+ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ARIMA |
ar1 | .499028 .1063989 4.69 0.000 .2904899 .7075661
_cons | 4.307029 .0438631 98.19 0.000 4.221059 4.392999
- - - - - - - - - - - - -+ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TRANSFER |
omega | .0429717 .0866812 0.50 0.620 -.1269204 .2128638
------------------------------------------------------------------------------

Xingwu Zhou (PHS-KI) Nordic and Baltic Stata Users Meeting-17


21
Introduction Models and algorithm The tstf command Summary and future work

Output
// Controlling the ARIMA and transfer parameters
tstf lograte after , arima (1 ,0 ,1) sarima (0 ,1 ,0 ,12) t (1 ,0) ///
method ( ML ) gre grd eform tabulate

ARIMA regression with a transfer function No . of obs = 67


Optimization = ML
Log likelihood = 42.170879
Sample = 2012 m2 - 2017 m8 Intervention starts = 2016 m5
------------------------------------------------------------------------------
lograte | Coef . Std . Err . z P >| z | [95% Conf . Interval ]
- - - - - - - - - - - - -+ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ARIMA |
ar1 | .8558569 .1183034 7.23 0.000 .6239865 1.087727
ma1 | -.5901846 .1807572 -3.27 0.001 -.9444622 -.2359069
- - - - - - - - - - - - -+ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TRANSFER |
delta | .9054777 .0727619 12.44 0.000 .762867 1.048088
omega | .0472376 .0212599 2.22 0.026 .005569 .0889062
------------------------------------------------------------------------------

Xingwu Zhou (PHS-KI) Nordic and Baltic Stata Users Meeting-17


22
Introduction Models and algorithm The tstf command Summary and future work

Output, continue
// tabulate the confidence intervals
tstf lograte after , arima (3 ,1 ,2) sarima (1 ,0 ,0 ,12) t (1 ,0) ///
method ( ML ) eform tabulate

Table of effects k units of time after intervention

time k exp ( Eff ) LB UB P - value


2016 m5 0 1.05 1.01 1.09 0.026
2016 m6 1 1.09 1.02 1.18 0.017
2016 m7 2 1.14 1.03 1.26 0.011
2016 m8 3 1.18 1.05 1.32 0.006
2016 m9 4 1.22 1.07 1.39 0.003
2016 m10 5 1.25 1.09 1.44 0.002
2016 m11 6 1.28 1.11 1.49 0.001
2016 m12 7 1.32 1.13 1.54 0.001
2017 m1 8 1.34 1.14 1.58 0.000
2017 m2 9 1.37 1.16 1.62 0.000
2017 m3 10 1.39 1.17 1.65 0.000
2017 m4 11 1.42 1.19 1.69 0.000
2017 m5 12 1.44 1.19 1.73 0.000
2017 m6 13 1.46 1.20 1.76 0.000
2017 m7 14 1.47 1.20 1.80 0.000

Xingwu Zhou (PHS-KI) Nordic and Baltic Stata Users Meeting-17


23
Introduction Models and algorithm The tstf command Summary and future work

Output, continue
// graphs
tstf lograte after , arima (3 ,1 ,2) sarima (1 ,0 ,0 ,12) t (1 ,0) ///
method ( ML ) gre grd eform tabulate

110 1.50

100 1.45
1.40
90
1.35
80
1.30
exp(lograte)

exp(Effect)
70 1.25

1.20
60
1.15

50 1.10

1.05

40 1.00
2012m1 2014m1 2016m1 2018m1 2012m1 2014m1 2016m1 2018m1
time time

The calling rate gradually and significantly (p-value < 0.001) increased after
the introduction of the larger pictorial warnings on the cigarette packs.
Xingwu Zhou (PHS-KI) Nordic and Baltic Stata Users Meeting-17
24
Introduction Models and algorithm The tstf command Summary and future work

Summary

I We are working on a Stata package tstf to estimate intervention time


series model with transfer functions

I We focus on the transfer functions with two parameters (shape and scale
parameter), the background is a seasonal time series model

I Estimation, inference, and graphs are given for both the original data and
the log-transformed data

Xingwu Zhou (PHS-KI) Nordic and Baltic Stata Users Meeting-17


25
Introduction Models and algorithm The tstf command Summary and future work

Future work

I Keep on working the tstf package for multiple interventions

I Power calculations

I Time-vary confounders

Xingwu Zhou (PHS-KI) Nordic and Baltic Stata Users Meeting-17


26
Introduction Models and algorithm The tstf command Summary and future work

Team members

XingWu Zhou, Postdoc Biostatistics, Karolinska Institutet

Alessio Crippa, PhD student Biostatistics, Karolinska Institutet

Rosaria Galanti, Professor Epidemiology, Centre of Epidemiology and


Community Medicine

Nicola Orsini, Associate Professor Medical Statistics, Karolinska Institutet

Xingwu Zhou (PHS-KI) Nordic and Baltic Stata Users Meeting-17


27
Introduction Models and algorithm The tstf command Summary and future work

References

(1) Box, G.E. P., Tiao G. C. Intervention analysis with applications to


economic and environmental problems. Journal of the American Statistical
Association. 1975. 70(349), 70-79.

(2) Shadish, W. R., Cook, T. D., & Campbell, D. T. Experimental and


quasi-experimental designs for generalized causal inference. 2002. Belmont,
CA: Wadsworth Cengage Learning.

Xingwu Zhou (PHS-KI) Nordic and Baltic Stata Users Meeting-17


28

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy