[R] Arimax with intervention dummy and multiple covariates

46 views
Skip to first unread message

Jose Iparraguirre

unread,
Feb 21, 2013, 5:26:45 AM2/21/13
to R-h...@r-project.org
Hi

I'm trying to measure the effect of a policy intervention (Box and Tiao, 1975).
This query has to do with the coding of the model rather than with the particulars of my dataset, so I'm not providing the actual dataset (or a simulated one) in this case, apart from some general description.

The time series are of length n=34 (annual observations between 1977 and 2010). The policy measure was introduced in 2000 and it has been implemented once a year ever since.

The variable of interest (VI) is continuous, and I have four continuous covariates (CO1-CO4), plus the dummy intervention variable (DUM) which is equal to 0 between 1977 and 1999 and equal to 1 since 2000.

I thought of using an ARIMAX model, with the arimax() function in the TSA package to fit the transfer function. I'm interested in modelling the intervention effect as a step function.

I specified the model thus:


a. I've checked the ARIMA properties of each series using the auto.arima() function (from the 'forecast' package) -the VI was found to best fit an ARIMA(0,1,1) model and the first covariate an ARIMA(1,0,0), whereas the other covariates were white noise.



b. To facilitate the specification of the various models (the different model specifications dropped variables or added additional covariates, etc, without changing the general structure of the syntax below), I defined the following design matrix:



> xreg.1 <- model.matrix(~CO1+ CO2+ CO3+ CO4)[,2:5]



c. Following Cryer and Chan (2008, ch. 11, p. 255), I wrote models such as this:



> arimax.1 <- arimax(VI, order=c(0,1,1),

+ xtransf=data.frame(xreg.1,dummy1=DUM),

+ transfer=list(c(1,0),c(0,0),c(0,0),c(0,0),c(0,0)))


d. So, I get estimates for the following coefficients:


ma1; CO1-AR1; CO1-MA0; CO2-MA0; CO3-MA0; CO4-MA0; DUM-MA0

Can you spot any problems with the general modelling approach or in this specification?

Many thanks in advance,

José



José Iparraguirre
Chief Economist
Age UK

T 020 303 31482
E Jose.Ipa...@ageuk.org.uk<mailto:Jose.Ipa...@ageuk.org.uk>
Twitter @jose.iparraguirre@ageuk


Tavis House, 1- 6 Tavistock Square
London, WC1H 9NB
www.ageuk.org.uk<http://www.ageuk.org.uk> | ageukblog.org.uk<http://ageukblog.org.uk/> | @ageuk<http://twitter.com/ageukpa>campaigns

Wrap Up and Run 10k is back!

Also, new for 2013 – 2km intergenerational walks at selected venues. So recruit a buddy, dust off the trainers and beat the winter blues by
signing up now:

http://www.ageuk.org.uk/10k

Milton Keynes | Oxford | Sheffield | Crystal Palace | Exeter | Harewood House, Leeds |
Tatton Park, Cheshire | Southampton | Coventry



Age UK Improving later life

http://www.ageuk.org.uk




-------------------------------
Age UK is a registered charity and company limited by guarantee, (registered charity number 1128267, registered company number 6825798).
Registered office: Tavis House, 1-6 Tavistock Square, London WC1H 9NA.

For the purposes of promoting Age UK Insurance, Age UK is an Appointed Representative of Age UK Enterprises Limited, Age UK is an Introducer
Appointed Representative of JLT Benefit Solutions Limited and Simplyhealth Access for the purposes of introducing potential annuity and health
cash plans customers respectively. Age UK Enterprises Limited, JLT Benefit Solutions Limited and Simplyhealth Access are all authorised and
regulated by the Financial Services Authority.
------------------------------

This email and any files transmitted with it are confide...{{dropped:31}}

Mark Leeds

unread,
Feb 21, 2013, 10:57:58 AM2/21/13
to Jose Iparraguirre, R-h...@r-project.org
Hi: bierens has a paper on modelling beer sales in the netherland ( I'm
pretty sure it's on the net.
if not, I have a copy somewhere I think ) using an ARIMAX. why don't you
take his paper and his data and see if you get the same estimates using R.
That's one way if you'll know if you're doing the steps correctly. I don't
have cryer and chan and I've never used the TSA package so I can't say
anything else.
> ______________________________________________
> R-h...@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
>

[[alternative HTML version deleted]]

Mark Leeds

unread,
Feb 21, 2013, 11:38:28 AM2/21/13
to Paul Bernal, r-h...@r-project.org
to anyone who was mistakenly looking for the armax beer paper using Bierens
as the author. I made a mistake and apologize because the author was
franses and the paper is at the link below:

http://repub.eur.nl/res/pub/2112/eur_franses_MR1.pdf


On Thu, Feb 21, 2013 at 11:23 AM, Paul Bernal <paulbe...@gmail.com>wrote:

> Thank you very much my friend.
> El 21/02/2013 11:21, "Mark Leeds" <markl...@gmail.com> escribió:
>
>> let me look. I have hardcopy so hopefully I have computer copy. get back
>> in a few minutes.
>>
>>
>> On Thu, Feb 21, 2013 at 11:06 AM, Paul Bernal <paulbe...@gmail.com>wrote:
>>
>>> Could you please provide me with a copy of that text?
>>>
>>> Best regards,
>>>
>>> Paul

Jose Iparraguirre

unread,
Feb 21, 2013, 11:48:31 AM2/21/13
to Mark Leeds, Paul Bernal, r-h...@r-project.org
Thanks Mark.

I had looked up "herman bierens beer netherlands" but nothing came up, except the paper by Philip Hans Franses which I didn't know so I'll have a look at it. Thanks for letting others note about this.
I had toyed with the idea of contacting the authors of the TSA package directly rather than posting the query on the list, but I preferred to cast the net wide even though the topic in question is very specific. They may even be reading these lines...

Best,

José
>>>> > Also, new for 2013 - 2km intergenerational walks at selected venues.
This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are
addressed. If you receive a message in error, please advise the sender and delete immediately.

Except where this email is sent in the usual course of our business, any opinions expressed in this email are those of the author and do not
necessarily reflect the opinions of Age UK or its subsidiaries and associated companies. Age UK monitors all e-mail transmissions passing
through its network and may block or modify mails which are deemed to be unsuitable.

Age Concern England (charity number 261794) and Help the Aged (charity number 272786) and their trading and other associated companies merged
on 1st April 2009. Together they have formed the Age UK Group, dedicated to improving the lives of people in later life. The three national
Age Concerns in Scotland, Northern Ireland and Wales have also merged with Help the Aged in these nations to form three registered charities:
Age Scotland, Age NI, Age Cymru.
Reply all
Reply to author
Forward
0 new messages