Hi,

I've data from an incomplete fatorial design. One level of a factor doesn't
has the levels of the other. When I use lm(), the summary() return NA for
that non estimable parameters. Ok, I understant it. But I use
contrast::contrast(), gmodels::estimable(), multcomp::glht() and all these
fail when model has NA estimates. This is becouse vcov() and coef() has
different dimensions. Is possible set lm() to omit NA? Below same toy data
and code.

> # toy data
> adi <- expand.grid(cult=gl(1,3,la=LETTERS[1]), fert=101)
> fat <- expand.grid(cult=gl(2,3,la=LETTERS[2:3]), fert=seq(50,150,50))
> da <- rbind(adi, fat)
> da$y <- da$fert+rnorm(nrow(da),0,10)
>
> # plot
> require(lattice)
> xyplot(y~fert|cult, da)
>
> # adjust
> m0 <- lm(y~cult*fert, da)
> summary(m0)

...
Coefficients: (1 not defined because of singularities)
            Estimate Std. Error t value Pr(>|t|)
(Intercept)  7.55401   10.18956   0.741    0.469
cultB       -8.04486   13.54672  -0.594    0.561
cultC       -3.83644    6.74848  -0.568    0.578
fert         0.87486    0.08265  10.586 1.24e-08 ***
cultB:fert   0.13509    0.11688   1.156    0.265
cultC:fert        NA         NA      NA       NA
...
> require(gmodels)
> estimable(m0, cm=c(1,0,0,100,0,0))
Erro em estimable.default(m0, cm = c(1, 0, 0, 100, 0, 0)) :
 Dimension of structure(c(1, 0, 0, 100, 0, 0), .Dim = c(1L, 6L)): 1x6, not
compatible with no of parameters in m0: 5

Thanks.
Walmes.

==========================================================================
Walmes Marques Zeviani
LEG (Laboratório de Estatística e Geoinformação, 25.450418 S, 49.231759 W)
Departamento de Estatística - Universidade Federal do Paraná
fone: (+55) 41 3361 3573
VoIP: (3361 3600) 1053 1173
e-mail: wal...@ufpr.br
twitter: @walmeszeviani
homepage: http://www.leg.ufpr.br/~walmes
linux user number: 531218
==========================================================================

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to