[R] waldtest and nested models - poolability (parameter stability)

Roberto Patuelli roberto.patuelli at usi.ch
Mon Dec 6 21:17:17 CET 2010

Dear All,

I'm trying to use waldtest to test poolability (parameter stability) between 
two logistic regressions. Because I need to use robust standard errors 
(using sandwich), I cannot use anova. anova has no problems running the 
test, but waldtest does, indipendently of specifying vcov or not. waldtest 
does not appear to see that my models are nested. H0 in my case is the the 
vector of regression parameters beta1 is the same as the vector of 
parameters beta2, where beta1 and beta2 are computed for the two subgroups 
(divided according to a factor).

I was wondering if anyone can help me making waldtest recognize the nesting.

Here's the lines I run:
(BTW, I try to use robust standard errors because what I normally use 
(glm.binomial.disp) to correct for overdispersion does not converge for the 
unpooled model. But this is another story....)

# poolability for leva.fin03.d
# pooled model
inv.log.leva.base = glm(mix.au.bin ~ cat.gap.tot + leva.fin03.d + ... + 
sud0nord1, data = inv.sub.au, family = binomial, maxit = 1000) # I deleted 
almost all variables to make the line more readable

# overdispersed pooled model - NOT THE PROBLEM NOW
inv.log.leva.base.disp = glm.binomial.disp(inv.log.leva.base)

# unpooled model
inv.log.leva = glm(mix.au.bin ~ leva.fin03.d/(cat.gap.tot + ... + 
sud0nord1 - 1), data = inv.sub.au, family = binomial, maxit = 1000) # again 
I deleted most variables for readability

# overdispersed unpooled model - NOT CONVERGING :(
inv.log.leva.disp = glm.binomial.disp(inv.log.leva, maxit = 10000)

# inv.log.leva.disp not converging, so I resort to using waldtest with 
waldtest(inv.log.leva.base, inv.log.leva, test = "Chisq", vcov = sandwich)

# anova would work but its results are not reliable because of the 
overdispersion - basically without correcting for overdispersion almost 
every variable is highly significant
anova(inv.log.leva.base, inv.log.leva, test = "Chisq")

Thanks everyone!
Best regards,
Roberto Patuelli

Roberto Patuelli, Ph.D.
Istituto Ricerche Economiche (IRE) (Institute for Economic Research)
Università della Svizzera Italiana (University of Lugano)

More information about the R-help mailing list