Mary
You may have 1 or more trend in your data .... or 1 or more level shift in
your data or a change in parameters in your data suggesting that older data
my not be relevant. You may have a change in variance suggesting the need to
adjust for non-homogenity.
Furthermore as you suggested you may have a day-of-the-week effect and a
week-of-the-year effect.
Additionally holidays and events may affect your variable of interest (y).
These effects may be contemporaneous, may be lag effects , may be lead
effects.
Additionally the two variables that you suggested may have a
contemporaneoua, lag or lead effects.
To form these kinds of equations you might want to see
http://www.autobox.com. If you have data that you would like analyzed with
these tools send the data and I will try to help.
Regards
Dave r
-----Original Message-----
From: A UK-based worldwide e-mail broadcast system mailing list
[mailto:[log in to unmask]] On Behalf Of Mary Swinson
Sent: Wednesday, August 01, 2007 3:54 PM
To: [log in to unmask]
Subject: query: regression with time series data
Hi there,
I have some daily time series data where my response y at time t
has a strong weekly cycle. In addition I have 2 explanatory variables x1,
x2.
So the columns are y, t, x1, x2. Since I have a weekly cycle I can compute
dummy 0/1 variables for each day to include in the model d1...d7.
I am interested in predicting future values of y and in particular the
affect of x1 and x2 on y.
I fitted the following models:
[1] With an intercept so only use 6 days
y = a + b0*t + b1*x1 + b2*x2 + c1*d1 + ...c6*d6
[2] Without an intercept so use 7 days
y = b0*t + b1*x1 + b2*x2 + c1*d1 + ...c7*d7
I thought these 2 models were equivalent and indeed when I use them both to
predict new values of y they have the same mse. However the R^2 values are
different. Is this due to the differing degrees of freedom?
Any thoughts on which of these 2 models is preferable. I am leaning towards
model [2] as it explicitly gives me an effect for each day of the week and
seems to be easier to interpret.
Are then any alternative models worth trying?
Any comments/thoughts most appreciated.
BTW I am doing my analysis in R.
Best Regards,
Mary.
---------------------------------
Fussy? Opinionated? Impossible to please? Perfect. Join Yahoo!'s user panel
and lay it on us.
|