I didn't get how to get the effect size for contrasts/posthoc comparaisons... Can you tell me if it is possible to have them and how to have them? thanks!
Thank you so much Dr. Christiansen, this is extremely helpful! I was wondering; If you were interested in a three-way interaction between eg drink*language*picture_type, would it make sense to run: emmeans(drinkeff3, pairwise~Language*drink | picture_type) emmeans(drinkeff3, pairwise~Language*picture_type | drink) emmeans(drinkeff3, pairwise~picture_type*drink | Language)? I would be grateful if you could reply to this. Thank you very much once again!
What if you have a continuous variable such as time, lets say 0, 5, 10 and 20 days as repeated measurement. Can you you still call it a level with factors? When I run the summary it gives me 0 counts to each level, as they are not recognize as such. Thanks!
Hello Paul, Great set of videos, and thanks for taking the time to post, certainly helps in attempting to run this type of analysis and to interpret. I have a question about why in part 1 a GLMM is used and in part 2 and 3 a LMM? I understand a GLMM is used when data is not normally distributed? Is it related to repeated measures?
Really helpful video, thank you Dr Paul Christiansen! Can I just ask, in the last part of the video where you show how to run pairwise comparisons for the drink*language interaction, is this Bonferroni corrected like the main effect pairwise comparisons is? It doesn't state it in the code like the main effect pairwise comparisons and I've tried (but failed) to add it in. Thanks very much in advance!
Great video. In the description you mention the test is "within and between subjects factors". What if you have two factors that are within factors? Do you run the same test and R will automatically know both factors are within?
@@DrPC_statistics_guides Thank you very much. One more question: Is it possible to compare means at the three different levels of drinks (1, 2, 3) at only one specific level of the other factor (picture_type = 1, for example)? How else would you know where the differences lies? Or is that what the interaction pairwise comparison tells us? The reason I am asking is because in my own dataset both main effects are significant. I have two factors (Factor A levels = 5) and (Factor B = 3 levels). I want to compare the three levels of Factor B at every level of Factor A, separately. Hope my question makes sense.
Thank you so much, Dr. Christiansen!!! This is extremely helpful! I have a question and I'd be pleased if you could answer. How would you construct the model if you had four drinks, drink1, drink2, drink3, and drink 4, and another factor, for example, alcohol, that categorizes them? In other words, let's say we have a drink variable that has 4 levels: drink 1 and 2, which are alcoholic, and drink 3 and 4, which are non-alcoholic. Everything else would be the same. Thank you very much for your help once again!
@@DrPC_statistics_guides Thanks for your reply! I am referring to a design where there is another factor that nests the variable drink. Like the language group nesting the subjects, that variable (I called it alcohol in my question) has 2 categories (alcohol vs. nonalcohol) and some drinks (drink1 and drink2) belong to the 1st category, and other drinks (drink3 and drink4) belong to the 2nd category. I am interested in the effect of language and alcohol by accounting for the random effects of subjects and drinks.
Just as a mentioned in a different video, it is again not clear how do you differentiate between within- and between-group factors. OK, it is clear to a human that you cannot be Eng native speaker and not be one at the same time. However, for lmer() these are just factors. It seems that the code is not correct. Kindly, correct me if I am wrong or am missing something.
the data structure means that the between-subjects factor does not nest within participants (i.e. participant X will can only be native speaker or not, they cannot have both codes under them) therefore it is a between-subjects factor
@@DrPC_statistics_guides Thanks a lot for your reply, Paul, I truly appreciate this. Let me clarify please. Does it mean that we should use different subject #s for different groups of participants? That is, subject 1 to 40 should only be in group of English speakers, and 41 to 80 in others? This is the only way I can imagine where it is really clear that participant belongs to 1 group and not the other. If you have sbj1 in both eng and other groups, then it may well be a within subject design (as I mentioned, to R 'eng' and 'other' is simply factor levels with no extra info). Could you please comment on this?
@@Artyom109Zinchenko @Artyom Zinchenko You don't need to code your data like that, a participant cannot be in two between subs groups if data are entered correctly. It doesn't matter what order you put the participant in. The model understands that if the measure is not nested with the random intercepts (participants) then its between subjects, the raw data is linked below the video if you want to look at the structure
@@DrPC_statistics_guides Thanks a lot! If you collect two datasets (e.g., blind people vs. sighted) from two different experiments, it is well possible that you have two groups of participants that are both coded, e.g., 1 to 20. In this case lmer() would treat these two groups incorrectly, i.e., as within-group participants. In this case, one of the group's subject numbers should be recoded from 1-20 into 21-40. I guess this is what you mean by "if data are entered correctly". This is THE key piece of information I wish was made more explicit, otherwise the code for all three videos you posted on this topic is almost identical. Thank you once more!
@@Artyom109Zinchenko Yes that would be the case but the issue there is much broader than simply the between-group factor being a problem as that would ruin the random intercepts that you have for participants (i.e. you have more than one participant per intercept). As given you should never have the same participant numbers that are applied to different people as rule and in particular, if you wish to use this number as a random intercept. This is not really a statistical issue but rather a data integrity issue- I didn't mention this as really this should never happen.
The random effect is not an IV in the model, so you will not get a p value for it, we have removed the variance associated with the random effect rather than added it as a predictor (which we cannot do as subject number is arbitarty)
Thanks so much for the video series! Im wondering about nesting. I would have thought that subject would be nested within language possibly? Could you possibly comment on this?
Hi you can do that although it depends how many languages there are. Indeed language may be better as a fixed effect (predictor) rather than a random effect. I have a series of videos on multilevel models that discuss nesting which may be helpful
Hi, I'm happy to take criticism but there is no need to be rude when doing so. This is my accent, and this video was also recorded when my daughter was asleep next door to my office space.
I didn't get how to get the effect size for contrasts/posthoc comparaisons... Can you tell me if it is possible to have them and how to have them? thanks!
Thank you so much Dr. Christiansen, this is extremely helpful! I was wondering; If you were interested in a three-way interaction between eg drink*language*picture_type, would it make sense to run:
emmeans(drinkeff3, pairwise~Language*drink | picture_type)
emmeans(drinkeff3, pairwise~Language*picture_type | drink)
emmeans(drinkeff3, pairwise~picture_type*drink | Language)?
I would be grateful if you could reply to this. Thank you very much once again!
What if you have a continuous variable such as time, lets say 0, 5, 10 and 20 days as repeated measurement. Can you you still call it a level with factors? When I run the summary it gives me 0 counts to each level, as they are not recognize as such. Thanks!
Hello Paul, Great set of videos, and thanks for taking the time to post, certainly helps in attempting to run this type of analysis and to interpret.
I have a question about why in part 1 a GLMM is used and in part 2 and 3 a LMM? I understand a GLMM is used when data is not normally distributed? Is it related to repeated measures?
Would you please make another video discussing how to set up contrasts a priori so you could run fewer post hocs?
What if your between subject variable is continuous?
Really helpful video, thank you Dr Paul Christiansen! Can I just ask, in the last part of the video where you show how to run pairwise comparisons for the drink*language interaction, is this Bonferroni corrected like the main effect pairwise comparisons is? It doesn't state it in the code like the main effect pairwise comparisons and I've tried (but failed) to add it in. Thanks very much in advance!
Great video. In the description you mention the test is "within and between subjects factors". What if you have two factors that are within factors? Do you run the same test and R will automatically know both factors are within?
This video covers it ua-cam.com/video/YsD8b5KYdMw/v-deo.html
@@DrPC_statistics_guides Thank you very much. One more question:
Is it possible to compare means at the three different levels of drinks (1, 2, 3) at only one specific level of the other factor (picture_type = 1, for example)? How else would you know where the differences lies? Or is that what the interaction pairwise comparison tells us?
The reason I am asking is because in my own dataset both main effects are significant. I have two factors (Factor A levels = 5) and (Factor B = 3 levels). I want to compare the three levels of Factor B at every level of Factor A, separately. Hope my question makes sense.
Thank you so very much for this video! You saved me a lot of time.
How can I extract the random slopes from a LMM using lme4 and then sum them the intercept(mean)?
Random slopes would require a formula such as:
model
Thank you so much, Dr. Christiansen!!! This is extremely helpful!
I have a question and I'd be pleased if you could answer.
How would you construct the model if you had four drinks, drink1, drink2, drink3, and drink 4, and another factor, for example, alcohol, that categorizes them? In other words, let's say we have a drink variable that has 4 levels: drink 1 and 2, which are alcoholic, and drink 3 and 4, which are non-alcoholic. Everything else would be the same.
Thank you very much for your help once again!
Hi, are you referring to a 2 x 2 design?
@@DrPC_statistics_guides Thanks for your reply! I am referring to a design where there is another factor that nests the variable drink. Like the language group nesting the subjects, that variable (I called it alcohol in my question) has 2 categories (alcohol vs. nonalcohol) and some drinks (drink1 and drink2) belong to the 1st category, and other drinks (drink3 and drink4) belong to the 2nd category. I am interested in the effect of language and alcohol by accounting for the random effects of subjects and drinks.
Just as a mentioned in a different video, it is again not clear how do you differentiate between within- and between-group factors. OK, it is clear to a human that you cannot be Eng native speaker and not be one at the same time. However, for lmer() these are just factors. It seems that the code is not correct. Kindly, correct me if I am wrong or am missing something.
the data structure means that the between-subjects factor does not nest within participants (i.e. participant X will can only be native speaker or not, they cannot have both codes under them) therefore it is a between-subjects factor
@@DrPC_statistics_guides Thanks a lot for your reply, Paul, I truly appreciate this. Let me clarify please. Does it mean that we should use different subject #s for different groups of participants? That is, subject 1 to 40 should only be in group of English speakers, and 41 to 80 in others? This is the only way I can imagine where it is really clear that participant belongs to 1 group and not the other. If you have sbj1 in both eng and other groups, then it may well be a within subject design (as I mentioned, to R 'eng' and 'other' is simply factor levels with no extra info). Could you please comment on this?
@@Artyom109Zinchenko @Artyom Zinchenko You don't need to code your data like that, a participant cannot be in two between subs groups if data are entered correctly. It doesn't matter what order you put the participant in. The model understands that if the measure is not nested with the random intercepts (participants) then its between subjects, the raw data is linked below the video if you want to look at the structure
@@DrPC_statistics_guides Thanks a lot! If you collect two datasets (e.g., blind people vs. sighted) from two different experiments, it is well possible that you have two groups of participants that are both coded, e.g., 1 to 20. In this case lmer() would treat these two groups incorrectly, i.e., as within-group participants. In this case, one of the group's subject numbers should be recoded from 1-20 into 21-40. I guess this is what you mean by "if data are entered correctly". This is THE key piece of information I wish was made more explicit, otherwise the code for all three videos you posted on this topic is almost identical. Thank you once more!
@@Artyom109Zinchenko Yes that would be the case but the issue there is much broader than simply the between-group factor being a problem as that would ruin the random intercepts that you have for participants (i.e. you have more than one participant per intercept). As given you should never have the same participant numbers that are applied to different people as rule and in particular, if you wish to use this number as a random intercept. This is not really a statistical issue but rather a data integrity issue- I didn't mention this as really this should never happen.
Where is the effect (p-value) of the random effect (1 l sub) in the output table?
The random effect is not an IV in the model, so you will not get a p value for it, we have removed the variance associated with the random effect rather than added it as a predictor (which we cannot do as subject number is arbitarty)
Thanks so much for the video series! Im wondering about nesting. I would have thought that subject would be nested within language possibly? Could you possibly comment on this?
Hi you can do that although it depends how many languages there are. Indeed language may be better as a fixed effect (predictor) rather than a random effect. I have a series of videos on multilevel models that discuss nesting which may be helpful
How is this video different from previous one?
This video adds a between subjects variable to the analysis so it shows how to utilise these models for a mixed design.
amazing videos! Thank you very much!
Talk more clearly. You are mumbling
Hi, I'm happy to take criticism but there is no need to be rude when doing so. This is my accent, and this video was also recorded when my daughter was asleep next door to my office space.
I apologize@@DrPC_statistics_guides