All Questions
348 questions
8
votes
1
answer
4k
views
How does random variable nesting in GAMs work (mgcv)?
Consider me very new to the world of GAMs, I am actually using it out of necessity rather than by choice but I thought it could be a chance to learn something new anyway.
Originally I had hoped to ...
8
votes
1
answer
6k
views
Interpretation of variance in multilevel logistic regression
Please help me to interpret the findings of my model. The specifications of the model are:
Dependent variable: treatment (1) or no-treatment (0).
Independent variables: age, number of drugs used, ...
8
votes
1
answer
6k
views
How to specify Bayesian mixed effects model in BUGS
I posted this earlier in the week then retracted the question when I found a good source, not wanting to waste people's time. I haven't made much progress I'm afraid. In trying to be a good citizen ...
7
votes
2
answers
154
views
How can I get a best model? An exploratory LMM
I'd like to inquire about the linear mixed model and its application to my dataset. The dataset comprises a dependent variable (DV) denoted as V, alongside three ...
7
votes
2
answers
818
views
Relative variances of higher-order vs. lower-order random terms in mixed models
TL, DR summary:
Is there any theoretical or empirical basis to support the following statement being true as a general rule of thumb?
"When estimating a mixed model, typically the estimated ...
7
votes
2
answers
5k
views
extremely left-skewed response variable - how do I model this dataset?
This is a histogram showing my response variable.
The response is # (or proportion? or percent?) of aphids eaten off of cards in fields, to model predation by natural enemies.
Predictors: fixed ...
7
votes
1
answer
2k
views
How do you know the number of random effects in a mixed effects model?
I am trying to fit a random slope model in R and my code is as follows:
lmer(data=ds, Outcome ~ treatment + (0 + treatment|ID))
I get the following error ...
7
votes
1
answer
3k
views
GLMM - between, within and nested
I'm not entirely sure of fitting the model for experiment we've made. The variables and relevant description are as follows:
ID - participant ID
Trial - 60 for each participant
Memory - between ...
7
votes
2
answers
4k
views
Elastic net package for mixed effects models?
I know about glmmLasso but would prefer to use elastic net. I wonder if there are any glmm analogues of glmnet out there, or if ...
7
votes
1
answer
4k
views
Dealing with a categorical variable that can take multiple levels simultaneously
I recently posted a question with many parts and I'd like to focus in on just one issue that I didn't emphasize in the original post.
My data is a list of records, each one representing an ...
7
votes
5
answers
791
views
Resources for hierarchical modelling in R
Just chasing a text/resource for learning hierarchical modelling in (and) R. I have extensive experience using Matlab and Stata but very limited R experience.
Any recommendations? Happy to purchase ...
7
votes
1
answer
7k
views
How to assess overdispersion in Poisson GLMM, lmer( )
I have a GLMM with Poisson distribution and random spatial block. My experimental design is 2x2 factorial, with 4 blocks, resulting in 16 total data points. Here is the specification of the model in R ...
7
votes
0
answers
872
views
Time series models (e.g. ARMA) a type or extension of GLM? Particular/stipulated forms of dependence in time series models
I am trying to understand the relationship between ARMA Time Series models and the GLM (Generalized Linear Model) family of models. As far I know, all GLMs have the following 3 components: 1) random ...
7
votes
2
answers
166
views
How can I use a variable as a covariate which exists only for specific range for some clusters/groups?
I want to know how to use Poisson GLMMs when we have unequal samples available for different groups/clusters/participants in data.
Imagine a study where each of the 60 participants are given 1000 ...
7
votes
3
answers
5k
views
GDA and LDA terminology
Can the terms LDA (Linear Discriminant Analysis) and GDA (Gaussian Discriminant Analysis) be used interchangeably?
Do they often refer to the same thing?
7
votes
3
answers
607
views
Temporal analysis of variation in random effects
I am looking at patient data where the main outcome of interest is mortality within 30 days following hospitalisation with an emergency condition. I am working on data from 2003-2017, with ...
7
votes
1
answer
2k
views
How to calculate estimated proportions and their confidence intervals from a mixed model?
I have an experiment with two treatments. It is a split plot experiment, with the structure Block/Treatment1/Treatment2. Each treatment has 2 levels. The dependent variable is presence/absence data ...
6
votes
1
answer
12k
views
Conditional logistic regression vs GLMM in R
I have paired data (GWAS case/control study) and I have heard using conditional logistic regression or generalized linear mixed models (GLMM) is appropriate. Which should I use in this case? Why would ...
6
votes
1
answer
12k
views
GLMER not converging
Here is a sample of 20 rows from some data I'm working with (everything below is consistent with the full dataset):
...
6
votes
1
answer
2k
views
Is it possible to use LASSO regression with multi-levlel data?
I have real-time monitoring data where participants report on a variety of variables four times per day for a month. Is it possible to use LASSO regression (e.g,. glmnet r package) with this data? I'm ...
6
votes
1
answer
458
views
Why GEE estimates are smaller than GLMM?
Both are estimators that maximize the marginal likelihood, only GLMM does so by first considering the conditional probability, while GEE assumes a covariance structure of the marginal probability ...
6
votes
1
answer
3k
views
Should I consider time as a fixed or random effect in GLMM?
I am attempting to determine if a type of pesticide is influencing the abundance of a particular species of bird. I have 35 years of data, which was collected along roadside survey routes that are run ...
6
votes
1
answer
7k
views
ICC in a multi level model with two random effects
My understanding is that intraclass correlation gives you an idea of how much variance your level two factor can explain in overall variance of the dependent variable. It is supposed to give an ...
6
votes
1
answer
8k
views
How to handle underdispersion in GLMM (binomial outcome variable)
I'm working on the following model in R:
...
6
votes
2
answers
5k
views
Outlier removal prior to mixed-effect modelling
I'm analysing reaction time data from a grammaticality judgement task (collected in a masked-priming experiment). The stimulus were noun-noun compounds, including 3 types of compounds (depending on ...
6
votes
2
answers
5k
views
How to set up an intercept-only mixed logistic regression in order to test for difference from 50% chance level?
In my experiment, subjects repeatedly had to make a binary choice between A and B, and I want to test if subjects (as a group) differed from 50% chance in preferring A over B. Is there a way to test ...
6
votes
1
answer
2k
views
Model not singular but doesn't converge what could be the reason (lme4 in R)
I'm following up on this great answer regarding running Principal Component Analysis (PCA) to uncover the reason behind lack of convergence and/or singularity for Mixed-Effects models.
My model below ...
6
votes
2
answers
3k
views
Correct specification of longitudinal model in lme4
I am trying to fit a multilevel longitudinal model and i have a question regarding how to specify it.
The data consist of about 8k observations collected from about 3k individuals at four time points. ...
6
votes
0
answers
229
views
What can Ido if I get patterns in residuals vs predicted values using `lme4::glmer()` with a GAMMA distribution?
I want to model a response variable (y) as a function of two explanatory variables (x and z)....
6
votes
2
answers
1k
views
Confused about meaning of subject-specific coefficients in a binomial generalised mixed-effects model
In *A Comparison of Cluster-Specific and Population-Averaged Approaches for Analyzing Correlated Binary Data*, Neuhas, Kalbfleisch, and Hauck state:
"With the cluster-specific approach, the ...
5
votes
3
answers
702
views
Can fixed-effects become biased due to random structure misspecification
I'm following-up on this great answer. Essentially, I was wondering how could misspecification of random-effects bias the estimates of fixed-effects?
So, can the same set of fixed-effect coefficients ...
5
votes
2
answers
3k
views
Is it ok to use a random intercept model without testing for random slopes?
In university we calculated a random intercept model for two-level nested data. We compared the random intercept model with all level-1 variable with the random intercept model with all level-1 and ...
5
votes
1
answer
7k
views
In a multilevel linear regression, how does the reference level affect other levels/factors and which reference level ought to be selected?
In the diagram, Heavy smoker is the reference level as it is not shown with summary. How and what other categorical level should be used instead? Why?
...
5
votes
1
answer
3k
views
Multilevel model with 4 levels?
My dataset is a pretty typical educational dataset: we have data about students, courses, faculty, schools, and I plan to include partially-crossed random effects because students could enroll in ...
5
votes
1
answer
749
views
Should I remove random intercepts from my model?
I have collected some data on response times (Y) under two varying conditions (X1 and X2). The conditions are continuous variables, although I set them to fixed values of 1,2,3,4 and 5.
I have 10 ...
5
votes
1
answer
1k
views
Changing the time metric for longitudinal data
I have some longitudinal data. I've done longitudinal analysis before but I have never changed the time metric so I wanted to run the process of that by you.
Edits for clarity:
I have repeated ...
5
votes
1
answer
4k
views
Why are results different between MuMIn::r.squaredGLMM and piecewiseSEM::sem.model.fits?
MuMIn::r.squaredGLMM and piecewiseSEM::sem.model.fits should be preforming the same calculations. They are implementing Schielzeth and Nakagawa's R2 for generalized linear mixed effects models. ...
5
votes
3
answers
276
views
Counting Biased Coins
Edit Note:
While this question is very interesting and relevant in its own right, I have come to a realisation that I have to make it a bit more complicated in order for it to be applicable to my ...
5
votes
0
answers
839
views
Quasipoisson or negative binomial glmm with differing dispersion by group
I have a set of count data, which look something like this:
...
5
votes
1
answer
2k
views
What does it mean when a low number of quadrature points gives a very different GLMM fit?
I am interested in a logistic regression model with 10 fixed-effects parameters and random intercepts, which I can fit using the lme4::glmer function in R. The ...
5
votes
1
answer
165
views
Intercept interpretation in multi-level model when first-level predictor discrete
This is the experimental setup:
1 dependent variable (discrete, 4 levels) and
3 Independent variables:
Time, measured within subject, 5 discrete levels
Covariate, measured within subject, 5 discrete ...
5
votes
1
answer
1k
views
$R^2$ for mixed models = ICC?
I will be referring here to Nakagawa and Schielzeth (2013). As those authors state, $R^2$ for OLS regression could be defined as follows:
$$R^2 = \frac{\sum^n_{i=1}(\bar{y} - \hat{y_i})^2}{\sum^n_{i=...
5
votes
1
answer
3k
views
Factor analysis with repeated measures
Multilevel factor analysis seems to be the technical term for factor analysis with repeated measures, judging from this abstract. To be precise, following Wikipedia's factor analysis notation, the ...
5
votes
2
answers
3k
views
Varying group coefficients in lme4
All,
I am estimating a multilevel logistic regression with group predictors, but am unclear about some of the advice given by Gelman and Hill (2007) in their book. Therein, they recommend allowing ...
5
votes
1
answer
2k
views
What is the difference between mixed-effects modelling in the RStan and lme4 packages?
I've recently begun running some multilevel/hierarchical models. Initially I was using rstan/rstanarm, but then switched to the lme4 package.
Is the difference between these two packages only in the ...
5
votes
1
answer
416
views
Variant of discriminant analysis for known multiple independent classifications?
I have a large data set: over 100,000 data points, each with 60 dimensions. I want to display the data in 2D to visibly maximize the separation between classes, which I know for each point. I asked a ...
5
votes
2
answers
3k
views
GLMM- relationship between AICc weight and random effects?
I am developing GLMM's in order to assess habitat selection (using GLMMs' coeficients to construct Resource selection functions).
I have (telemetry) data from 5 study areas, and each area has a ...
5
votes
1
answer
493
views
Continuous x Continuous Interactions in Logistic GLM and GLMMs
Lets say I want to run a logistic GLMM like so:
...
5
votes
1
answer
9k
views
How to compute intraclass correlation (ICC) for THREE-level negative binomial hierarchical model?
I'm using lme4 in R, and I have a model set up that uses a three-level hierarchy for a negative binomial regression.
There is previously a question (How compute the Intra-Class Correlation for a ...
5
votes
0
answers
1k
views
Including seasons and months into GLMM: should they be crossed or nested effects?
I have collected data from five consecutive fishing seasons (five factor levels). Each fishing season has five months within (five factor levels). Considering that I have a temporal correlation in my ...