Thank your for your answer. I try to perform the Chow test with the formula as you suggest and it works. Nevertheless, I would like to ask additional questions please :
The first one is related to the early one that I have asked to my first message:
When I try to perform another structural change tests, in particular those ones which are based on the Fstats , I write the following code:
fsaveF <- Fstats(reg1, from = 7, to = 22, data = data1)
sctest(fsaveF, type = "aveF")
which give me the following results :
aveF test
data: fsaveF
ave.F = 55.15, p-value = 4.329e-15
But when I try the same test with sctest(reg1 , type = "aveF", data = data), this does not work although reg1 is already known. When I replace reg1 by a ~ b + c + d the test works.
When should I use the fitted model rather than the formula in a structural change test and vis versa ? I precise that in my case reg1 correspond to a ~ b + c + d.
Second question:
The structural change tests based on the generalized fluctuation test framework that I have performed (Rec-CUSUM and Rec-MOSUM) give me an opposite results (No structural change) with regard to F test framework (there is a structural change). How to deal with this contradiction?
Third question:
Since I have autocorrelation in my regression, should I perform structural change test before or after correcting for autocorrelation?
Many thanks
--- En date de : Dim 17.5.09, Achim Zeileis a écrit :
De: Achim Zeileis
Objet: Re: [R] Chow test(1960)/Structural change test
À: "Axel Leroix"
Cc: r-help@r-project.org
Date: Dimanche 17 Mai 2009, 23h22
On Sun, 17 May 2009, Axel Leroix wrote:
> Hi,
>
> A question on something which normally should be easy !
>
> I perform a linear regression using lm function:
>
>> reg1 <- lm (a b+c+d, data = database1)
>
> Then I try to perform the Chow (1960) test (structural change test) on my regression. I know the breakpoint date. I try the following code like it is described in the “Examples” section of the “strucchange” package :
>
>> sctest(reg1, data = database1, type = "Chow", point = 20, asymptotic = FALSE)
You just need the formula, not the fitted model:
sctest(a ~ b + c + d, data = database1, type = "Chow", point = 20)
If you want to perform it "by hand", then the following should work:
fit the nested model and then perform the model comparison calling anova()
(or lrtest() from "lmtest" for the asymptotic version).
reg2 <- lm(a ~ factor(1:nrow(database1) <= 20) / (b + c + d),
data = database1)
anova(reg1, reg2)
hth,
Z
>
> Unfortunately, this does not work and I have the following error message:
>
> Error in UseMethod("sctest") : No applied method for "sctest".
>
> I guess that I should compute fs statistics first (Fisher statistics) but I’m not sure about my guess. Moreover, in case my guess is true I do know how to do it although I have read the package documentation!
> On the basis of this documentation I’m able to perform other structural change test (CUSUM, MOSUM…) but I’m particularly interested in the Chow (1960) test. So please is there someone who can help me in implementing it.
>
> Many thanks in advance.
>
>
>
>
>
> [[alternative HTML version deleted]]
>
>
[[alternative HTML version deleted]]