# 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.

3,851
questions

**1**

vote

**0**answers

11 views

### Linear mixed effects model. Two independent groups and six measures

I am currently working on a study regarding a psychotherapeutic intervention for anxiety. In my dataset I have:
Two groups: experimental vs control
6 time points
dependent variable (DV): anxiety
I ...

**0**

votes

**0**answers

12 views

### Modeling Marketing Sales

I am working on a problem in which I have daily Sales and daily Offline and Online Marketing Spends. I built a linear regression model where Sales = f(Online Spend, Offline Spend, Lag Sales) at rolled-...

**2**

votes

**1**answer

39 views

### Mixed effects modeling using R with time varying predictors

I have a data set where the response (dependent) variable measured only at a single time point. However the predictors can be both longitudinal as well as measured at a single time point. Here is an ...

**0**

votes

**0**answers

11 views

### Manual calculation of standard error for a comparison using error-covariance matrix

I am testing the effect of prior training on the ability of two groups to learn from an intervention. Learning is measured by correct response to a task, before and after an intervention (factor time: ...

**0**

votes

**0**answers

16 views

+150

### Using a mixed linear model to evaluate responses in a RCBD experiment?

I am new to mixed linear models, so I have a question about them.
I have a plant study (being intentionally vague here to achieve confidentiality) evaluating plant senescence rates (leaf death) in an ...

**0**

votes

**0**answers

8 views

### Misleading Estimated Marginal Means in Zero-inflated Mixed Models

I am working with a number of zero-inflated poisson and nbinomial mixed models (with an offset), but when I produce estimated marginal means from them they are sometimes many orders of magnitude ...

**0**

votes

**1**answer

21 views

### Effect size and power analysis for zero-inflated negative binomial mixed models

I'm working with a zero-inflated dataset (confirmed using vcdExtra::zero.test) of bat calls per unit time (i.e. bat activity), which I'm relating to the occurrence ...

**1**

vote

**1**answer

18 views

### individual vs group characteristics in mixed models

Let's say I predict that there will be sex differences in test scores depending on school. I also have a predictor at Level 1, which is ...

**1**

vote

**0**answers

13 views

### R liner mixed model question: mixed factorial design, how to set up random effects?

I am new to R and would like to run linear mixed model on reaction time data. I have 2 between-subj factors (Factor 1 and Factor 2) and 2 within subj factors (Face and Valence), so a 2 x 2 x 2 x 2 ...

**0**

votes

**0**answers

6 views

### How do you compute ICC in a gamma loglink glmm?

I have fitted a gamma generalised linear model with a log link in r using glmer from the package lmer. The goal is to make prediction models for age in old trees for conservation purposes. The choice ...

**0**

votes

**1**answer

45 views

### Using a generalized linear model vs generalized mixed effect linear model

I conducted a study with 28 subjects to measure the effect of an intervention. Thus, I have 3 data points from each subject: pre-treatment, treatment, and post-treatment.
I tried running a ...

**2**

votes

**1**answer

16 views

### How does the “intervals()” function from {nlme} in R perform inference on variance components?

The help page doesn't specify which method this function is using.
If I understand correctly, lme4 uses bootstrap to get the CIs, but I don't think the "intervals()" function from {nlme} uses ...

**0**

votes

**0**answers

11 views

### How to compute custom contrasts for linear quantile mixed model from lqmm

I would like to get custom pairwise contrasts and Holm adjustment for a linear quantile mixed model generated using the lqmm and glht functions, but my attempt generates an error. For comparison, I ...

**1**

vote

**0**answers

21 views

### Which ANOVA method to use to compare variance explained between four lmer (linear mixed effects) models in R

Suppose I have four linear mixed effects models as shown:
...

**2**

votes

**0**answers

71 views

+50

### Analyzing repeated choice data with respondent and item covariates: Sanity check on my model

For bounty, TL;DR: Read the Setup, Hypothesis, and Update 2 sections. Is that model valid in terms of handling Type I and Type II errors, accounting for dependencies in data? Everything else is more ...

**4**

votes

**1**answer

59 views

### How to account for multiple raters in an exploratory factor analysis?

I have a dataset on which I want to perform an exploratory factor analysis. There are ~150 subjects that are rated by ~25 raters on ~70 items (the items are about certain behaviors of the subjects). ...

**1**

vote

**0**answers

31 views

### What is analysis of deviance in linear mixed effect models?

I am using lmer in R. My response variable is gene expression (15 genes altogether, just using one in the example) and my fixed effects are disease status and also age. My code is as follows;
...

**0**

votes

**1**answer

20 views

### Unable to show satisfaction of assumptions for a Linear Mixed Model

I conducted a virtual reality study in which the test persons had to select objects with different forms of interaction. I varied the object size, the object density and the distance to the object. I ...

**0**

votes

**0**answers

23 views

### Non Linear model curve fitting

I want to find the best curve fitting for my model of type:
y=a1f1(x)+a2f2(x)+a3f3(x)
where, (xi,yi), iā{1,2,...,n}
Now I need to find the parameter vector (a1Ė,a2Ė,a3Ė) that best fits the data, ...

**1**

vote

**0**answers

28 views

### Why isnāt error $\epsilon_i$ just considered another random effect?

I am recently learning about mixed models.
Consider a typical linear model:
$$y_i=a+bx_i+\epsilon_i,$$
where $\epsilon_i\sim N(0,\nu^2).$
Can the error term $\epsilon_i$ be considered a "random ...

**0**

votes

**0**answers

19 views

### Correct mixed model specification for mixed factor experiment

We have performed and experiment using a 3 (between: called condition) x 2 (within: called blockDiff) subjects design, measuring ...

**2**

votes

**1**answer

54 views

### How do you include change in a variable over time across participants within a GAMM framework?

I am really struggling with trying to understand how to specify a GAMM model that predicts Y from the changes in two variables X1 and X2 over time across multiple participants over a varying amount of ...

**0**

votes

**0**answers

30 views

### Understanding differences between lme4 versus geeglm

I recently started exploring the growth curve models or mixed models using lme4, and came upon marginal models in literature. The main difference lies in interpreting parameters, i.e. "in marginal, ...

**0**

votes

**0**answers

14 views

### Should I do some sort of mixed effects model or repeated Anova with my data?

I am wondering if I should be doing a mixed effect model or repeated ANOVA with my data. I am looking at feeding in sponges, particularly picoplankton which are in 5 groups (Pro, Syn, Euk, LNA, HNA). ...

**1**

vote

**1**answer

27 views

### how to model data with repeated measures but a low number of random-effect levels

I want to model the productivity of a beech forest in relation to satellite-based indices of photosynthetic activity and meteorological variables. I have data for five years on the number of seeds ...

**1**

vote

**1**answer

30 views

### I need help specifying my lmer model

I have a question to setting up my lmer model.
I have measures of two groups of participants. Each participant was measured twice on two separate days (before and after; b_a).
I want to find out if ...

**0**

votes

**0**answers

24 views

### SPSS mixed-effects model vs Matlab FITLME : inconstistent results in estimated coefficients

I am trying to double-check the results I am getting with the matlab fitlme function by comparing it with the output of the SPSS MIXED procedure.
The results of the F tests match perfectly, while the ...

**0**

votes

**1**answer

26 views

### How to compute contrats between levels of a parameter in bayesian mixed-effects models and produce bayes factors in R?

I would like to compute contrats between different levels of a parameter from my bayesian mixed-effects models in R, and produce bayes factors. My outcome (Jud) is binary (1=Yes/In synch, 0=No/Out of ...

**0**

votes

**0**answers

10 views

### How to extract cumulative hazards from mixed-effect survival models?

I'm struggling to extract cumulative hazards from mixed-effect Cox models in R. I managed to extract survivals for each random level separately, but is there a way to obtain overall survivals ...

**0**

votes

**0**answers

9 views

### Issues with switching between discrete and continuous time in a linear mixed model

I'm confused why switching from discrete time to continuous time is not more of an issue.
While talking about animal survival data from day 1, day 2, & day 3 in an exposure experiment, the ...

**1**

vote

**1**answer

18 views

### Run mixed effect model where one fixed effects shows no variation within the random factor levels

I want to run a mixed effect model to test the effect of temperature and SLA on Herbivory. In my case, the random factor is plot since my samples are nested within ...

**2**

votes

**3**answers

89 views

### difference in standard errors between 2 seemingly equivalent models

Consider a crossed design with 3 operators and 4 instruments.
Interest is in the instrument effect.
Could you explain me the difference in standard errors of the fixed effects between the two ...

**0**

votes

**0**answers

11 views

### JointLCMM “the leading minor of order 1 is not positive definite” error

I am using JointLCMM to model trajectories of a dynamic risk variable while controlling for competing events (censorship, event-type1, event-type2).
My code is written as
...

**0**

votes

**1**answer

47 views

### Mixed Model: Ridge Regression and Data Augmentation

Supposed I have a mixed model in the form: $$y = X\beta + Zu+ \varepsilon$$
If I want to enforce a constraint on the $\beta$s can I follow the data augmentation approach that @whuber mentioned here: ...

**2**

votes

**1**answer

35 views

### Estimate correlation in non-normally distributed (e.g. Poisson), unbalanced, repeated measures data

I have a large behavioural data set, and I would like to measure pairwise correlations between several of my outcome variables, and binned categories of outcome variables. However, I have multiple '...

**1**

vote

**1**answer

31 views

### Interpreting quadratic trend coefficients in a repeated measures logistic regression

I conducted an experiment where people either endorsed or did not endorse a statement at the commencement of a one-week training session, at the end of the one-week training session, and at a follow-...

**0**

votes

**0**answers

43 views

### Creating positive definite matrix correlation matrix

This question is moved from the computational science stackexchange: http://scicomp.stackexchange.com/questions/34659/creating-positive-definite-matrix?noredirect=1#comment64520_34659
I'm trying to ...

**1**

vote

**2**answers

44 views

### How to test for the significance of a “simple random slope” in R (lme4)

I am conducting a linear mixed model involving two levels with the lme4 package in R: individual respondents are nested within country (a random factor). There are several predictors that I let vary ...

**1**

vote

**1**answer

37 views

### Variable selection with bayesian linear mixed models (the brms package)

I am fitting a bayesian linear mixed model in R with 6 variables and 2 random effects. Inclusion of all 6 variables is motivated by a well-founded hypothesis. Does it make sense to do variable ...

**0**

votes

**0**answers

18 views

### The correct way to test a main effect by comparing mixed-effects models using anova() in R

I want to compare two mixed-effects models using anova() for the main effect of a fixed factor. I understand the test will compare the baseline model including the ...

**3**

votes

**1**answer

57 views

### Understanding Random effects model - Binary Logistic regression

For the mixed effects (random slope) binary logistic regression model the logit can be expressed as (Applied Logistic Regression (2010) - David W,HOSMER, JR.):
$$g(\boldsymbol{x}_{i,j},\alpha_i,\...

**0**

votes

**0**answers

9 views

### Running a SAS's NLMIXED model with R's nlme function

I would like to translate this SAS command into its R equivalent:
...

**0**

votes

**0**answers

15 views

### difference in effect strength / effect significance depending on number of included effects in mixed model

I am very new to mixed random effect models and am struggeling with the interpretation of the output:
I set up a model with 1 random effect and 3 fixed effects (I will name these A, B and C).
The ...

**0**

votes

**1**answer

27 views

### T-test with multiple measures per subject

Imagine to have 100 people who have been asked if they are happy 10 consecutive times (time here is not important). Each time we asked, we showed them a card of one color: sometimes green, sometimes ...

**0**

votes

**0**answers

13 views

### How to use discrete choice models on market share for products?

I have a dataset on market share of products by time-period. Total observations is 26622. Total unique time period is 41. Unique products are around 638. There are time column, product column, price ...

**1**

vote

**0**answers

18 views

### What is the EVD operation that replaces Cholesky decomposition in lme4qtl R package?

I am working with pedigreemm and lme4qtl R packages.
If I understand it correctly, both are extensions of the lme4 package, which doesn't allow for correlation between random effect clusters, and so ...

**1**

vote

**0**answers

32 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 ...

**0**

votes

**0**answers

10 views

### Glmer mixed model with many parameters. Better convergence or more precise estimation?

I have a complex model logistic model of the form:
cbind(Cases, Pop - Cases) ~ X * log(X) + (X * log(X) | Country)
The model has difficulties converging given ...

**1**

vote

**0**answers

28 views

### How are the entries of a random effect matrix (Z) in a linear mixed model determined?

I am working with linear mixed effect models in lme4 and I struggle to understand how the random effect model matrix (Z) works in this context.
Suppose I have a ...

**2**

votes

**1**answer

46 views

### Should I use a multilevel model if I have lots of observations?

I have a dataset with data for 284,000 trips. The trips are grouped into nine cities. The number of trips per city varies between 3,446 and 89,000. I am predicting trip time with seven independent ...