[R-sig-ME] Wald's test

John Fox jfox at mcmaster.ca
Wed Dec 5 01:32:42 CET 2012


Dear Justin,

The documentation in ?anova.lme seems very clear to me -- what is described for type="marginal" is what is often called type III tests, though for these to be sensible in models with interactions, careful attention has to be paid to contrast coding. The Anova() function in the car package has methods for type II tests for models fit by lme() in the nlme package and lmer() in the lme4 package.

I hope this helps,
 John

------------------------------------------------
John Fox
Sen. William McMaster Prof. of Social Statistics
Department of Sociology
McMaster University
Hamilton, Ontario, Canada
http://socserv.mcmaster.ca/jfox/

On Tue, 4 Dec 2012 11:15:56 -0400
 Justin Chase <justinwchase1 at gmail.com> wrote:
> Thanks Dr. Bolker!  I have one issue though: I was able to generate F tests
> for my lme models using your suggestion anova(fm1,type="marginal")   ,
> however, it is my understanding that "marginal" typically refers to Type 3
> sums-of-squares, which is discouraged. I'm looking to generate Type 2 tests
> (i.e., "conditional"). The help file for anova() does not explain what the
> word "marginal" means in the context of the function, thus I've cc'd John
> Fox, who may be able to confirm whether or not this is Type II SS.
> 
> Thanks!
> 
> Justin
> 
> On Tue, Dec 4, 2012 at 10:12 AM, Ben Bolker <bbolker at gmail.com> wrote:
> 
> >
> > [I'm taking the liberty of cc'ing r-sig-mixed-models ... I strongly
> > prefer *not* to answer mixed models questions offline, for a variety of
> > reasons.]
> >
> > On 12-12-03 02:12 PM, Justin Chase wrote:
> > > Hi there Dr. Bolker.
> > >
> > > I have a question regarding both your 2008 paper in TREE and your
> > > response to Helios de Rosario's mixed model question on the
> > > R-sig-mixed-models mailing list. I am analyzing count data (transformed
> > > for normality) from a slightly unbalanced split-plot lab experiment. I
> > > have two fixed factors, one whole-plot and one sub-plot, with "plot" as
> > > random factor. the model looks like this:
> > >
> > > *y = µ + A_i + B_j + A*B_ij + C_k (B_i ) + A*C(B_i )_jk + e_l(ijk) *
> > >
> > > I have been using the nlme package in R to test the significance of
> > > fixed factors and their interaction on my univariate data, following
> > > chapter 19 in The R Book (Crawley 2007).
> >
> >   I don't actually have Crawley's book (although I probably should, if
> >   only to find out what he's telling people to do).
> >
> > > However, I'm not interested in
> > > analyzing coefficients of individual effects (treatment levels) like
> > > Bates does, but just want a significance test for whole factors. Because
> > > I don't want to prioritize either fixed factor, I prefer to generate
> > > type II SS estimates. Like Helios de Rosario, I used the Anova function
> > > in the car package to generate type II anova tables with Wald's Chi
> > > Square test and P values (because the F test is not available for this
> > > type of model). The results seem very reasonable and are fairly
> > > consistent with some least squares tests I've done on the same data
> > > using aov (reordering terms to get "type II" results). I've read your
> > > response to Helios's inquiry but unfortunately it was a bit over my
> > > head. According to your paper in TREE, my data should be analyzed with
> > > REML and F tests, but only Wald's X2 is available in R. Do you think I'm
> > > on the right track or should I just forget about using REML and analyze
> > > with aov on least squares fits (laboriously rearranging model terms to
> > > get type II tests)?
> >
> >   Hmm.  Obviously I don't have your exact model, but I'm trying to
> > figure out what's wrong with, for example,
> >
> > library(nlme)
> > fm1 <- lme(distance ~ age, data = Orthodont) # random is ~ age
> > anova(fm1,type="marginal")
> >
> > ##             numDF denDF  F-value p-value
> > ## (Intercept)     1    80 467.4406  <.0001
> > ## age             1    80  85.8464  <.0001
> >
> > ?  see anova.lme
> >
> > Some of the complexity of the 2008 paper is due to the fact
> > that GLMMs are more challenging in several respects than LMMs.
> >
> > > Also, should I be testing for overdispersion when using the Wald test,
> > > even though I'm just modelling Gaussian data with lme?
> >
> >   No. The Gaussian family has an adjustable scale parameter (i.e.,
> > the variance is estimated from the data, rather than [as in the
> > binomial or Poisson families] fixed at a theoretical value)
> >
> >
> >
> 
> 
> -- 
> *Justin W. Chase*
> MSc Candidate
> Canadian Rivers Institute
> University of New Brunswick
> 506-452-7474 (home*)
> 506-453-4845 (office)
> justinwchase1 at gmail.com
> LinkedIn Profile <http://www.linkedin.com/in/justinwchase>
> 
> 	[[alternative HTML version deleted]]
>



More information about the R-sig-mixed-models mailing list