search for: mcmcsamp

Displaying 20 results from an estimated 81 matches for "mcmcsamp".

2009 Feb 11
2
generalized mixed model + mcmcsamp
Hi, I have fitted a generalized linear mixed effects model using lmer (library lme4), and the family = quasibinomial. I have tried to obtain a MCMC sample, but on calling mcmcsamp(model1, 1000) I get the following error which I don't understand at all: Error in .local(object, n, verbose, ...) : Update not yet written traceback() delivers: 4: .Call(mer_MCMCsamp, ans, object) 3: .local(object, n, verbose, ...) 2: mcmcsamp(model1, n = 1000, verbose = FALSE) 1: mcmcsamp(m...
2006 Oct 20
1
mcmcsamp - How does it work?
Hello, I am a chemical student and I make use of 'lme/lmer function' to handle experiments in split-plot structures. I know about the mcmcsamp and I think that it's very promissory. I would like knowing "the concept behind" of the mcmcsamp function. I do not want the C code of the MCMCSAMP function. I would like to get the "pseudo-algorithm" to understanding that it does. I accompanied the threads [1] and [2] and...
2008 Oct 08
1
Suspicious output from lme4-mcmcsamp
Hello, R community, I have been using the lmer and mcmcsamp functions in R with some difficulty. I do not believe this is my code or data, however, because my attempts to use the sample code and 'sleepstudy' data provided with the lme4 packaged (and used on several R-Wiki pages) do not return the same results as those indicated in the help pages....
2006 Aug 08
1
fixed effects following lmer and mcmcsamp - which to present?
Dear all, I am running a mixed model using lmer. In order to obtain CI of individual coefficients I use mcmcsamp. However, I need advice which values that are most appropriate to present in result section of a paper. I have not used mixed models and lmer so much before so my question is probably very naive. However, to avoid to much problems with journal editors and referees addicted to p-values, I would...
2006 Feb 10
1
mcmcsamp shortening variable names; how can i turn this feature off?
I have written a function called mcsamp() that is a wrapper that runs mcmcsamp() and automatically monitors convergence and structures the inferences into vectors and arrays as appropriate. But I have run into a very little problem, which is that mcmcsamp() shortens the variable names. For example: > set.seed (1) > group <- rep (1:5,10) > a <- rnorm (5,...
2007 Apr 03
2
HPDinterval problem
...pv1toa pv2toa ssblf2 ssblf3 pv1o -0.638 pv2o -0.036 -0.099 pv1toa -0.073 -0.050 -0.029 pv2toa -0.043 -0.035 -0.156 -0.458 sesblf2 -0.411 -0.009 0.040 0.002 0.012 sesblf3 -0.412 -0.005 0.039 -0.002 0.037 0.516 sesblf4 -0.413 -0.006 0.044 0.003 0.028 0.513 0.514 > s1.16 <- mcmcsamp(m1.16, n = 100000) > HPDinterval(s1.16) lower upper (Intercept) -0.372258256 -0.372258256 pv1o 0.151590854 0.151590854 pv2o 0.029524315 0.029524315 pv1toa 0.025668727 0.025668727 pv2toa 0.00...
2010 Jan 31
2
lmer, mcmcsamp, coda, HPDinterval
...r mixed model created using lmer: A6mlm <- lmer(Score ~ division + (1|school), data=Age6m) (To those of you to whom this model looks familiar, thanks for your patience with this & my other questions.) Anyway, I was trying this to look at the significance of my fixed effects: A6post <- mcmcsamp(A6mlm, 50000) library(coda) HPDinterval(A6post) ..but I got this message: "no applicable method for 'HPDinterval' applied to an object of class "merMCMC"" Should I be coercing A6post to another type, or am I missing other steps altogether? Thanks :) Doug Adams ----...
2007 Mar 30
0
problem using mcmcsamp() with glmer models containing interaction terms in fixed effects
Dear All, I've been using mcmcsamp() successfully with a few different mixed models but I can't get it to work with the following. Is there an obvious reason why it shouldn't work with a model of this structure ? *brief summary of objective: I want to test the effect of no-fishing marine reserves on the abundance of a tar...
2007 Apr 27
1
Example of mcmcsamp() failing with lmer() output
...s a split plot design with randomly selected teams for each physique, which was crossed with two methods. Following the Oats example in chap. 1 of MEMSS, and adapting to lmer: <<2>>= require(lme4) gl.lmer <- lmer(rounds ~ method * physique + (1 | physique/team), data = gunload) mcmcsamp(gl.lmer) @ lmer runs as expected, but mcmcsamp() gives: Error: Leading minor of order 1 in downdated X'X is not positive definite Error in t(.Call(mer_MCMCsamp, object, saveb, n, trans, verbose, deviance)) : error in evaluating the argument 'x' in selecting a method for function...
2008 Jan 24
0
(lme4: lmer) mcmcsamp: Error in if (var(y) == 0)
I've got a problem with "mcmcsamp" used with glmer objects produced with "lmer" from the lme4 package. When calling mcmcsamp, I get the error Error in if (var(y) == 0) { : missing value where TRUE/FALSE needed This does not occur with all models, but I can't find anything wrong with the dataset. If the er...
2008 Sep 27
1
Using the mcmcsamp function
...cal(object, n, verbose, ...) : Update not yet written' Can anyone tell me what this means and how I can resolve it, I'm using R. 2.7.2 and updated 'lme4' yesterday The code I use is as follows: model<-lmer(FemApp~MaleWith+(1|MaleID)+(1|FemID),poisson,data=Compliance) mcmp<-mcmcsamp(model3, n= 1000) Thanks in advance Parry
2006 Aug 08
1
fixed effects constant in mcmcsamp
...me questionnaire data. The structure is J individuals, nested within I areas, all of whom answer the same K (ordinal) questions. The model I'm using is based on so-called continuation ratios, so that it can be fitted using the lme4 package. The lmer function fits the model just fine, but using mcmcsamp to judge the variability of the parameter estimates produces some strange results. The posterior sample is constant for the fixed effects, and the estimates of the variance components are way out in the tails of their posterior samples. The model I'm using says (for l = 1, ..., L - 1) logit P...
2007 Jan 03
1
mcmcsamp and variance ratios
Hi folks, I have assumed that ratios of variance components (Fst and Qst in population genetics) could be estimated using the output of mcmcsamp (the series on mcmc sample estimates of variance components). What I have started to do is to use the matrix output that included the log(variances), exponentiate, calculate the relevant ratio, and apply either quantile or or HPDinterval to get confidence intervals. This seems too simple bu...
2009 Mar 17
0
update on mcmcsamp for glmer
I've searched the help archives of both lists and apologize if I missed the answer to my question: Is there an update on developing mcmcsamp for glmer? I'm using R v. 2.7.2 (on our Unix server - will hopefully be updated soon) and 2.8.1 on my PC and get the message for both: gm1 <- glmer(cbind(incidence, size - incidence) ~ period + (1 | herd),family = binomial, data = cbpp) temp<-mcmcsamp(gm1, 1000) Error in .local(object,...
2011 Feb 19
0
lmer, MCMCsamp and ranef samples?
I really hope sombody could help me with the following, I'm having problems accessing the random effect samples following the example on MCMCsamp: (fm1 <- lmer(Reaction ~ Days + (1|Subject) + (0+Days|Subject), sleepstudy)) set.seed(101); samp0 <- mcmcsamp(fm1, n = 1000, saveb=TRUE) str(samp0) Formal class 'merMCMC' [package "lme4"] with 9 slots ..@ Gp : int [1:3] 0 18 36 ..@ ST : num [1:2, 1:1000]...
2009 Feb 24
2
lmer, estimation of p-values and mcmcsamp
...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.matrix(markov1[,1])) mcmcpvalue(as.matrix(markov1[,2])) mcmcpvalue(as.matrix(markov1[,3])) mcmcpvalue(as.matrix(markov1[,4])) mcmcpvalue(as.matrix(markov1[,5])) mcmcpvalue(as.matrix(markov1[,6])) The first time I tried it HPDinterval generated CIs...
2007 Aug 21
1
small issue with densityplot
Hi folks, This is really minor but to someone not familiar with the various tentacles of the lmer package it could be really annoying. I was trying to plot the posterior density of the fixed effect parameters of a lmer model, > hr.mcmc = mcmcsamp(hr.lmer, n=50000) > densityplot(hr.mcmc, plot.points=F) There is this error, "Error in densityplot(hr.mcmc, plot.points = F) : no applicable method for "densityplot" " It kind of smells like something I've come across before. So I checked the mcmcsamp help pag...
2006 Jan 28
1
yet another lmer question
...3.1 2 7.9 > x <- rep (c(1,2), c(3,7)) > M2 <- lmer (y ~ 1 + x + (1 + x | group)) > coef(M2) $group (Intercept) x 1 -0.755102 2.755102 2 0.616483 3.640738 I can't figure out why everything is rounded for the first model but not for the second. Also, mcmcsamp() works for M1 but not for M2: > mcmcsamp(M1) (Intercept) log(sigma^2) log(grop.(In)) [1,] 9.099073 0.5711817 3.246981 attr(,"mcpar") [1] 1 1 1 attr(,"class") [1] "mcmc" > mcmcsamp(M2) Error: inconsistent degrees of freedom and dimension Erro...
2006 Nov 29
1
Lmer, P-values and mixed logistic regression
...s doesn't appear anymore in the summary of a linear mixed-model with lmer. However, if I do a mixed logistic regression with lmer using family=binomial, the summary includes a p-values for fixed effects. Is it normal, could I use those p-values to interpret the fixed effects or should I use mcmcsamp to obtain 95% confidence interval? Thanks Julien
2007 Mar 13
1
lme4 and mcmcamp
...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 -3.1366836 Treatment2 3.4455972 4.3196598 Treatment 3 0.399302 1.287747 Treatment 4 -1.7898933 -0.2980325 log(Treatment*Site.(in)) -22.2198233 -19.7342530 log(Site.(In)) -28.7857601 -23.095293...