similar to: Specify Z matrix with lmer function

Displaying 20 results from an estimated 10000 matches similar to: "Specify Z matrix with lmer function"

2011 Oct 09
2
pdIdent in smoothing regression model
Hi there, I am reading the 2004 paper "Smoothing with mixed model software" in Journal of Statistical Software, by Ngo and Wand. I tried to run their first example in Section 2.1 using R but I had some problems. Here is the code: library(nlme) fossil <- read.table("fossil.dat",header=T) x <- fossil$age y <- 100000*fossil$strontium.ratio knots <-
2010 Jun 15
0
lme, spline (revised question)
Dear All, I revise my question about the problem I have. Take a look at the article http://www.jstatsoft.org/v09/i01 and download the attached code. try to run one of the codes for example section 2.1 in R here is the code fossil <- read.table("fossil.dat",header=T) x <- fossil$age y <- 100000*fossil$strontium.ratio knots <- seq(94,121,length=25) n <- length(x) X <-
2005 Dec 09
1
lmer for 3-way random anova
I have been using lme from nlme to do a 3-way anova with all the effects treated as random. I was wondering if someone could direct me to an example of how to do this using lmer from lme4. I have 3 main effects, tim, trt, ctr, and all the interaction effects tim*trt*ctr. The response variable is ge. Here is my lme code: dat <-
2006 Jul 28
3
random effects with lmer() and lme(), three random factors
Hi, all, I have a question about random effects model. I am dealing with a three-factor experiment dataset. The response variable y is modeled against three factors: Samples, Operators, and Runs. The experimental design is as follow: 4 samples were randomly chosen from a large pool of test samples. Each of the 4 samples was analyzed by 4 operators, randomly selected from a group of
2006 Apr 22
1
Partially crossed and nested random factors in lme/lmer
Hi all, I am not a very proficient R-user yet, so I hope I am not wasting people?s time. I want to run a linear mixed model with 3 random factors (A, B, C) where A and B are partially crossed and C is nested within B. I understand that this is not easily possible using lme but it might be using lmer. I encountered two problems when trying: Firstly, I can enter two random factors in lmer but
2007 Aug 02
6
Error message in lmer
I do not think anyone has answered this. > I'm trying to run a simple one-way ANCOVA with the lmer > function in R package lme4, but have encountered some > conceptual problem. The data file MyData.txt is like this: > > Group Subj Cov Resp > A 1 3.90 4.05 > A 2 4.05 4.25 > A 3 4.25 3.60 > A 4 3.60 4.20 > A 5 4.20 4.05 > A 6 4.05 3.85
2009 Aug 26
3
tweedie and lmer
Hello all, I have count data with about 36% of observations being zeros. I found in some of the examples of the r-help mail archives that a tweedie family of distributions could be used to fit a model with random effects. Upon installing the tweedie package and attempting to fit the following model: lmer(SUS ~ 1 + (1|
2011 Jan 05
1
get() within a command, specifically lmer
Hello all. Why doesn't this work? d=data.frame(y=rpois(10,1),x=rnorm(10),z=rnorm(10),grp=rep(c('a','b'),each=5)) library(lme4) model=lmer(y~x+z+(1|grp),family=poisson,data=d) update(model,~.-z)###works, removes z var='z' update(model,~.-get(var))##doesn't remove z update(model,~. -get(var,pos=d))###doesn't remove z I am trying to remove z from the model in
2013 Apr 09
1
sorting the VAR model output according to variable names??
I was wondering if one can have the coefficients of VAR model sorted according to variable names rather than lags. If you notice below, the output is sorted according to lags. >VAR(cbind(fossil,labour),p=2,type="const") VAR Estimation Results: ======================= Estimated coefficients for equation fossil: =========================================== Call: fossil = fossil.l1
2005 Sep 29
1
Bug in lmer?
I am relatively new to R so I am not confident enough in what I am doing to be certain this is a bug. I am running R 2.1.1 on a Windows XP machine and the lme4 package version 0.98-1. The following code fits the model I want using the nlme package version 3.1-60. mltloc$loc <- factor(mltloc$loc) mltloc$block <- factor(mltloc$block) mltloc$trt <- factor(mltloc$trt) Mltloc <-
2005 Jun 26
4
Mixed model
Hi All, I am currently conducting a mixed model. I have 7 repeated measures on a simulated clinical trial. If I understand the model correctly, the outcome is the measure (as a factor) the predictors are clinical group and trial (1-7). The fixed factors are the measure and group. The random factors are the intercept and id and group. I tried using 2 functions to calculate mixed effects.
2009 May 21
2
Naming a random effect in lmer
Dear guRus: I am using lmer for a mixed model that includes a random intercept for a set of effects that have the same distribution, Normal(0, sig2b). This set of effects is of variable size, so I am using an as.formula statement to create the formula for lmer. For example, if the set of random effects has dimension 8, then the lmer call is: Zs<-
2011 Jan 21
1
TRADUCING lmer() syntax into lme()
---------- Forwarded message ---------- From: Freddy Gamma <freddy.gamma@gmail.com> Date: 2011/1/21 Subject: TRADUCING lmer() syntax into lme() To: r-sig-mixed-models@r-project.org Dear Rsociety, I'd like to kingly ask to anyone is willing to answer me how to implement a NON NESTED random effects structure in lme() In particular I've tried the following translation from lmer to
2006 Apr 13
3
Penalized Splines as BLUPs using lmer?
Dear R-list, I?m trying to use the lmer of the lme4 package to fit a linear mixed model of the form Y = Xb + Zu + e and I can?t figure out how to control the covariance structure of u. I want u ~ N(0,sigma^2*I). More precisely I?m trying to smooth a curve through data using the "Penalized Splines as BLUPs" method as described in Ruppert, Wand & Carroll (2003). So I have Z = [Z1
2006 Aug 21
1
Retrieving p-values and z values from lmer output
I can't find a way to retrieve z values and p-values from the output from lmer in the lme4 package. How is this done? Rick B.
2006 Aug 24
1
lmer(): specifying i.i.d random slopes for multiple covariates
Dear readers, Is it possible to specify a model y=X %*% beta + Z %*% b ; b=(b_1,..,b_k) and b_i~N(0,v^2) for i=1,..,k that is, a model where the random slopes for different covariates are i.i.d., in lmer() and how? In lme() one needs a constant grouping factor (e.g.: all=rep(1,n)) and would then specify: lme(fixed= y~X, random= list(all=pdIdent(~Z-1)) ) , that?s how it's done in the
2005 May 25
4
mixed model
Hello all, I have problem with setting up random effects. I have a model: y=x1+x2+x1*x2+z1+z1*x2 where x1, x2, x1*x2 are fixed effects and z1, z1*x2 are random effects (crossed effects) I use library(nlme) 'lme' function. My question is: how I should set up random effects? I did lme(y~x1+x2+x1:x2, data=DATA, random=~z1+z1:x2, na.action='na.omit') but it did not work.
2008 Jul 25
1
glht after lmer with "$S4class-" and "missing model.matrix-" errors
Hello everybody. In my case, calculating multiple comparisons (Tukey) after lmer produced the following two errors: > sv.mc <- glht(model.sv,linfct=mcp(comp="Tukey")) Error in x$terms : $ operator not defined for this S4 class Error in factor_contrasts(model) : no 'model.matrix' method for 'model' found! What I have done before: > sv.growth <-
2008 Feb 15
1
How to plot fitted values from lmer (lme4 package)?
I am modelling (at least trying to) the seasonal component of a variable using lmer. I think I am just about getting the hang of building the models but want to see what the fitted values look like. I need to plot 2 lines on the same graph - the original data ( copy of dataframe below) and the fitted values. I am doing this to a) start to understand how to use R and b) start to understand how to
2008 Dec 05
1
Question about lrandom effects specification in lme4
Folks: Suppose I have 3 random effects, A,B, and C. Using the older lme() function (in nlme) it was possible (using the pdMat classes) to specify that they are uncorrelated with identical variances. Is it possible to do this with lmer? My understanding is that if I specify them as lmer( y ~ ... + (A|Grp) + (B|Grp) + (C|Grp)) then they are uncorrelated but have different variances. Motivation: