Linear mixed effects models - random slopes and interactions | R and SPSS

  Рет қаралды 31,275

TileStats

TileStats

Күн бұрын

See all my videos at: www.tilestats.com
1. Simple linear regression
2. Random intercepts (01:20)
3. R code with lme4 package (02:07)
4. Random intercepts and slopes (04:00)
5. Only random slopes (05:00)
6. Two factors with interaction (05:37)
7. Compare two models (08:55)
8. SPSS (09:52)

Пікірлер: 49
@Sam-tg4ii
@Sam-tg4ii 27 күн бұрын
Your explanations are very clear. Thank you so much
@prilolla
@prilolla Жыл бұрын
This is the best video so far I have seen. We need people who can explain concepts in simple terms.
@atkiltgg
@atkiltgg 10 ай бұрын
Excellent teacher! Thank you for all your efforts to make us understand it well! Well done!
@prilolla
@prilolla Жыл бұрын
I really appreciate teachers like you with which we can understand the concepts and apply our research questions easily. I would request a video in detailing the difference between FE, RE, and ME. And also when to use these three models. Thanks you for your time.
@yonyc
@yonyc 2 жыл бұрын
You are an excellent instructor! Thank you very much for your content!!
@Grbec4
@Grbec4 Жыл бұрын
Best explanation on mixed-effects models on KZfaq. Thank you for a great job!
@iriizb
@iriizb Жыл бұрын
Thank you so much. I appreciate your clear explanation and example code. Very helpful.
@amywilderson85
@amywilderson85 2 жыл бұрын
I greatly appreciate it!! I have taken longitudinal courses but some of the concepts did not make sense to me. Now thanks to you I have a better vission of mixed effect models. (I am very grateful of you for teaching concepts with graphs)
@LudwigVera
@LudwigVera Жыл бұрын
Great explanation, thanks!
@user-gh6di6tn5f
@user-gh6di6tn5f 2 жыл бұрын
What an expert you are ! If you add some examples with animated figure, then you would be a super star to the academic field, I am sure.
@fabioramilli8863
@fabioramilli8863 Жыл бұрын
adding videos is very time consuming, I think that's better to continue adding more videos covering a wider range of topics😉
@MegaAvi1000
@MegaAvi1000 6 ай бұрын
Excellent video! Thank you. Would you kindly clarify why you used the measure at time 0 as one of the repeated measures? Shouldn't the value at time 0 (pre-treatment) be considered a covariate and not one of the repeated measures (i.e., post-treatment outcome)?
@gerardaristizabalpla9138
@gerardaristizabalpla9138 2 жыл бұрын
Great video! By any chance do you have the R translated to Python codes?
@SIENEKEFTWLOL
@SIENEKEFTWLOL Жыл бұрын
Excellent video. Do you know how to get SPSS to produce the individual slopes as a new parameter?
@fishfeelpain7764
@fishfeelpain7764 Жыл бұрын
Your videos are addictive! If you could do something about survival analysis that would be amazing, as there isn't much available yet on KZfaq.
@tilestats
@tilestats 7 ай бұрын
kzfaq.info/sun/PLLTSM0eKjC2cj7XtMM6OuX9zsvBava1FI
@Sam-tg4ii
@Sam-tg4ii 27 күн бұрын
I have one question: this type of graph at 1:25 to visualize the effect of the clusters on the regression line is very helpful. But what if we have multiple independent variables. How can we visualize the regression line across the clusters?
@kennethvaughan6719
@kennethvaughan6719 Жыл бұрын
I am migrating from SAS and mostly struggling with code. How would I include a second or third random slope in R?
@fazlfazl2346
@fazlfazl2346 11 ай бұрын
Am I right if I say that including WeeksxDiet allows for DietA and DietB to have different slopes i.e.Subject 1 and Subject2 will have the same slope but it will be different from the slope of Subject3 and Subject4 (which have same slope). Further, in Weight ~ Weeks × Diet + (1 + Weeks|Subjects), including Weeks as a random effect will then allow all subjects to have uniques slopes which can be seen as a step further than just including WeeksxDiet but no random effect for Weeks?
@CanDoSo_org
@CanDoSo_org 5 ай бұрын
At 2:48, why I only got one intercept instead of multiple?
@xiaofeifu674
@xiaofeifu674 Жыл бұрын
thank for great video. I have a question that my data is repeated measurment, but the output values are not linear with the predictor, which method should I use?
@tilestats
@tilestats Жыл бұрын
If your problem fits the example in this video, except that there seems to be some nonlinear trend in the data, then you can use a nonlinear mixed effect model. I aim to create such a video next year.
@SwavimanKumar
@SwavimanKumar Жыл бұрын
I have seen examples like this, m
@Thechasepc
@Thechasepc 2 жыл бұрын
Thank you! What happens when you have multiple fixed effects for example weeks and exercise? Having difficulty visualizing that.
@tilestats
@tilestats 2 жыл бұрын
In the example, I have weeks and diet. Do you mean what would happen if you instead have two continuous variables? If so, you need a three dimensional plot, where you instead fit a plane to the data.
@Thechasepc
@Thechasepc 2 жыл бұрын
@@tilestats Thank you. yes I am asking about two continuous variables. I'm aware that they would form a plane but could this still be visualized in a similar way as above in two dimensions?
@mesiazul8435
@mesiazul8435 Жыл бұрын
What if I want to do a pre- & post- tests for the weight? (two measurements). SPSS can only input one dependent variable in the linear mixed model.
@tilestats
@tilestats Жыл бұрын
Can't you do as in the example but where you only have two time points (pre and post)?
@BKern-wl5zs
@BKern-wl5zs Жыл бұрын
Thanks for the great video! I'm trying to code along in R, but I can't replicate the simple regression. Is your code available anywhere? Or could you show me the data you used to fit the simple regression? That would be very helpful!
@tilestats
@tilestats Жыл бұрын
At 2:25, you see how the data should be set up. Then you just run: lm(Weight~Weeks,data=df) or: summary(lm(Weight~Weeks,data=df))
@momomo767
@momomo767 Жыл бұрын
Thank you for such a great explanation! Two questions: 1. Should weeks be continuous or a factor variable? I guess it depends on if you want overall effect, or effect from week to week? When doing factor, I get an error when including weeks as random slope, how can I fix this? 2. How about if we want to see if the change is different depending on gender? Could we write: weight ~ weeks*gender + (weeks | subjects)? I am confused since the gender is essentially included in subject, but I want to see if there is any difference in change over time
@tilestats
@tilestats Жыл бұрын
Weeks should be continuous. You can include gender just as I include Diet A/B in the example in this video.
@javierhernando5063
@javierhernando5063 Жыл бұрын
Why using the lme4 package instead of nlme with lme function? Really like you videos!! Thanks so much
@tilestats
@tilestats Жыл бұрын
nlme also works fine. I have used both but I think the way you enter your model is a bit simpler in lme4.
@user-dt4xr1xk5r
@user-dt4xr1xk5r 10 ай бұрын
I really appreciate your clear explanation on the concept of linear mixed effects models. Could you or someone clarify which data format should be set for using lmer? I think 'long' format according to "weeks" would be appropriate. Right?
@tilestats
@tilestats 10 ай бұрын
Set up the data frame as shown at 2:27
@user-dt4xr1xk5r
@user-dt4xr1xk5r 10 ай бұрын
Thanks@@tilestats
@ast3362
@ast3362 2 ай бұрын
6:57 I don't understand how we can now assume that the Groups have one random intercept. That would mean each group has their own distribution, which is not the case because as you said all 4 subjects are randomly sampled out of one distribution.
@tilestats
@tilestats 2 ай бұрын
When we include Diet in the model, we can test if the two groups have different intercepts. Thus, we then no longer assume that all individuals are sampled from the same distribution.
@ast3362
@ast3362 2 ай бұрын
@@tilestats thanks! I just realised the difference between groups and clusters. Now everything is clear!
@rishikeshdash12
@rishikeshdash12 10 ай бұрын
If I have different Genes count in place of weight How can I used that for 10-20 types Genes. Should I use a loop to get results for each Genes count changes over the week by the influence of Diet or is that any possibility to create model for all Genes at a time. One more question you have not explained how we will know how much changes happen in weight over the weeks while comparing both the diet
@tilestats
@tilestats 10 ай бұрын
I would suggest that you look into how to set up a repeated measure design in packages, like DESeq2. limma or edeR, that have been developed to deal with gene count data.
@rishikeshdash12
@rishikeshdash12 10 ай бұрын
@@tilestats no actually I want to see How Gene counts have changed over the weeks by the effects of the diet
@tilestats
@tilestats 10 ай бұрын
Since you have counts, you should use GLMM instead of LMM.
@rishikeshdash12
@rishikeshdash12 10 ай бұрын
@@tilestats ok sir
@vic7181vic
@vic7181vic Жыл бұрын
Many thanks for your excellent videos. But the lecture over it is not much understandable. So, as feedback, can you possibly give your lecture's script to a text-to-speech engine (bot) to read it aloud over the video? I am saying this because you pronounce many words very badly, severely ruining your awesome video and badly distracting the audience. The worst of them is the word "model" which is pronounced by you as "mole" or "mowel". There are many such odd pronounciations. I would be very grateful if you could give the text to a bot to speak it. Thanks again for your awesome videoes.
@PanLamda
@PanLamda Жыл бұрын
What a cringy comment dude. Thats his pronunciation, which is fine and understandable, what do you mean "you get distracted" by it? Pay your respect to the man and stop distracting us with your useless and offensive comments.
@JuanGomez-bu4bm
@JuanGomez-bu4bm 2 жыл бұрын
Hello good, what is your email? I would like to ask you about an exercise that I have
Linear mixed effects models - the basics
11:27
TileStats
Рет қаралды 63 М.
Mixed Effects Models: A Conceptual Overview Using R
35:03
PsychED
Рет қаралды 8 М.
Schoolboy - Часть 2
00:12
⚡️КАН АНДРЕЙ⚡️
Рет қаралды 4,5 МЛН
A teacher captured the cutest moment at the nursery #shorts
00:33
Fabiosa Stories
Рет қаралды 55 МЛН
World’s Largest Jello Pool
01:00
Mark Rober
Рет қаралды 109 МЛН
How to choose an appropriate statistical test
18:36
TileStats
Рет қаралды 126 М.
Fixed and random effects with Tom Reader
8:09
University of Nottingham
Рет қаралды 187 М.
Predicting tree height with linear mixed models and lme4
16:28
Matthew Russell
Рет қаралды 10 М.
Linear mixed effects models
18:37
Matthew E. Clapham
Рет қаралды 221 М.
(Simplified) Linear Mixed Model in R with lme()
26:17
LiquidBrain Bioinformatics
Рет қаралды 66 М.
Nonlinear mixed effects models (NLME) - explained
12:48
TileStats
Рет қаралды 6 М.
Multivariable Linear Regression in R: Everything You Need to Know!
20:48
yuzaR Data Science
Рет қаралды 4,9 М.
How to interpret (and assess!) a GLM in R
17:36
Chloe Fouilloux
Рет қаралды 27 М.
Schoolboy - Часть 2
00:12
⚡️КАН АНДРЕЙ⚡️
Рет қаралды 4,5 МЛН