Displaying 20 results from an estimated 4000 matches similar to: "Multilevel modeling with count variables"
2009 Feb 24
2
lmer, estimation of p-values and mcmcsamp
(To the list moderator: I just subscribed to the list. Apologies for not
having done so longer before trying to post.)
Hi all,
I am currently using lmer to analyze data from an experiment with a
single fixed factor (treatment, 6 levels) and a single random factor
(block). I've been trying to follow the online guidance for estimating
p-values for parameter estimates on these and other
2013 May 08
1
How to calculate Hightest Posterior Density (HPD) of coeficients in a simple regression (lm) in R?
Hi!
I am trying to calculate HPD for the coeficients of regression models
fitted with lm or lmrob in R, pretty much in the same way that can be
accomplished by the association of mcmcsamp and HPDinterval functions for
multilevel models fitted with lmer. Can anyone point me in the right
direction on which packages/how to implement this?
Thanks for your time!
R.
[[alternative HTML version
2010 Apr 01
3
pvals.fnc() with language R does not work with R 2.10.1
Hi Everyone,
I am using R 2.10.1. lmer function works properly, however pvals.fnc
() does not despite the fact that I uploaded:
- library(lme4)
- library(coda)
- library(languageR)
This is the error message I get
pvals.fnc(lexdec3.lmerE2, nsim=10000)$fixed
Error in pvals.fnc(lexdec3.lmerE2, nsim = 10000) :
MCMC sampling is not yet implemented in lme4_0.999375
for models with random
2007 Apr 03
2
HPDinterval problem
Hi,
Can anyone tell me why I am not getting the correct intervals for
fixed effect terms for the following generalized linear mixed model
from HPDinterval:
> sessionInfo()
R version 2.4.1 (2006-12-18)
i386-pc-mingw32
locale:
LC_COLLATE=English_United States.1252;LC_CTYPE=English_United
States.1252;LC_MONETARY=English_United
States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252
2008 Nov 26
1
Problem with aovlmer.fnc in languageR
Dear R list,
I have a recurring problem with the languageR package, specifically the
aovlmer.fnc function. When I try to run the following code (from R. H.
Baayen's textbook):
# Example 1:
library(languageR)
latinsquare.lmer <- lmer(RT ~ SOA + (1 | Word) + (1 | Subject),
data = latinsquare)
x <- pvals.fnc(latinsquare.lmer,
2010 Jan 31
2
lmer, mcmcsamp, coda, HPDinterval
Hi,
I've got a linear 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
2011 Sep 07
1
Reshaping data from wide to tall format for multilevel modeling
Hi,
I'm trying to reshape my data set from wide to tall format for multilevel
modeling. Unfortunately, the function I typically use (make.univ from the
multilevel package) does not appear to work with unbalanced data frames,
which is what I'm dealing with.
Below is an example of the columns of a data frame similar to what I'm
working with:
ID a1 a2 a4 b2 b3 b4 b5 b6
Below
2008 Jun 30
1
Coda not providing summary on mcmc object
The object is a mcmc sample from lmer. I am using R v2.7.1. Please let me
know what additional information I can provide, hopefully I am just making a
simple mistake. Thanks in advance!
> data(ratdrink, package = 'faraway')
> rd.er <- lmer(wt ~ weeks*treat + (1 | subject), data = ratdrink)
> rd.mc <- mcmcsamp(rd.er, 10000)
> library(coda)
Loading required package:
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
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
2010 Mar 06
2
Plot interaction in multilevel model
I am trying to plot an interaction in a multilevel model. Here is some
sample data. In the following example, it is longitudinal (i.e., repeated
measures), so the outcome, score (at each of the three time points), is
nested within the individual. I am interested in the interaction between
gender and happiness predicting score.
id <- c(1,1,1,2,2,2,3,3,3)
age <-
2007 Mar 13
1
lme4 and mcmcamp
Dear R users
I am trying to obtain p-values for (quasi)poisson lmer models, using
Markov-chain Monte Carlo sampling and the command summary.
>
> My problems is that p values derived from both these methods are
totally different. My question is
(1) there a bug in my code and
>
(2) How can I proceed, left with these uncertainties in the estimations of
> the p-values?
>
> Below is
2007 Mar 12
2
Lmer Mcmc Summary and p values
Dear R users
I am trying to obtain p-values for (quasi)poisson lmer models, including
Markov-chain Monte Carlo sampling and the command summary.
>
> My problems is that p values derived from both these methods are
totally different. My question is
(1) there a bug in my code and
>
(2) How can I proceed, left with these uncertainties in the estimations of
> the p-values?
>
> Below
2011 Apr 21
1
Error running pvals.fnc in R version 2.13.0
Dear R-help:
I've been trying to run pvals.fnc in the newest version of R (2.13.0). The
function lmer worked fine, but when I tried to use pvals.fnc on the lmer
object, I got the following error:
"Error in pvals.fnc(elogr.subj.dys.sum.3x3.p, nsim = 10000) :
trying to get slot "coefs" from an object (class "summaryDefault") that is
not an S4 object."
How can I
2007 May 11
0
incorrect MCMC CIs in pvals.fnc (languageR) ?
library(lme4)
library(coda)
library(languageR)
fit = lmer(Reaction~Days + (1|Subject) + (0+Days|Subject),
data=sleepstudy)
pvals.fnc(fit)$random
# compare with...
samp = mcmcsamp(fit, n=10000, trans=FALSE)
HPDinterval(samp)
densityplot(samp, plot=F)
# 'pvals.fnc' reports sigma instead of sigma^2, but it looks like the
# Sbjc.(In) and Sbjc.Days are also sqrt compared with the
2011 Jul 01
3
Multilevel Survival Analysis - Cox PH Model
Hello all, thanks for your time and patience.
I'm looking for a method in R to analyse the following data:
Time to waking after anaesthetic for medical procedures repeated on the same
individual.
> str(mysurv)
labelled [1:740, 1:2] 20 20 15 20 30+ 40+ 50 30 15 10 ...
- attr(*, "dimnames")=List of 2
..$ : NULL
..$ : chr [1:2] "time" "status"
-
2008 Oct 01
1
pvals.fnc in lme4 and languageR
Hi everybody!
I was using the function pvals.fnc from package 'languageR' until April.
I do not know which version. Yesterday I updated all my packages
and tried to run my loop again. Now I get the following error message:
error in pvals.fnc(mm, nsim = 1000) :
MCMC sampling is not yet implemented in lme4_0.999375-27
for models with random correlation parameters
I guess it?s because of
2007 Jun 25
1
LanguageR pvals.fnc error message
Hi. I get an error message about not converging when I try and use the
pvals.fnc from the languageR library. The LMER analysis worked fine (See
below).
I am not an expert so I don't understand why the LMER worked but not the
pvals.fnc
Any help gratefully received.
- Mike
AIC BIC logLik MLdeviance REMLdeviance
-7324 -7254 3673 -7451 -7346
Random effects:
Groups
2007 Feb 12
1
lmer and estimation of p-values: error with mcmcpvalue()
Dear all,
I am currently analyzing count data from a hierarchical design, and I?ve
tried to follow 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
2007 Feb 13
1
lme4/lmer: P-Values from mcmc samples or chi2-tests?
Dear R users,
I have now tried out several options of obtaining p-values for
(quasi)poisson lmer models, including Markov-chain Monte Carlo sampling
and single-term deletions with subsequent chi-square tests (although I
am aware that the latter may be problematic).
However, I encountered several problems that can be classified as
(1) the quasipoisson lmer model does not give p-values when