mixed-models

extracting coefficients and their standard error from lme

落花浮王杯 提交于 2019-11-29 04:43:20
How could I extract coefficients (b0 and b1) with their respectively standard errors for each experimental unit (plot )in a linear mixed model such as this one: Better fits for a linear model with this same dataset(df), and for the fitted model (fitL1): how could I get a data frame as this one... plot b0 b0_se b1 b1_se 1 2898.69 53.85 -7.5 4.3 ... ... ... ... ... The first comment is that this is actually a non-trivial theoretical question: there is a rather long thread on r-sig-mixed-models that goes into some of the technical details; you should definitely have a look, even though it gets a

Converting Repeated Measures mixed model formula from SAS to R

99封情书 提交于 2019-11-28 20:39:53
问题 There are several questions and posts about mixed models for more complex experimental designs, so I thought this more simple model would help other beginners in this process as well as I. So, my question is I would like to formulate a repeated measures ancova in R from sas proc mixed procedure: proc mixed data=df1; FitStatistics=akaike class GROUP person day; model Y = GROUP X1 / solution alpha=.1 cl; repeated / type=cs subject=person group=GROUP; lsmeans GROUP; run; Here is the SAS output

extracting coefficients and their standard error from lme

拥有回忆 提交于 2019-11-27 18:37:44
问题 How could I extract coefficients (b0 and b1) with their respectively standard errors for each experimental unit (plot )in a linear mixed model such as this one: Better fits for a linear model with this same dataset(df), and for the fitted model (fitL1): how could I get a data frame as this one... plot b0 b0_se b1 b1_se 1 2898.69 53.85 -7.5 4.3 ... ... ... ... ... 回答1: The first comment is that this is actually a non-trivial theoretical question: there is a rather long thread on r-sig-mixed

How to get coefficients and their confidence intervals in mixed effects models?

£可爱£侵袭症+ 提交于 2019-11-27 17:32:14
In lm and glm models, I use functions coef and confint to achieve the goal: m = lm(resp ~ 0 + var1 + var1:var2) # var1 categorical, var2 continuous coef(m) confint(m) Now I added random effect to the model - used mixed effects models using lmer function from lme4 package. But then, functions coef and confint do not work any more for me! > mix1 = lmer(resp ~ 0 + var1 + var1:var2 + (1|var3)) # var1, var3 categorical, var2 continuous > coef(mix1) Error in coef(mix1) : unable to align random and fixed effects > confint(mix1) Error: $ operator not defined for this S4 class I tried to google and use

lme4::lmer reports “fixed-effect model matrix is rank deficient”, do I need a fix and how to?

∥☆過路亽.° 提交于 2019-11-27 04:06:18
I am trying to run a mixed-effects model that predicts F2_difference with the rest of the columns as predictors, but I get an error message that says fixed-effect model matrix is rank deficient so dropping 7 columns / coefficients. From this link, Fixed-effects model is rank deficient , I think I should use findLinearCombos in the R package caret . However, when I try findLinearCombos(data.df) , it gives me the error message Error in qr.default(object) : NA/NaN/Inf in foreign function call (arg 1) In addition: Warning message: In qr.default(object) : NAs introduced by coercion My data does not

Extract prediction band from lme fit

两盒软妹~` 提交于 2019-11-26 12:37:38
问题 I have following model x <- rep(seq(0, 100, by=1), 10) y <- 15 + 2*rnorm(1010, 10, 4)*x + rnorm(1010, 20, 100) id <- NULL for(i in 1:10){ id <- c(id, rep(i,101)) } dtfr <- data.frame(x=x,y=y, id=id) library(nlme) with(dtfr, summary( lme(y~x, random=~1+x|id, na.action=na.omit))) model.mx <- with(dtfr, (lme(y~x, random=~1+x|id, na.action=na.omit))) pd <- predict( model.mx, newdata=data.frame(x=0:100), level=0) with(dtfr, plot(x, y)) lines(0:100, predict(model.mx, newdata=data.frame(x=0:100),

lme4::lmer reports “fixed-effect model matrix is rank deficient”, do I need a fix and how to?

拜拜、爱过 提交于 2019-11-26 10:59:35
问题 I am trying to run a mixed-effects model that predicts F2_difference with the rest of the columns as predictors, but I get an error message that says fixed-effect model matrix is rank deficient so dropping 7 columns / coefficients. From this link, Fixed-effects model is rank deficient, I think I should use findLinearCombos in the R package caret . However, when I try findLinearCombos(data.df) , it gives me the error message Error in qr.default(object) : NA/NaN/Inf in foreign function call