[R] Chow test(1960)/Structural change test

Achim Zeileis Achim.Zeileis at wu-wien.ac.at
Sun May 17 23:22:36 CEST 2009


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]]
>
>


More information about the R-help mailing list