Multilevel modeling in R using lme4 package (Feb 2020): Demo of Hox 2010 Chapter 2 extended example

  Рет қаралды 47,905

Mike Crowson

Mike Crowson

Күн бұрын

Пікірлер: 43
@jaykay9835
@jaykay9835 2 жыл бұрын
Thank you so much!! You helped me significantly during my bachelor's thesis
@renasfpolis
@renasfpolis 3 жыл бұрын
Thanks for the video! Much appreciated.
@foraging_monkey
@foraging_monkey 3 жыл бұрын
One question please, after generating some models, How we choose the best model to be written in the report? Thank you.
@hakeemojulari7392
@hakeemojulari7392 3 жыл бұрын
@Mike Crowson, How do I use lme4 for categorical data (both predictors and response variable) and the data contains datetime
@saeidnosrati3782
@saeidnosrati3782 3 жыл бұрын
Would you please tell us how we can get model fit indices and standardized estimation in this video?
@jamescutler428
@jamescutler428 3 жыл бұрын
Great video! Very helpful details.
@fangjingtu5840
@fangjingtu5840 3 жыл бұрын
Hi Mike, thanks much for the informative video! I encountered the following error with the graph_model: ""Error in factor(grid[[term]], labels = c("-1 SD", "+1 SD")):invalid 'labels'; length 2 should be 1 or 0". My y and x are both continuous variables, and the moderator is a factor. Do you have suggestions to fix this?
@reaperqnu
@reaperqnu 3 жыл бұрын
Is the extraversion a binary variable? If so, we can interpret the intercept as the level of popularly of an introvert male, is this correct? The coefficients of the sex and extra variables are in fact the differential effect from this referencing type.
@stinesorensen5397
@stinesorensen5397 4 жыл бұрын
Very useful demonstration. Thank you for sharing Mike!
@dobariyahardik3388
@dobariyahardik3388 3 жыл бұрын
thank you very much sir ,Your video is very helpful
@yutingcui2485
@yutingcui2485 2 жыл бұрын
Hi Mike, thank you for your video, it makes it clear to understand lem4 package. I want to know whether there is a function to calculate the proportion of variance in lem4. It is complex to manually get R2 by comparing different models.
@tayebehsaghapour6505
@tayebehsaghapour6505 2 жыл бұрын
Hi Mike, thanks so much for the very useful video on multilevel modelling. I am trying to run a multilevel nested logit model, just wondering if you are aware of any R packages that can be used for this modelling? most packages I know haven't gone beyond the multinomial logistic model; however, in nested logit, the outcome measure itself has a hierarchical structure which makes the model even more complicated. I appreciate your advice on this. Thanks
@junli7200
@junli7200 4 жыл бұрын
Hi Mike, thank you for sharing this. I am struggling with a longitudinal multilevel model with the count (slightly over dispersion with c=1.78) as the dependent variable. How can I do this in R ?
@wasafisafi612
@wasafisafi612 2 жыл бұрын
You can use the "quasipoisson" as the family or the negative binomial model
@md.masumbillah8222
@md.masumbillah8222 3 жыл бұрын
Thank you for sharing this
@spiousas
@spiousas 4 жыл бұрын
Is there a way to use the graph_model for three-way interactions?
@danielmax562
@danielmax562 2 жыл бұрын
It seems confusing to me cause we have Level 1 and Level 2 variables but in the models in R they are all put together, side by side, without distinction. How does the model "know" that they belong to different levels?
@nafisanwari6288
@nafisanwari6288 Жыл бұрын
I think the value of level 2 variables stay the same within a particular group, but varies with other groups. See the data structure posted at the beginning of the video
@dipeshsharma7869
@dipeshsharma7869 4 жыл бұрын
Wonderful video..thank you for uploading !!
@julieyananzhu1134
@julieyananzhu1134 4 жыл бұрын
Thanks for sharing! It's very informative! Just a minor suggestion, 1+(1|x) actually can be simplified as (1|x), right? I read from lme4::lmer R help file, Table2.
@mikecrowson2462
@mikecrowson2462 4 жыл бұрын
Yes you are right. I presented as my way for pedagogical purposes. Cheers!
@amanrastogi5184
@amanrastogi5184 4 жыл бұрын
Can we include the random slope of 2nd level predictor in a 2 level model? and if yes, then what will this mean? and if not then where am i going wrong? Thank You.
@mikecrowson2462
@mikecrowson2462 4 жыл бұрын
Hi Aman, in general, the more complex your model becomes, the more likely you might run into problems with model convergence (that is because you are estimating additional parameters; by the way, if you specify an unstructured matrix, then it's even more complex as you will have variances and covariances among all randomly varying intercepts and slopes). But apart from this kind of issue there is no prohibition against specifying more than a single slope as randomly varying. Cheers!
@amanrastogi5184
@amanrastogi5184 4 жыл бұрын
@@mikecrowson2462 thank you Sir.
@amanrastogi5184
@amanrastogi5184 4 жыл бұрын
@@mikecrowson2462 But the question stands that if i include a random slope of top level predictor then will than mean to a lower level outcome variable.?
@benabdallahnadia1014
@benabdallahnadia1014 4 жыл бұрын
thanks very much for this video. is-it a cross-section analysis? can we extend this model to panel data model??
@mikecrowson2462
@mikecrowson2462 4 жыл бұрын
Hi there. This example assumes cross-sectional data. However, yes, you can extend this to panel data (e.g., rpsychologist.com/r-guide-longitudinal-lme-lmer). That said, I don't believe you can model more complex level 1 error structures (e.g., autoregressive) using lmer (as you can do in other programs). Cheers!
@benabdallahnadia1014
@benabdallahnadia1014 4 жыл бұрын
@@mikecrowson2462 thank you very much...
@saeidnosrati3782
@saeidnosrati3782 3 жыл бұрын
Hi Mike, thank you for sharing this fantastic video. As a Ph.D. student in the field of management, I want to run a conceptual model with multilevel regression, however, I can not. would it be possible to share us a video in which a conceptual model is being run?
@daqingliu7082
@daqingliu7082 4 жыл бұрын
Thanks for making this very useful video! I had a problem when using reghelper::graph_model. My model has two categorical variables (a and b) as predictors and one continuous covariate (c): m1
@GOGSA007
@GOGSA007 4 жыл бұрын
Why are the standard errors for the variance for the intercept-only model different than those given in the book? I have also tried to replicate this example and I am getting the same results as yours, however, in the book this seems not to be the case. P.S. I have also tried to replicate the 3-level example and I have the same problem. However, the fixed effect coefficients and standard errors are like those in the book for both the 2- and 3-level models.
@mikecrowson2462
@mikecrowson2462 4 жыл бұрын
Hi Georgi, thanks for your question. In the preface that most of the analyses carried out in the text are done using HLM (the program by Scientific Software International) - with some SEM-based approaches using MPlus. Sometimes, there are differences between programs in certain defaults (e.g., in terms of test statistics reported, such as z-test versus t-test of fixed effects) and even approaches to estimating standard errors (based on raw residuals, Pearson residuals, normalized residuals; use of robust standard errors versus no). I'll be honest, I haven't spent much time unpacking the differences between HLM and the lme4 package, but it looks like HLM uses Robust standard errors (see stat.utexas.edu/images/SSC/Site/M_HLM_Tutorialv2.pdf) by default, whereas this does not seem to be the case with 'lme4' (at least I have not found any discussion of robust standard errors in the documentation: cran.r-project.org/web/packages/lme4/lme4.pdf or cran.r-project.org/web/packages/robustlmm/vignettes/rlmer.pdf). This is further supported by a post here arxiv.org/abs/1612.04911 and article here (www.jstatsoft.org/index.php/jss/article/view/v087c01/v87c01.pdf) where the authors review their strategy for obtaining these standard errors when using lme4. Hope this helps!
@GOGSA007
@GOGSA007 4 жыл бұрын
@@mikecrowson2462 Thank you for the prompt response! This could indeed be the case so I will have a look at the sources you provided (just to let you know the first link you provided requires permission to access the site). It is slightly disturbing, though, because in Hox's analysis in the book the variances are statistically significant, while when you perform the analysis with the lme4 package, they are not. I will look into that and if something comes up I will give you a shout here. Thanks again and keep up with the nice work you're sharing with us!
@guani2155
@guani2155 4 жыл бұрын
Hi Mike, I had a problem when running the the fist function str(hox2010ch2).Here is the code and the error information: > str(hox2010ch2) 'data.frame': 2000 obs. of 12 variables: Error in nchar(x, type = "w", allowNA = TRUE) : invalid multibyte string, element 1 Could you please tell me what's wrong with it?
@guani2155
@guani2155 4 жыл бұрын
I'm running it in RStudio, it shows the error information. But I tried it in R then I can see the structure of the data
@daviddearlove
@daviddearlove 3 жыл бұрын
@@guani2155 ditto. did you do the rest in r vs. r studio?
@guani2155
@guani2155 3 жыл бұрын
@@daviddearlove Hi David, I was using R studio
@konradhryniewicz7388
@konradhryniewicz7388 4 жыл бұрын
Nice video :))) thanks!
@mikecrowson2462
@mikecrowson2462 4 жыл бұрын
You are very welcome!
@amanrastogi5184
@amanrastogi5184 5 жыл бұрын
Sir, Can you make a video on Multivariate Multilevel Modelling (theory + practical) ? it will be very helpful of you, Thank You.
@mikecrowson2462
@mikecrowson2462 4 жыл бұрын
Hi Aman, I'll put this on my "to-do" list. I think I'll probably be doing something on this sometime in the near future. Best wishes!
@amanrastogi5184
@amanrastogi5184 4 жыл бұрын
Thank you, Sir.
Multilevel models in R
21:34
Kasper Welbers
Рет қаралды 18 М.
УЛИЧНЫЕ МУЗЫКАНТЫ В СОЧИ 🤘🏻
0:33
РОК ЗАВОД
Рет қаралды 7 МЛН
OCCUPIED #shortssprintbrasil
0:37
Natan por Aí
Рет қаралды 131 МЛН
PERFECT TABLES IN #R ! 💪 {gtsummary}
11:13
yuzaR Data Science
Рет қаралды 30 М.
Mixed Model Analysis: Real Example
18:21
Quant Psych
Рет қаралды 10 М.
Longitudinal Multilevel Modeling in R Studio (PART 1)
16:06
Jon B Stats and Psych
Рет қаралды 27 М.
Predicting tree height with linear mixed models and lme4
16:28
Matthew Russell
Рет қаралды 11 М.
Fitting mixed models in R (with lme4)
15:38
Quant Psych
Рет қаралды 30 М.
Multilevel and mixed models, random and fixed part
6:40
Mikko Rönkkö
Рет қаралды 21 М.
R tutorial: Multilevel  models part 1, variance components in random intercept models
18:20
Statistics Guides with Prof Paul Christiansen
Рет қаралды 4,3 М.
Multiple linear regression using R studio (Aug 2022)
33:49
Mike Crowson
Рет қаралды 25 М.