Displaying 3 results from an estimated 3 matches for "logpatch".
2007 Feb 13
1
lme4/lmer: P-Values from mcmc samples or chi2-tests?
...of the mcmc sample
(3) lack of correspondence between different p-value estimates.
How can I proceed, left with these uncertainties in the estimations of
the p-values?
Below is the corresponding R code with some output so that you can see
it all for your own:
##
m1<-lmer(number_pollinators~logpatch+loghab+landscape_diversity+(1|site),primula,poisson,method="ML")
m2<-lmer(number_pollinators~logpatch+loghab+landscape_diversity+(1|site),primula,quasipoisson,method="ML")
summary(m1);summary(m2)
#m1: [...]
Fixed effects:
Estimate Std. Error z value Pr(&...
2007 Feb 12
1
lmer and estimation of p-values: error with mcmcpvalue()
...ristoph.
##
mcmcpvalue <- function(samp)
{ std <- backsolve(chol(var(samp)),
cbind(0, t(samp)) - colMeans(samp),
transpose = TRUE)
sqdist <- colSums(std * std)
sum(sqdist[-1] > sqdist[1])/nrow(samp) }
m1<-lmer(number_pollinators~logpatch+loghab+landscape_diversity+(1|site),quasipoisson)
Generalized linear mixed model fit using Laplace
Formula: number_pollinators ~ logpatch + loghab + landscape_diversity +
(1 | site)
Data: primula
Family: quasipoisson(log link)
AIC BIC logLik deviance
84.83 93.75 -37.42 74.83...
2007 Mar 12
0
Pvalues and lme
...see:
>
> ##
> fit<-lmer(End~Treatment+offset(log(Area)+(1|Site/Treatment), family=poisson)
>
Summary
Intercept
> The p-values from mcmc are:
>
> ##
> markov1=mcmcsamp(m2,5000)
>
> HPDinterval(markov1)
> lower upper
> (Intercept) -1.394287660 0.6023229
> logpatch 0.031154910 0.1906861
> loghab 0.002961281 0.2165285
> landscape_diversity 0.245623183 1.6442544
> log(site.(In)) -41.156007604 -1.6993996
> attr(,"Probability")
> [1] 0.95
>
> ##
>
> mcmcpvalue(as.matrix(markov1[,1])) #i.e. the p value for the intercept
> [1...