Displaying 7 results from an estimated 7 matches for "mcmcpvalue".
2009 Feb 24
2
lmer, estimation of p-values and mcmcsamp
...er help threads:
https://stat.ethz.ch/pipermail/r-help/2006-May/094765.html
http://pidgin.ucsd.edu/pipermail/r-lang/2007-August/000057.html
but have not yet been successful. This is my code:
lnmass <- lmer(log.mass ~ treatment + (1|block), data=exp1)
summary(lnmass)
samp <- rnorm(n=10000)
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) }
markov1 <- mcmcsamp(lnmass, 10000)
HPDinterval(markov1)
mcmcpvalue(as.matr...
2007 Feb 12
1
lmer and estimation of p-values: error with mcmcpvalue()
...llow the suggestions for a correct estimation of p-values as
discusssed at R-Wiki
(http://wiki.r-project.org/rwiki/doku.php?id=guides:lmer-tests&s=lme%20and%20aov).
However, I have the problem that my model only consists of parameters
with just 1 d.f. (intercepts, slopes), so that the "mcmcpvalue" function
defined below obviously produces error messages.
How can I proceed in estimating the p-values, then?
I very much acknowledge any suggestions.
Best regards
Christoph.
##
mcmcpvalue <- function(samp)
{ std <- backsolve(chol(var(samp)),
cbind(0, t(samp)...
2007 Mar 12
2
Lmer Mcmc Summary and p values
...7.666 1.77e-14****
Treatment 2 3.7970 0.505 7.516 5.51e-14****
Treatment 3 0.2409 9.6704 0.359 0.719
Treatment 4 -0.2483 0.8661 -0.287 0.774
Correlation of fixed effects
Intra T2 T3
T2 -0.989
T3 -0.745 0.737
T4 -0.577 0.570 0.430
> The p-values from mcmc are:
>
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)
}
fitSI<-mcmcsamp(fit,50000)
library(coda)
HPDinterval(fitSI)
lower upper
Intercept -4.0778905...
2007 Feb 13
1
lme4/lmer: P-Values from mcmc samples or chi2-tests?
...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] 0.3668
> mcmcpvalue(as.matrix(markov1[,2])) #i.e. the p-value for logpatch
[1] 0.004
> mcmcpvalue(as.matrix(markov1[,3])) #i.e. the p-value for loghab
[1] 0.0598
> mcmcpvalue(as.matrix(markov1[,4])) #i.e. the p-value for la...
2007 Mar 12
0
Pvalues and lme
...arkov1)
> 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] 0.3668
> > mcmcpvalue(as.matrix(markov1[,2])) #i.e. the p-value for logpatch
> [1] 0.004
> > mcmcpvalue(as.matrix(markov1[,3])) #i.e. the p-value for loghab
> [1] 0.0598
> > mcmcpvalue(as.matrix(markov1[,4]...
2007 Mar 13
1
lme4 and mcmcamp
...4995 -7.666 1.77e-14****
Treatment 2 3.7970 0.505 7.516 5.51e-14****
Treatment 3 0.2409 9.6704 0.359 0.719 Treatment 4 -0.2483 0.8661 -0.287 0.774
Correlation of fixed effects
Intra T2 T3
T2 -0.989
T3 -0.745 0.737
T4 -0.577 0.570 0.430
> The p-values from mcmc are:
>
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)
}
fitSI<-mcmcsamp(fit,50000)
library(coda)
HPDinterval(fitSI)
lower upper
Intercept -4.0778905...
2008 Aug 29
1
significance of random effects in poisson lmer
...ength) as a function of fixed effects Shrub (%shrub cover) and
Width (width of road), and random effect Site (nested within Site
Cluster).
>From reading answers to previous posts, it seems that the consensus is
to derive p-values using the neat little piece of code posted by Doug
Bates as "mcmcpvalue". This code calls the merMCMC object created by the
function mcmcsamp, but I can't even get as far as using this function
without running into difficulty. Basically, I get an error message
saying "Error in .local(object, n, verbose, ...) : Update not yet
written" - see below for...