Skip to main content

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.

Filter by
Sorted by
Tagged with
0 votes
0 answers
8 views

Negative covariance matrix in RI CLPM (lavaan)

I am currently struggling to solve the problem of negative covariance regarding the latent variables with respect to the random intercepts in my RI CLPM model, which I calculate via lavaan. Here is my ...
JamesCraemer's user avatar
0 votes
0 answers
6 views

block bootstrap implementation for `gls` from `nlme`

I have several datasets of timeseries data (days) with an experimental intervention on some days, where some of the datasets cover multiple sites. I also have matching day-level and site-level ...
A. Donda's user avatar
  • 3,210
1 vote
1 answer
26 views

Multilevel Modeling in Linear Mixed Models versus Generalized Linear Mixed Models

I am analyzing a data set that includes several discrete and continuous outcome variables (DV). For the continuous DVs I intend to use Linear Mixed Models (LMM) processed in SPSS. For the discrete ...
Mark S.'s user avatar
  • 75
0 votes
0 answers
36 views

Advice on mixed effect model formula for R's lme4

I'm new to mixed effects modeling and definitely lme4 and would greatly appreciate some advice. My research question: what factors determine a business' number of online reviews per day? The data is ...
LearningScholar's user avatar
1 vote
1 answer
29 views

Issue with REML likelihood--logdet terms cancel

I'm trying to write an implementation of a linear mixed effects model using REML. I'm working with a simple model: $$ y_{ij} = X_{ij}\beta + Z_{ij}b_i + \epsilon_{ij} $$ In my case, the covariate $X$ ...
Alex's user avatar
  • 210
0 votes
1 answer
46 views

lmer - how to report results and group differences? [closed]

I want to test the effect of my treatment drug on different populations. I have 3 groups, tested at 3 time points, and one dependent variable. My data: ...
CAA's user avatar
  • 1
-1 votes
0 answers
16 views

Is factor with two levels set as random effect okay in GAMs? [duplicate]

a. Can covariate that are factors/categories that have 2 levels, such as yes/no or presence/absence, that also change spatial location from year to year have a smooth basis of “re” (bs=re)? Should it ...
frog_dan's user avatar
-2 votes
0 answers
39 views

Is factor with two levels set as random effect okay? [closed]

a. Can covariate that are factors/categories that have 2 levels, such as yes/no or presence/absence, that also change spatial location from year to year have a smooth basis of “re” (bs=re)? Should it ...
frog_dan's user avatar
-5 votes
0 answers
104 views

URGENT: I am building a Linear regression model. Yesterday my R-squared was 0.792. Today, it had dropped to 0.267. I did not change anything. Urgent [closed]

Thank you for your responses. By way of further information, I am using R-Squared because it is recommended for the project I am doing. Below are the 2 files. The one from yesterday with the 0.792 R-...
Sue's user avatar
  • 1
1 vote
0 answers
35 views

Issue with bootstrap confidence and prediction intervals of mixed effects model predictions [migrated]

Recently I have asked a question on how to generate meaningful bootstrap confidence and prediction intervals for mixed effect models predictions in R using bootMer ...
Marco's user avatar
  • 43
1 vote
1 answer
67 views

Which statistical test would you recommend for this experimental design?

I measured the percentage of individuals that crossed an averisve barrier at six different time points for four different genotypes. The barrier is made out of an aversive substance that the control ...
MarsC's user avatar
  • 23
0 votes
0 answers
14 views

An example problem of converting a maximum likelihood problem into a restricted maximum likelihood problem

