Skip to content
Prev 244089 / 398506 Next

waldtest and nested models - poolability (parameter stability)

Dear Achim,

Thanks a lot for the superquick reply!
Somehow with your suggestion I can get around the problem, but of course I 
run into other problems, such as this:
Error in bread. %*% meat. : non-conformable arguments

Cheers
Roberto

----- Original Message ----- 
From: "Achim Zeileis" <Achim.Zeileis at uibk.ac.at>
To: "Patuelli Roberto" <roberto.patuelli at usi.ch>
Cc: <r-help at r-project.org>
Sent: Monday, December 06, 2010 9:38 PM
Subject: Re: [R] waldtest and nested models - poolability (parameter 
stability)
On Mon, 6 Dec 2010, Roberto Patuelli wrote:

            
Yes. Because waldtest() needs to figure out which contrasts to apply to
go from the unrestricted model to the restricted model. The current
implementation can only do so by looking at the names of the coefficients.
It assumes that unrestricted model has all coefficients from the
restricted model plus some more (which are set to zero under the null
hypothesis).

When you use interactions (as you do below), this only works if you use
the *-coding but not the /-coding.

In pseudo code:

fm0  <- glm(y ~ x, family = binomial)
fm1a <- glm(y ~ a * x, family = binomial)
fm1b <- glm(y ~ a / x, family = binomial)

The restricted model is fm0 and the unrestricted model is fm1a/fm1b. Both
are equivalent in terms of fitted values. With waldtest() you can compare

   waldtest(fm0, fm1a)

but

   waldtest(fm0, fm1b)

fails because the models do not fulfill the restriction above. So, only
for the inference with waldtest() you need to compute fm1a as well. If
significant, you can go on and interpret fm1b.

Hope that helps,
Z