Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [mixed-model]

Mixed (aka multilevel or hierarchical) models are linear models that include both fixed effects and random effects. They are used to model longitudinal or nested data.

0
votes
0answers
6 views

Mixed effect model covariance prior

How should I choose the covariance prior for my bglmer model? This is a model which has the singularity problem. ...
0
votes
0answers
16 views

Serial correlation structures with two nested random intercepts

This is a Gaussian model of spatial correlation: \begin{align} \boldsymbol y &\sim N(\mu, \boldsymbol V), \text{ where} \nonumber \\ \mu_i &= \ldots \text{ (depends on fixed effects of the ...
0
votes
1answer
30 views

Degrees of freedom in a linear mixed model (or ANOVA) - Categorical factors versus continuous numbers

I have data from 20 individuals. In general, each individual has measurements (i.e., called Value below) from the Left and Right arm taken at different months in ...
0
votes
1answer
34 views

Can you perform a likelihood ratio test on two linear mixed effects models with different optimizers in lme4?

I ran into an error with my full (but not simple/null) model, so I had to use a different optimizer to avoid the fitting problems. Can I still do an LRT test using those models?
0
votes
2answers
30 views

The correct random slope model for nested data

I'm trying to see how personalities of individuals change with time. The variables in my data are: 1. latency to emerge (response variable in continuous scale) measured for 204 individuals from 14 ...
0
votes
1answer
40 views

R code glmer: Different results with same data

I'm trying to run a mixed model analysis and so far I've found two ways to write a negative binomial distribution model for my data: ...
0
votes
0answers
11 views

Introducing random slopes in models with nested random effects

I'm trying to see how latency to emerge (response variable) is varies with time (trials). Individuals (ID) are nested within colonies. The nesting is such that individuals 1-20 belong to colony 1, 21-...
0
votes
0answers
24 views

glmer in R, complex random effect

I'm trying to run a mixed model analysis with a negative binomial distribution. Here is the code and the result: ...
0
votes
1answer
16 views

Equation for solving for a variable value of a GLMM probability equation

I am trying to solve for a value of x given all the values of the other x's and at a set value for πij. For example .5 = e^(20 + 10(1) + 15(1) + 20(x3) + 3 + 2)/ 1+ e^(20 + 10(1) + 15(1) + 20(x3) + ...
0
votes
0answers
24 views

Warnings using glmer() in R

I'm trying to analyze the differences in the number of plant species found in different types of fields. The number of species per sample is a non-integer because I had to adjust the number to account ...
0
votes
0answers
22 views

How can i plot a linear mixed model

i have constructed a mixed model for a nested design. i have attached it below: A researcher observes variation in wing size in a beetle species in South-America and wants to know whether wing size ...
-1
votes
0answers
22 views
0
votes
0answers
21 views
1
vote
0answers
15 views

Poor error control in hierarchical linear models with lagged, within-person-centered independent variables

I'm interested in assessing the performance of a multi-level model (aka hierarchical linear model, aka linear mixed effects model) when examining time-lagged associations. My interest is in making a ...
0
votes
0answers
20 views

Post-hoc test on linear mixed effects analysis comparing two treatments over time

I am trying to analyze my data in R and I would like to ask, if what I have done so far makes some sense, and how I could proceed. Let me try to explain my data first: I have two different treatments ...
2
votes
1answer
31 views

Mixed effects model failing to converge - better to remove the random intercept? slope?

I have data for classes that are nested within schools There are two classes for most schools (n = 240), but I also have some schools with which I have more than two classes. i.e., 20 schools with ...
0
votes
0answers
13 views

Genetic correlation in R (partitioning correlation in mixed models)

I've no issues understanding the ins-and-outs of partitioning variance into random and fixed effects components. But I cannot, for the life of me, visualize partitioning correlation (or covariance) in ...
0
votes
1answer
31 views

Calculating Log-Likelihood of Logistic Adaptive-Quadrature GLMM for Comparison with Fixed Model

Fitting a binary logistic GLMM here, with ungrouped data (all responses either 0 or 1). It says in this thread and in the documentation of anova.merMod that the ...
2
votes
1answer
38 views

Introducing random slopes in nested model improves model fit but residuals variances become unequal

I have measured boldness scores (continuous variable) across time (trials) for individuals (ID) within colonies (colony). The data is coded such that individuals 1-30 belong to one colony, 31-60 to ...
3
votes
2answers
63 views

Mixed Effects Model: Writing Out Level 1/Level 2 Models

Suppose I have an LMER output (using Grunfeld data from plm package) as: ...
-2
votes
0answers
18 views

How can we test the random intercept if it statistical significant? [closed]

Explain how you would test whether the option random=~1|patid in the model cAR1.1 is statistically significant. Give the R code you would use to test that, and how you would draw your conclusion <...
0
votes
0answers
8 views

selecting the appropriate model in longitudinal data analysis

my target is to determined the factors that affect CD4 cell count change and WHO stages(stages of HIV infections) jointly for HIV patients on ART. It's known that CD4 cell count is discrete and WHO ...
1
vote
1answer
50 views

LME residual plot returns a huge linear block of residual points

The publicly available data I used https://content.sph.harvard.edu/fitzmaur/ala2e/cd4.txt I addressed the unbalanced followup visits by transforming the visit time to the nearest multiple of 8 then ...
0
votes
2answers
58 views

Overall effect of time in mixed model before looking at individual time points

I have a mixed model using factor(time) as fixed effect and subject as random effect. So the format is like this: ...
2
votes
1answer
56 views

Explaining tourist numbers over time to historic sites, based on a set of predictors

I've been struggling for some time trying to figure out the most appropriate way to analyse some data. My task is to (hopefully) explain what may be driving the flow of visitors/tourists to two ...
2
votes
1answer
44 views

Comparing linear mixed effects models using ANOVA - underlying assumptions

I am trying to analyze some CPUE (Catch Per Unit Effort) data for a fisheries related analysis with lme models in R. So I have total of six models that are tested in groups of two to determine the ...
1
vote
1answer
46 views

Assumptions of linear mixed model not met

I have a repeated measures dataset with which I'm testing if individuals are consistent in their boldness scores (continuous variable) over time (trials). Towards this, I generated linear mixed ...
2
votes
1answer
26 views

Doing a multilevel model using lmer with participants nested in time - should time be a factor or not?

I am using function lmer() within package "lme4". Repeated-measures design with 4 time points, data is in long format. The time points are equidistant apart. Should I treat that variable as an integer,...
0
votes
0answers
48 views

How to Interpret the result of generalized linear mixed model?

I ran a generalized linear mixed model using lmer in R, and I'm struggling how to interpret the result. The response variable is a result of 25 consecutive binary choices. The point where I'm stuck is:...
0
votes
1answer
26 views

Is there a way to run a multivariate mixed effects model (e.g. RDA) with an unbalanced number of observations per level of the random factor?

I have a community matrix (fish gut microbiome) from a laboratory experiment consisting of 2 treatments, each with 3 independent aquaria, which were sampled 3 times. At each sampling event 6 fish were ...
1
vote
1answer
19 views

Modelling with a delay

Im just at the stage of looking at my data and seeing how I can model it. My data is on the cooling effect of tree shade given various measured tree variables but to make the model useful I also need ...
1
vote
1answer
43 views

How can I test whether two logistic regression coefficients are identical?

3 variables (1 continuous (X) and 2 categorical (A & B)) predict 1 dichotomous variable in logistic regression. Both variables A and B are dichotomous and are coded with 1 (reference category) ...
2
votes
2answers
75 views

glmer fitting different models if binary variable is integer 0,1 or factor

This seems like a relatively basic question, but I can't find good pointers after two days of searching. I am trying to fit a generalized linear mixed model to data obtained in an experiment. The ...
1
vote
1answer
43 views

glmer model in r, negative slope for a predictor, data seems to have positive slope

I fitted a glmer model to my data in r (with package lme4), one of significant fixed effects (order, which is continuous) has a negative estimate. But when I graph the averaged data, it seems to have ...
0
votes
0answers
14 views

BIC under linear mixed model

I know usually, we do not use Bayesian Information criterion(BIC) for model selection if we have a linear mixed model (problems involve like the sample size in the linear mixed model is not well ...
2
votes
1answer
30 views

Why does gls model without random effects yield a similar fit to mixed effects model?

I am trying to answer a question from Pinhiero and Bates Mixed Effects Models in S and S-Plus, explaining how random effects fail to confer any benefit over a gls model that has mixed effects. This ...
0
votes
0answers
13 views

Sommer R package [closed]

I have a few questions about the mmer2 function in sommer package I am using the function to estimate the heritability of a (...
0
votes
0answers
27 views

Mediation analysis with depent observations. Is it possible with mixed models?

I wonder whether it is possible in principles to conduct a mediation analysis with dependent measures. The problem is of course that we are violating the assumption of independence of observations. ...
2
votes
1answer
50 views

Construct piece-wise linear mixed effect models

I'm looking at the BMACS dataset(data(BMACS)), and is trying to construct a local constant fit without covariates using base functions B1(t) = 1 for t < 2, B2(t) = 1 for 2 <=t <4 and B3(t) = ...
0
votes
0answers
19 views

GLMM with many and highly correlated features

Lately I came upon a very interesting project, which also made me thinking since it was the first time for me to work on such data. So, I have 2-level data, with 60 participants having 2-3 ...
1
vote
0answers
21 views

How could the size of the beta coefficients change order after log-transforming outcome variable?

I had a mixed effects model where the residuals were not normally distributed, so I log-transformed the DV to meet the assumption. There is one fixed effect with 3 categorical levels (L1, L2, L3). ...
2
votes
1answer
25 views

Repeated measures models multiple testing adjustment

Perhaps I am missing something obvious here, but I can't find an answer to this. Let's say we run 10 individual repeated measures models with factor(time) as fixed effect with 5 separate timepoints ...
1
vote
0answers
23 views

Difference between random slopes and a random intercept for each combination of a random:fixed effect?

In a mixed effects model, I'm trying to understand the distinction between the following two models: y ~ group + (1+group|subject) and ...
-1
votes
0answers
27 views

Weird results in ANOVA: the three-way interaction has a pvalue of exactly 1

I am running a three way interaction, predicting 'judgment' from 'factor_1' (between subject, two levels), 'factor_2' (between subject, two levels) and factor_3 (within subject, two levels). I have ...
0
votes
0answers
68 views

Singular fit (or not) for 2 seamingly identical mixed effect models and questioning the validity of a random intercept

This is a follow up question to this first question : First question I have two seemingly identically structured datsets ...
0
votes
1answer
32 views

Paired t-test following main effect of mixed model with missing data

I am analyzing data for a repeated measures study with missing data. For example here is a 3 X 3 experimental design with three conditions and 3-time measures: I am using a mixed model for the main ...
0
votes
0answers
26 views

inflated and inconsistent degrees of freedom using Satterthwaite's approximation with lme4 and lmerTest

In an unbalanced ecological dataset of 32 plots with 2 observations each, we conducted lmer-models on 3 different dependent variables representing abundances (individuals1 and individuals2) and ...
0
votes
1answer
22 views

Unbalanced Longitudinal Multilevel Model Power Analysis

I am trying to conduct a power analysis on a multilevel longitudinal model (pre-existing household panel dataset) and am having trouble figuring out how to do it (or if it is even needed in the first ...