I have a question about this derivation. What is an example value of the actual matrix $A'$ such that $A'X=0$, $A'A=I$, and $\frac{1}{n}\Sigma((A'Y_{i}-mean(A'Y))^{2}=\frac{1}{(n-1)}\Sigma((Y_{i}-...
A Friendly Fish's user avatar
0 votes
0 answers
7 views

Modeling Condition Specific Associations

I am trying to model a crossover repeated measures design in which individuals complete both the active and control conditions. These individuals also complete cognitive testing before and after both ...
user395624's user avatar
2 votes
1 answer
36 views

If measured in different time across days, should it be crossed or nested random effects?

everyone. I have a dataset that happiness was measured in morning, afternoon and evening(time of day) across 3-6 days for each subject. My two questions are: If I care about the relationship between ...
Eve's user avatar
  • 73
0 votes
0 answers
22 views

How do I correctly specify nesting in the sommer R package? [closed]

I am accustomed to lme4 where it would be simply: (1|genotype/root_ID) but it's unclear to me looking through the documentation the appropriate way to do this in sommer. mod1 <- mmer(Y ~ 1, random= ...
bigoof99's user avatar
1 vote
1 answer
22 views

Two-Way ANOVA or Mixed model

I have a dataset organized with time points on the x-axis: baseline (0 days), 3, 7, 14, 21, and 28 days. These time points correspond to periods where I measure deficit scores (y-axis) in animal ...
arefks's user avatar
  • 11
1 vote
0 answers
17 views

What are the implications of setting off-diagonal elements of estimated covariance to 0?

I have sometimes seen in published work that when estimating covariance matrices, off-diagonal elements are set to 0. For example, in this paper, $N$ neurons are recorded and authors wish to use the $...
dherrera's user avatar
  • 1,328
0 votes
0 answers
30 views

Multivariate LME

I am counting how often some patterns occur in many observations of timeseries data. I want to compare three conditions in two time intervals (so I average pattern counts over those intervals). There ...
KayPe's user avatar
  • 1
3 votes
1 answer
220 views

Can I include a variable related to the outcome variable into statistical analysis?

My research question is about the contact patterns during the pandemic and what characteristics of people who contacted more person during the national lock down. The outcome variable is a variable ...
Chao's user avatar
  • 73
1 vote
1 answer
63 views

Date as random effect in mixed model strongly changes coefficient estimates

I am struggling with the structure of a mixed model that I run with lme4. I have measured a behaviour (let's say reaction time) and another variable that might impact it (let's call it "mood, ...
BRB's user avatar
  • 33
0 votes
0 answers
45 views

Steps to conduct a linear mixed model and post-hoc comparison test

I would like to ask for your help with the best way to analyze the following experiment within R. Here is my design: there are 15 treatments, in four blocks. For each treatment, in each block, we have ...
Caio Mattos Pereira's user avatar
1 vote
0 answers
29 views

Degrees of Freedom in Emmeans

I am using the 'emmeans' package in R to compute estimated marginal means for my (liner mixed-effects) model. However, I am enountering a warning message related to the number of observations ...
babygould's user avatar
1 vote
1 answer
34 views

Selecting random effects in a linear mixed model when all participants complete all repeated measures?

Participants read 10 pairs of stories from Author A and Author B on 10 different topics (different topic for each pair). For each pair, they indicated whether they preferred Author A, Author B, or ...
statsexplorer2024's user avatar
1 vote
1 answer
21 views

Two-Way repeated measures ANOVA with multiple data points per measurement

I would like to perform a study with physicians of three levels of experience. They shall perform a task under three different conditions. For each condition, the task is performed multiple times (e.g....
Hiddigei's user avatar
3 votes
1 answer
44 views

What should I back transform beta coefficients when my dependent variable is fractionally exponentiated in R

I have this mixed effects regression model. To create a normal distribution in continuous scale dependent variable, I fractionally exponentiated it: ...
Nim Goldshtrom's user avatar
3 votes
1 answer
381 views

What is the mean of random effects?

Say, I have a mixed model: y = x + y + x:y + (1 + x * y | participant) What would be the mean of the random effects? Do they fluctuate around 0 or the fixed effects?...
rbeginner's user avatar
1 vote
0 answers
22 views

Modeling for a data set that has different number of factors for each row (not binomial) [closed]

The modeling issue I'm having is that the categorical variable for each row has different number of factors. If I can reshape the data by products (a,b,c,.....~cost, hoursum, numPod, numDate), so that ...
rocknRrr's user avatar
  • 121
1 vote
0 answers
47 views

gamm and gamm4 give very different smooth term results for mixed models with factor-smooth interaction

I am analyzing an longitudinal dataset which has two groups (patient vs controls; ordered factor) with brain volume data over time. Participants entered the study at different ages and have varied ...
adrianneurosci's user avatar
2 votes
1 answer
44 views

What is the best mixed model approach for a time series of animal attack records?

I have a dataset of animal attack records for Brazilian states between the years 2007 and 2022. I have three explanatory variables, which were standardized for the analyses. To incorporate the ...
Mauricio's user avatar
  • 131
3 votes
1 answer
38 views

Confounding Variable in Regression Model: Simpson's Paradox

I am working on a mixed effects regression model where Yi = exam score of student i. The explanatory variables are the following: Level 3: school type (public vs. private) and school's socioeconomic ...
Elena García's user avatar
1 vote
1 answer
28 views

Testing the effect of a continious IV on DV, in order to explain group differences

I would like to ask a question regarding an analysis I’m planning and it might be a basic question so, apologies in advane.... To describe the situation: There are two groups of participants in my ...
gfndngo's user avatar
  • 31
0 votes
0 answers
12 views

Is it possible to reuse predictor fixed parameters in a nonlinear mixed effects model fit across mulitple nonlinear response parameters using nlme?

I have data where I want to fit a model given that I know the value at time zero of one stage is equal to the asymptotic value of the previous stage. In particular, I have kinetic growth curves ...
wdkrnls's user avatar
  • 297
1 vote
1 answer
29 views

Fitting random slope for a subject-level predictor

In a nutshell, I am trying to understand whether it makes sense to include random slopes for group-level (or subject-level) predictors in a mixed effects model? Some Background: I am fitting a mixed ...
Stephanie Rivest's user avatar
3 votes
2 answers
146 views

Mathematical Prediction of Linear Mixed Models Random Intercept

Given data $\{(x_{i,j}, y_{i,j})\} \subset \mathbb{R}^2$, with $i = 1, \ldots, k$ classes and $j = 1, \ldots, n_i$. The linear mixed model is: \begin{equation*} y_{i,j} = a + b x_{i,j} + u_i + \...
温泽海's user avatar
  • 456
2 votes
1 answer
36 views

Longitudinal analysis of peer effect

I am working with hierarchical data (2 repeated observations on children nested within households), obtained from a RCT with 2 treatment groups. The primary goal of my analysis is to see whether the ...
Shen Shen's user avatar
0 votes
1 answer
45 views

If you have large group sizes (>1000), are there any differences between fixed + random effects models?

If you have large group sizes (>1000), are there any practical differences between using a fixed effect model and a random effects model? A concrete example might be where your individuals are all ...
Mohan's user avatar
  • 939
2 votes
2 answers
45 views

Mixed models - Intuition of correlated discrete random effects

I'm looking into this source and I'm trying to understand what does it mean to have "positive correlation between the random effects when the variables aren't continuous" In the link there ...
Lefty's user avatar
  • 499
2 votes
1 answer
43 views

Centering Variables in Multilevel Models with Longitudinal Data

Enders and Tofighi 2007 provide a discussion on the various ways users can center variables in multilevel models and when each situation is appropriate. While they largely focus their commentary on ...
Brian Lookabaugh's user avatar
1 vote
2 answers
59 views

What is the difference between a) multilevel modelling and b) adding a categorical IV to a multiple regression?

The examples of multilevel modelling I have seen are equivalent to treating the group as an extra categorical IV in a multiple regression. For example, if children are grouped into N classes, you ...
Mohan's user avatar
  • 939
1 vote
1 answer
46 views

When running a Bayesian mixed effects regression, if a random effect estimate has 95% CIs that include zero, should it be disregarded?

Consider a Bayesian mixed effects regression. I am interested in the correlation between two of the random slopes. However, the 95% CIs for the correlation value include 0. Should I disregard the ...
Dave's user avatar
  • 2,661
1 vote
1 answer
64 views

Validating Model Setup for Differential Abundance Analysis Using ANCOM-BC in R

I am conducting an analysis on microbiota data from a study involving 55 women, categorized by pregnancy status and BMI (lean vs. obese). The goal is to explore the differential abundance of ...
DeMelkbroer's user avatar
0 votes
0 answers
14 views

Solving mixed effects model by hand [duplicate]

coming from this discussion, in layman terms why one should use optimisation algorithms to estimate the parameters of a multilevel model? Why a simple model such as ...
Lefty's user avatar
  • 499
3 votes
1 answer
53 views

Bootstrap confidence and prediction intervals of mixed effect model predictions

Let's say I fitted a mixed effect model mem with the lme4 R library, and I would like to use the ...
Marco's user avatar
  • 43
1 vote
2 answers
87 views

Modelling longitudinal pre-/post-intervention data

I have longitudinal data of a number of patients for which some biomarker was measured at irregular time intervals over the course of several years before treatment and over a shorter period of time (...
Gods_gift_to_biostatistics's user avatar
3 votes
1 answer
52 views

The default covariance structure implicitly assumed in the brms formula

Background: The brms official page provides the following example code to illustrate the usage of the package: ...
Hirofumi Shiba's user avatar
7 votes
1 answer
160 views

General Linear Mixed Model: How do I fix 'Rescale variables? Model is nearly unidentifiable' error on glmer

I'm trying to fit a generalized linear mixed model (GLMM), but I'm getting a persistent error. I'm looking at the relationship between weather (continuous variables: rainfall, maxtemp, and mintemp) ...
Hazel's user avatar
  • 71
1 vote
1 answer
41 views

LME4 model producing strange p values

When modelling QPCR data using LME4 I am getting a result that tells me my treatment effect is insignificant. When I plot the data this looks wrong and if I use JMPpro the p value for Treatment is ...
Mikeed's user avatar
  • 11
5 votes
1 answer
82 views

Regression Modelling using lme4 in R

I have GPS collar data on a species of desert gazelle throughout different seasons and want to model the effect of seasonal changes in weather patterns on their movement patterns (e.g. daily distance ...
rhyncogale's user avatar
0 votes
1 answer
66 views

Moderation coefficient in linear mixed models SPSS - interpretation

My model: IV: extroversion (5 point likert) Moderator: Comepetence (values 1-5) DV: Offer (values 5 to 15) Hypothesis: The negative relationship between Extroversion and offer is moderated by ...
breeks's user avatar
  • 21
0 votes
1 answer
46 views

Emtrends pairwise comparisons all have same standard errors. 3 way interaction

I have created a linear mixed model and am using emtrends to determine the impact of a dichotomous variable on the effect of a continuous variable, across levels of a categorical variable. Is it ...
Jackson's user avatar
  • 11

1
2 3 4 5
131