lme4

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

How to unscale the coefficients from an lmer()-model fitted with a scaled response

送分小仙女□ 提交于 2019-11-27 02:24:57
问题 I fitted a model in R with the lmer() -function from the lme4 package. I scaled the dependent variable: mod <- lmer(scale(Y) ~ X + (X | Z), data = df, REML = FALSE) I look at the fixed-effect coefficients with fixef(mod) : > fixef(mod) (Intercept) X1 X2 X3 X4 0.08577525 -0.16450047 -0.15040043 -0.25380073 0.02350007 It is quite easy to calculate the means by hand from the fixed-effects coefficients. However, I want them to be unscaled and I am unsure how to do this exactly. I am aware that

Convergence error for development version of lme4

早过忘川 提交于 2019-11-26 23:57:10
问题 I am attempting to do a power analysis for a mixed-effects model using the development version of lme4 and this tutorial. I notice in the tutorial that lme4 throws a convergence error: ## Warning: Model failed to converge with max|grad| = 0.00187101 (tol = ## 0.001) The same warning comes up when I run the code for my dataset, with: ## Warning message: In checkConv(attr(opt, "derivs"), opt$par, checkCtrl = control$checkConv, : Model failed to converge with max|grad| = 0.774131 (tol = 0.001)

Plot random effects from lmer (lme4 package) using qqmath or dotplot: How to make it look fancy?

吃可爱长大的小学妹 提交于 2019-11-26 23:49:27
问题 The qqmath function makes great caterpillar plots of random effects using the output from the lmer package. That is, qqmath is great at plotting the intercepts from a hierarchical model with their errors around the point estimate. An example of the lmer and qqmath functions are below using the built-in data in the lme4 package called Dyestuff. The code will produce the hierarchical model and a nice plot using the ggmath function. library("lme4") data(package = "lme4") # Dyestuff # a balanced

use stepAIC on a list of models

一世执手 提交于 2019-11-26 16:48:14
问题 I want to do stepwise regression using AIC on a list of linear models. idea is to use e a list of linear models and then apply stepAIC on each list element. It fails. Hi guys I tried to track the problem down. I think I found the problem. However, I dont understand the cause. Try the code to see the difference between three cases. require(MASS) n<-30 x1<-rnorm(n, mean=0, sd=1) #create rv x1 x2<-rnorm(n, mean=1, sd=1) x3<-rnorm(n, mean=2, sd=1) epsilon<-rnorm(n,mean=0,sd=1) # random error

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