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
Make your voice heard. Take the 2019 Developer Survey now

Questions tagged [lme4-nlme]

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

0
votes
0answers
5 views

Large N Large T Unbalanced Panel - Serial Correlation

I have an unbalanced panel data, which consists of 180 vintage groups. The ith group will have time series length of t=181-i. For example, Group 1 will have 180-month observations; Group 2, originated ...
0
votes
1answer
32 views

Odds Ratio from Linear Regression?

Maybe a stupid question, but can I calculate Odds Ratio's from a linear regression model? Or is it only possible / allowed on a logistic model? (I have a linear mixed-effects model and I use r and ...
0
votes
0answers
10 views

glmer model convergence question

We are working with a longitudinal dataset, with three variables: WAIP, BPSRRI and group. WAIP and BPSRRI are measured repeatedly for 10 times and group refers to the group assignment of our subjects ...
0
votes
0answers
22 views

Generalized linear (mixed?) model with imbalanced nested data

I am unsure how to optimally model a data set obtained from a crude experiment to compare performance of two plastic molding tools used to manufacture widgets. Widgets are tested and results are ...
0
votes
1answer
24 views

finding outliers in mixed model [duplicate]

I'm trying to find outliers in this mixed model: m1 <- lmer(y ~ service + lectage + studage + (1|d) + (1|s), data=InstEval) So I used the ...
2
votes
3answers
54 views

Mixed-model ANCOVA using nlme in R: How do I interpret and report significant interaction effects?

I've got a significant interaction effect and I'm unsure how to interpret and report the results. In my experiment, I've got plants planted inside fences to protect them from deer (fence plots) and ...
1
vote
0answers
16 views

glmer post hoc test at each time point

I have a question about post hoc tests for glmer. I haven't been able to find a solution on this site or in the documentation. My experiment looks at repeated measures of flower counts (Total) across ...
0
votes
0answers
27 views

adding nuisance covariates to mixed-model [duplicate]

I have a mixed-model with several predictors of interest and I also collected additional nuisance covariates that are not really interesting but which I would like to control for in my model. For ...
1
vote
1answer
34 views

Extremely large difference in AICs between two models

I am currently fitting a mixed model where I analye longitudinal trends in migration between country pairs (68335 observations nested in 6442 groups). One of the first questions I wanted to have ...
0
votes
0answers
14 views

Mixed effects model - use dummy variable to correct to reference/standard? [closed]

I'm doing a mixed effects model that can be described generically (I'm doing a chemistry problem) as such; House price varies with distance from the centre of town. I'm fitting this as a quadratic ...
0
votes
1answer
85 views

Model interpretation lmer?

I have 139 subjects (ID), with measurements taken at two time points (Time1, Time2), at 148 brain regions, a dependent measure called volume, and a covariate called thickness. Each subject has 148 ...
0
votes
1answer
48 views

Linear mixed model for placement of nuclear stress in 10-word turns

I'm trying to model the placement of nuclear stress in 10-word turns in a linear mixed model but am very new to mixed modeling. The model includes these variables: ...
4
votes
0answers
84 views

Mixed-effects logistic regression

I'm new to data analysis and I'm trying to perform a mixed-effect logistic regression. My data look like this: ...
0
votes
1answer
49 views

Fitting model with unstructured covariance matrix with gls in R

Consider the following dataset: library(nlme) library(lme4) data<-sleepstudy data<-data[data$Days<5,] data$b<-sample(0:1,nrow(data), rep=T) I am ...
0
votes
1answer
38 views

How to control for age in analyzing longitudinal data using mixed effects regression

I am analyzing a longitudinal dataset. Elderly subjects perform a cognitive test once a year, for five consecutive years. I want to know if there is a decline in their performance through the study ...
2
votes
0answers
10 views

Comparing means of two experiments over time using LME

I have conducted a lab study on ocean warming and corals using an aquaria tower with 3 levels á 4 aquaria. Each level depicted one temperature treatment (2 heat treatments and 1 control): Level 1 = ...
3
votes
0answers
69 views

Is the use of loglik or AIC to compare logit/probit/cloglog models valid?

