[R-sig-ME] Evaluate fixed effects with aovlmer.fnc
Steven Brady
steven.brady at yale.edu
Sat Jun 26 23:45:49 CEST 2010
Hi All:
I am evaluating the outcome of a reciprocal transplant experiment that
involves two fixed factors (and their interaction) and one random
factor. Example code is below.
One goal of this analysis is to report an mcmc based p-value (and
estimates, HDP Intervals, etc...) for each of the two fixed factors and
their interaction. Using aovlmer.fnc() I can generate an anova table to
that effect (with F based p values), but only one mcmc p value is
reported. I suspect this may have something to do with the Warning
message (see below).
Can anyone suggest how to extract the mcmc p values for each factor
along with HDP intervals?
Also: When I attempt to evaluate the significance of the fixed factors
using pvals.fnc() instead of aovlmer.fnc(), I noticed that the p values
depend on the name (alphabetical?) of the level within the factor. Can
anyone clarify this distinction in outputs? Said another way, what do
the different p values refer to in the output of
pvals.fnc(g)
versus
aovlmer.fnc(g, mcmc$mcmc, c("originw", "envw",
+ "originw:envw"))
Many thanks for any input.
Best,
Steve
#Example
population=c("a","a","a","a","b","b","b",
"b","c","c","c","c","d","d","d","d")
env=c("r","r","w","w","r","r","w","w",
"r","r","w","w","r","r","w","w")
origin=c("r","r","r","r","r","r","r",
"r","w","w","w","w","w","w","w","w")
survival=c(rnorm(16,0.75, sd = 0.1))
exp=data.frame(population=population, env=env,
origin=origin,survival=survival)
g<-lmer(survival~origin*env +
(1|population), data = exp)
mcmc = pvals.fnc(g, nsim=10000, withMCMC=TRUE)
aovlmer.fnc(g, mcmc$mcmc, c("originw", "envw",
"originw:envw"))
$MCMC
$MCMC$p
[1] 0.0802
$MCMC$which
[1] "originw" "envw" "originw:envw"
$Ftests
Analysis of Variance Table
Df Sum Sq Mean Sq F value F Df2 p
origin 1 0.000570 0.000570 0.1267 0.1267 12 0.72808
env 1 0.036297 0.036297 8.0659 8.0659 12 0.01490
origin:env 1 0.004855 0.004855 1.0789 1.0789 12 0.31942
Warning message:
In if (class(anov) != "try-error") { :
the condition has length > 1 and only the first element will be used
__________________________________________
Steven P. Brady, Ph.D. Candidate
School of Forestry & Environmental Studies
Yale University
370 Prospect Street
New Haven, CT 06511
Email: steven.brady at yale.edu
Phone: 203-432-5321 Fax: 203-432-3929
Web: http://www.cbc.yale.edu/people/skelly/steveb.html
More information about the R-sig-mixed-models
mailing list