Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 87305

lme4 and nlme are R packages used for fitting linear, generalized linear and nonlinear mixed effects models. For general questions about mixed models use [mixed-model] tag.

9 votes

longitudinal data with unequal samples and end points

I believe that you are fine to use the approach you outlined in your question. There is more between id variance at time==0 (the random intercept) than there is in the rate of change (random slope for …
Erik Ruzek's user avatar
  • 5,890
6 votes
Accepted

Clarification on Random Effects Structure in Linear Mixed Models in R

The answer depends a bit on how your country and id variables are coded. Is it the case that: a) In each country the numbering for individual ids starts at 1? or b) In country 1 you have ids 1-10 a …
Erik Ruzek's user avatar
  • 5,890
5 votes

Difference between Fixed Effects predictor Value and ggeffects predicted values

Keep in mind that the parameter estimate for PC1 in the lmer model summary is conditional any variables that PC1 is interacted with. In this case, you interacted PC1 with DominancePatternCod and WTW. …
Erik Ruzek's user avatar
  • 5,890
4 votes
Accepted

lme4: what is gained by scaling variables?

You mention that you cannot properly interpret the coefficient of a standardized variable, and I would disagree. Imagine you have a variable that is scaled from 0 to 100. A 1-unit difference in such a …
Erik Ruzek's user avatar
  • 5,890
4 votes

multilevel modeling with lmer(): understanding failure to converge in a toy example

Building on @Emma Jean's response, Your created data frame is not multilevel in the sense that person (the grouping variable) and female are at the same level. In order for your data to accommodate a …
Erik Ruzek's user avatar
  • 5,890
4 votes

Follow-up: Complete-pooling, no-pooling, and partial-pooling regression in R

The problem is that sch.id is stored as an integer (see str(d)) and in order for it to work as intended for the no pooling model, it needs to be treated as a factor variable. You can do this either by …
Erik Ruzek's user avatar
  • 5,890
4 votes
Accepted

Multi-level model [lme4 package] specification with cross-level predictors and group-level o...

You are on the right track, but there are some key things to keep in mind. In multilevel or mixed models the dependent variable has to be at the lowest level of the hierarchy. In the case of your indi …
Erik Ruzek's user avatar
  • 5,890
4 votes

Modeling repeated measures data in R - Interpretation and Validation

To help make your original regression results more interpretable, I suggest that you code timepoint such that the first occasion is given a value of 0. This is because in regression models, the interc …
Erik Ruzek's user avatar
  • 5,890
4 votes
Accepted

Specific group effects (coefficients) in mixed-effect modeling in R (lmer)

This is a great question that hits at one of the superpowers of multilevel or mixed effects models, in my opinion. In your example, A, B, and C all vary within groups but, very likely, groups vary in …
Erik Ruzek's user avatar
  • 5,890
4 votes
0 answers
134 views

Can we identify whether random effects are nested or crossed from a lme4 fit?

My colleagues and I are working on a suite of lmer post-estimation tools for a R package we are developing. One of the tools is an ICC function that would calculate the appropriate ICC for models with …
Erik Ruzek's user avatar
  • 5,890
3 votes
Accepted

Multilevel Modelling , 2 level -statistical significance test on random effects

Welcome to the site, Zubaer. There is no equivalent significance test for random effects as there are for fixed effects. Instead, you can run model comparison tests, in which you run a likelihood rati …
Erik Ruzek's user avatar
  • 5,890
3 votes

summarize extent of pooling or shrinkage in multilevel models estimated with lmer()

Fleshing out Dimitris' comment, you can look at this by considering the estimates you get from lmer and lm. Using your lmer model, we can ask for the estimated intercepts and slopes with the coef() fu …
Erik Ruzek's user avatar
  • 5,890
3 votes

low marginal and high conditional R2 for mixed models

According to the documentation for r2_nakagawa, The marginal r-squared considers only the variance of the fixed effects, while the conditional r-squared takes both the fixed and random effect …
Erik Ruzek's user avatar
  • 5,890
3 votes
Accepted

Imputing panel data in the wide format, obtaining pooled standard errors after using lmer

If the imputed datasets are in long form (dataset 2 stacked onto dataset 1) then you can use mitml the to do the pooling of the estimates from your model to give you the correct standard errors. See t …
Erik Ruzek's user avatar
  • 5,890
2 votes
Accepted

Mixed model with random slope and Intercept syntax?

Some thoughts on each of your assumptions: I want to assume that measurements that are further apart in time are less correlated than measurements that closer (random slope). In theory, t …
Erik Ruzek's user avatar
  • 5,890

1
2 3 4 5
15 30 50 per page