I would like to know whether I can use AIC, or if the models have the same number of predictors, the log-likelihood, to compare logit vs probit vs cloglog models (fitted for instance with glmer or ...
1
vote
1answer
50 views

Lmer set up for repeated measurements?

I have 139 subjects (ID), with measurements taken at two time points (Time1, Time2), at 148 brain regions, a dependent measure called volume, and a covariate called thickness. Each subject has 148 ...
0
votes
0answers
11 views

One sample T-test with covariates lmer? [duplicate]

I have 139 subjects (ID), with measurements taken at two time points (Time1, Time2), at 148 brain regions, a dependent measure called volume, and a covariate called thickness. Each subject has 148 ...
1
vote
0answers
23 views

lme4 syntax for random effect nested under fixed and random effects

I have data looking at the performance of thousands of one-vs-all binary classifiers trained for an image recognition task under different conditions. I'm trying to use ...
1
vote
0answers
12 views

Determining nested or crossed random effects in study design

I've found several versions of the canonical example of nested random effects about classes in schools or students in classes.. However, I'm still having a hard time connecting the school/classes/...
0
votes
0answers
6 views

Model and posthoc comparison for categorical dependent variable predicted by mixed (between and within) factors

I want to predict a categorical outcome variable (A or B) by 3 independent variables. Two of these are within (FactorWithin = 2 levels; FactorWithin2 = 5 levels) and one of them between (FactorBetween ...
5
votes
2answers
118 views

Completely different results from lme() and lmer()

I've been playing around with both nlme::lme and lme4::lmer. I fitted a simple random intercepts model using ...
0
votes
0answers
133 views

lme4 singular fit non randomized design

I am analyzing a dataset with lme4. I am investigating the effects on vine yield of 5 different "Treat". We are working on-farm and we were not offered the possibility of a randomized design. So we ...
0
votes
0answers
27 views

Marginal interpretation of fixed effects in GLMM

I understand that when applying GLMMs (e.g. in logistic mixed effects regression), the interpretation of the coefficients for the fixed effects is that they are also conditional on the random effects (...
1
vote
1answer
43 views

changing the coding system from helmert coding to difference coding changes regression results?

EDIT: I think I have mistaken the names of the coding systems, so I changed it (in bold). The content has not changed at all, though, so I would still appreciate any answer. END EDIT I'm running ...
0
votes
0answers
39 views

Is my (repeated-measures) multilevel model correctly specified in R?

Objective: I would like to make sure I specified my multilevel model correctly in R using nlme package. Background: I have a ...
0
votes
1answer
23 views

Nested model failing to converge - how to make decisions about random intercept only model?

I have two models: modela <- lmer(perception~1+self+actual+(1|id/rid),data=data) modelb <- lmer(perception~1+self+actual+(1+self+actual|id/rid),data=data) ...
2
votes
0answers
18 views

Replication/repeated measures problem

I have some data with a repeated measures problem. As an example of my problem, let's imagine you are interested in how a person's weight influences their blood pressure. However, there is a problem ...
19
votes
1answer
690 views

lme() and lmer() giving conflicting results

I have been working with some data that has some problems with repeated measurements. In doing so I noticed very different behavior between lme() and ...
2
votes
2answers
59 views

How to model repeated measurements with mixed effect models - lme4

I have a dataset of temperature measurements within a day 6 am, 6 pm, for two groups of patients health and flue, There are repeated measurements on the same patient and same timepoint - measurements ...
1
vote
0answers
26 views

Kenward-Roger degrees of freedom with lmerTest

I am trying to do a t-test with Kenward-Roger degrees of freedom on my linear mixed model with lmerTest in R. I found that there are two ways of specifying the degrees of freedom: either directly in ...
0
votes
0answers
29 views

R - lme4 Repeat Measures, Plots with different measurement starts

I have a follow up situation to a question I had asked earlier. The example below is some made up data to easily show the situation. I have 4 plots, in each that a one time measurement of initial "...
2
votes
0answers
73 views

Random slope random intercept model for two grouping levels

I'm trying to see how boldness of individuals change with time (plasticity in personality). My data consists of boldness scores (response variable), Trials (across time), individuals nested within ...
3
votes
1answer
62 views

Calculating confidence intervals of marginal means in linear mixed models

I'm using different R packages (effects, ggeffects, emmeans, ...
0
votes
1answer
18 views

Difference in results when using full dataset vs subset in lmer

I have a dataset with the number of different species across multiple years and locations. I'm interested in seeing how abundance of each species has changed over time in each place. My data looks ...
1
vote
0answers
39 views

Mathematical description of covariance matrix

Using the nlme R package, I specified a model of the form ...
3
votes
2answers
78 views

Covariance structure with one or more random intercepts

I need to choose a suitable covariance structure including one or more random intercepts: If one factor B is nested in another factor ...
1
vote
0answers
21 views

Simulated estimate from a linear mixed model with random intercepts

I wanted to see if there was a quick way to get a bootstrapped parameter estimate and CI using confint() from merTools? ...
0
votes
1answer
27 views

How to test hypothesis that a change in x is associated with a change in y in a repeated measures context

I have a dataset with six variables: perceived_risk: the perceived risk of getting a disease on a scale from 1-5. interest_in_screening: the subject's interest in being screened for the disease on ...
0
votes
1answer
40 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
41 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
45 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: ...
1
vote
1answer
29 views

lmer multilevel regression with intercept constraint [closed]

I regularly have this problem: I want to fit a multilevel regression, with constraint. I don't know how to do that. I usualy end up using lavaan, as it allows to ...
1
vote
1answer
51 views

R - lme4 - Help on repeat measures over time, continuous predictor interactions

I've created an exmaple data set below to hopefully help answer a question in regards to a lme4 in R and measurements over time. The data is 4 plots, measured over 4 years, with the dependent ...
0
votes
0answers
32 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
33 views
0
votes
1answer
31 views

Setting the intercept of a Binomial GLMM (glmer) to a set value

I have a run an experiment where subjects are given a choice between four objects. Their response is either correct or incorrect, however because there are four choices and only one is correct, it is ...
1
vote
1answer
30 views

R - How to get estimates and p-values for random effects in glmer

I have data about around 100,000 protests nested within 40 countries and I want to analyze when the claims of a protest are directed at the state, based on action and country level characteristics, ...
2
votes
1answer
36 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 ...