Multivariable Linear Regression in R: Everything You Need to Know!

Поделиться
HTML-код
  • Опубликовано: 21 авг 2024

Комментарии • 91

  • @sha0843
    @sha0843 4 месяца назад +4

    I am a PhD candidate and I am using these models in my data analysis. Great video so far on this topic!

  • @Featherlicht
    @Featherlicht 3 месяца назад +1

    Hands down some of the most informative videos that exist on Linear models. Very concise too ! Thank you 🙏

    • @yuzaR-Data-Science
      @yuzaR-Data-Science  3 месяца назад +1

      You're very welcome! And thanks for such a generous feedback! ☺️

  • @demigod4504
    @demigod4504 11 дней назад

    This is gold. Thank so much Sir for sharing this valuable knowledge ❤

  • @hikeaway1596
    @hikeaway1596 2 дня назад

    as always - excellent!

  • @chacmool2581
    @chacmool2581 4 месяца назад +2

    1:12 It gets worse. In the context of ANOVA you have 'factors' for categorical independent variables and 'covariate' for numerical ones. 😢
    1:50 yeah, performance::check_model() is the bomb.

    • @yuzaR-Data-Science
      @yuzaR-Data-Science  4 месяца назад +2

      yeah, factor is another useless name. drives me nuts. especially, when ML folks come and name old good known things in a new fancy manner :), just complicating things for everyone while feeling great. check_model rocks 🤘

  • @yassinejaber5924
    @yassinejaber5924 27 дней назад

    Excellent explanations!

  • @rubyamanda9009
    @rubyamanda9009 26 дней назад

    Hi, I’m a new subscriber. Wow🎉I am glad you shared this! Thank you!

    • @yuzaR-Data-Science
      @yuzaR-Data-Science  26 дней назад

      Thanks 🙏 Amanda! Hope other videos are also useful ☺️

  • @suelook9562
    @suelook9562 3 месяца назад

    Excellent work! Thanks YuzaR

  • @kellycriterion1019
    @kellycriterion1019 2 месяца назад

    Great work. Please do videos on Survival Analysis in R as well😊

    • @yuzaR-Data-Science
      @yuzaR-Data-Science  2 месяца назад

      Thank you very much! Will definitely do. Just made some videos on linear regression in R. Logistic will follow and then the rest of models including Survival and ML one day. 3 years ago I've done two videos on survival already, but they are old, theoretical and low quality. I'll redo them in a more concise and R focused way. Thanks for nice feedback and for watching!

  • @tom_hoel
    @tom_hoel 4 месяца назад +2

    Incredible work! Thanks :) Could you please deepdive into tidymodels too?

    • @yuzaR-Data-Science
      @yuzaR-Data-Science  4 месяца назад +2

      Great suggestion! :) And I actually tried to do that for linear model twice, but broke up due to a unnecessary complexity of tidymodels for simple models, like LM of GLM. Paradoxically, the functions I use here are much more insightful :). But I still have it in the back of my mind to dive deeper into tidymodels. I just created one video on resampling in tidymodels, and it did not perform better as good as one might think in the age of machine learning. The emmeans video is better, may be because it's more useful and pragmatic. Anyway, thanks for watching and for your nice feedback!

    • @OnLyhereAlone
      @OnLyhereAlone 4 месяца назад

      I'm not surprised by your observation. Why would anyone do machine learning using the complicated recipes in TidyModels when SciKitLearn in Python is much tidier and straightforward?

    • @yuzaR-Data-Science
      @yuzaR-Data-Science  3 месяца назад

      well, one day I have to learn Python too I am afraid ;)

  • @ahmedelkoumi4306
    @ahmedelkoumi4306 4 месяца назад

    Great and to the point. Thanks!
    I'd like to see you explain some topics like propensity score matching, multiple imputation, and principal component analysis.
    I guess that would be fantastic if you present them in a such elegant way.

    • @yuzaR-Data-Science
      @yuzaR-Data-Science  4 месяца назад +1

      Thanks, Ahmed! I already have an older video on Imputation, but it still works, I use {missRanger} package for imputation to this day. Feel free to check it out! Thanks for the suggestions, I'll put the on the list! I plan to cover basic most common models first though, like logistic regression, before coming to PCA. So, please, stay tuned. Cheers!

  • @Positive_musician
    @Positive_musician 4 месяца назад

    Outstanding! Thank you so much for putting so much effort in these educational videos!

    • @yuzaR-Data-Science
      @yuzaR-Data-Science  4 месяца назад

      So nice of you! Greatly appreciate your positive feedback!

  • @soylentpink7845
    @soylentpink7845 4 месяца назад

    Very good explanations! Very good visualizations! Great - thank you!

    • @yuzaR-Data-Science
      @yuzaR-Data-Science  4 месяца назад

      Glad you enjoyed it! Thanks for positive feedback! 🙏

  • @faisalaziz6963
    @faisalaziz6963 4 месяца назад

    Fantastic and concise content as usual with elegent explanation! Keep up your great work!

    • @yuzaR-Data-Science
      @yuzaR-Data-Science  4 месяца назад

      Much appreciated! I always enjoyed creating content, but such warn feedback as yours tells me that it's also useful! Thanks so much!

  • @hendrikpehlke4973
    @hendrikpehlke4973 2 месяца назад

    Wow! One of the best videos I have ever seen. Vwer informative.

    • @yuzaR-Data-Science
      @yuzaR-Data-Science  2 месяца назад

      Wow, thanks for such a generous feedback! If you know some folks who also would benefit from it, feel free to share it! I wish I had something like this video as I started to learn R. I hope the other videos are helpful too! Thanks again! Cheers!

  • @alirezasadeghi2975
    @alirezasadeghi2975 4 месяца назад

    Beautiful

  • @Y45HV1N
    @Y45HV1N 4 месяца назад

    This is super cool! Best rstats content on RUclips! Will you show multivariate (multiple outcomes) next?

    • @yuzaR-Data-Science
      @yuzaR-Data-Science  4 месяца назад +1

      Wow, thanks for such a generous feedback! 🙏 Love it! Multivariate? Eventually, but I never understood what's the difference between multivariate models with 3 different outcomes and 3 separate models of the same outcomes? Is there any connection between outcomes, are they somehow weighted or so? Because if not, I already created a video which is much better than that "Many Models At Once". If yes, please, let me know, and, if you can, recommend some good literature. Cheers!

    • @Y45HV1N
      @Y45HV1N 4 месяца назад

      @yuzaR-Data-Science my understanding is that if the outcomes are correlated but still different, then, not accounting for this could bias the estimate, and on the other hand, accounting for it could reduce the standard error, providing more precision (and statistical power). For example, if you want to study the effect of a medicine on some sort of mental health phenomenon, you could ask for patients to self-report their state, but in the same study, you could also ask their doctors to give their ratings, and on top of that you could maybe use their smartwatch to collect some behavioral data. All three are indicators of the same thing but also a bit different.

    • @yuzaR-Data-Science
      @yuzaR-Data-Science  4 месяца назад +1

      that's interesting, I work in vet-med area, and we rarely do multivariate models, but I would have a look at them, and in the end, if I'll find them useful, I'll definitely make a video on them. For now I am concerned about the assumptions. what if assumption for one response hold, but the assumptions for the other not? What model do you use then? Quantile regression? Is there something line a non-parametric MANOVA in R anyway? soooo, many questions :)

  • @amosarubi8468
    @amosarubi8468 Месяц назад

    Thanks so much!

    • @yuzaR-Data-Science
      @yuzaR-Data-Science  Месяц назад

      You're very welcome! Thanks for watching and commenting! That's the best support for the channel!

  • @leno9636
    @leno9636 4 месяца назад

    Hi, thanks again for this great video.
    I really enjoy your explanations, but your blog was much more useful for quick access to concentrated information.
    Videos are very helpful to understand from scratch, but seeing important screenshots in your blog quickly during a time-sensitive project is very important.
    Plus, Koji is also down.

    • @yuzaR-Data-Science
      @yuzaR-Data-Science  4 месяца назад +1

      Thanks a lot for your nice feedback! Unfortunately, my blog was shut down, since Netlify wanted me to start paying for increasing traffic. Since R is open source and I do not earn anything from my blog, I refuse to pay for trying to do something useful for the world. I know the blog is useful, thus I am working on a solution to find the alternative for Netlify. But since I am not the IT guy, it might take time. If you have any suggestions what service is really free for static websites, don't hesitate to inform me.
      As for the Koji, this nice startup was sold, thus, I took the link down from the last video. But if you would like to support me somehow, the best free support is likes, comments and watch-time. While when you would support me financially, you can Thank the video (although youtube takes ca. 50% of that), send me something via paypal or, become a member of the channel. I still did not set up the membership, because I don't believe anyone your become a member even for 1$ per month. But may be I am wrong? Anyway, thanks for watching and being part of my journey on this channel mate!

  • @NiiKotey_Major
    @NiiKotey_Major 4 месяца назад

    Hi Prof/Dr. Yury, I really love your videos because they are very intuitive. Please share how to analyse Likert scale questions using R. Thank you.

    • @yuzaR-Data-Science
      @yuzaR-Data-Science  4 месяца назад +1

      Great suggestion! It's actually already on my to-do list! Time is the limiting resource, because I have a normal job to pay the bills. But I'll do my best to produce more content. Thanks you very much for feedback and for watching!

  • @staedtler8479
    @staedtler8479 4 месяца назад

    i like equatiomatic package (EDIT i found it)
    Thanks again for your efforts !

  • @WilForDataScience
    @WilForDataScience 4 месяца назад

    Excélsior!

  • @Faustasyan
    @Faustasyan 4 месяца назад

    Thanks for the great video!

  • @ramoda13
    @ramoda13 2 месяца назад

    Great video

  • @namelessbecky
    @namelessbecky 2 месяца назад

    Thank you sir

    • @yuzaR-Data-Science
      @yuzaR-Data-Science  2 месяца назад

      So nice of you! Thanks you for watching and commenting!

  • @fouedhamouda7356
    @fouedhamouda7356 4 месяца назад

    thanks for sharing

  • @statlab_stat.solution
    @statlab_stat.solution 4 месяца назад

    Thanks

  • @robertssooka8824
    @robertssooka8824 22 дня назад

    Interesting, I like it

  • @45tanviirahmed82
    @45tanviirahmed82 4 месяца назад

    I'm so into your channel for your clear concise explanation. Watching and learning from each of your videos one by one. Thank you very much.
    [One problem I have been facing when using check_model() command, It shows Plot area is too small. I've tried the solutions it shows in console panel, but couldn't make it work, didn't find any solution online]

    • @yuzaR-Data-Science
      @yuzaR-Data-Science  4 месяца назад

      Thank you so much for such a nice feedback! I greatly appreciate that!
      Sure, it's normal. There are several solutions for it. First, just increase your plot area via dragging the plot window higher and wider. Then, you can click on the + in the plot area to open an extra window, like I do in my videos. And lastly you can use ggsave command to save the last plot like I do in videos. Let me know whether one of those worked.

  • @alexandreb1899
    @alexandreb1899 4 месяца назад

    As usual: excellent class! Best content about stats on yt! But it is not possible to access the scripts via the link in the description (it is broken)

    • @yuzaR-Data-Science
      @yuzaR-Data-Science  4 месяца назад +1

      Thanks for such a generous feedback, Alex! Much appreciated!
      Sorry, Netlify shut down my blog since they want me to pay for increased traffic. I refuse to pay for doing something useful for the world (without earning absolutely nothing) and since R is open source. But I want to reopen it ASAP, as soon as I find an alternative for Netlify. It'll take some time though, because I am not an IT guy. But since RUclips is still free, please use the videos till blog is up and running again, since my blog is actually the script for the video, word by word, code by code. Thanks for understanding!

  • @OnLyhereAlone
    @OnLyhereAlone 4 месяца назад

    First here. Good job as usual.

    • @yuzaR-Data-Science
      @yuzaR-Data-Science  4 месяца назад

      :) Thanks mate! Greatly appreciate your support!

    • @OnLyhereAlone
      @OnLyhereAlone 4 месяца назад

      Now that I'm not rushing to be the first commenter, I have to ask:
      Why use ggeffects instead of emmeans? And although you pointed out that the result is not averaged over all levels of all factors, you should have mentioned that emmeans (or maybe other libraries) should be used in that case. What I use is sjplot tab model to just tell which factor have significant effects, and then emmeans with contrast/pairwise which I like to plot out.
      By the way, what do you think about showing both in a publication?
      Another question is that does it not matter that your multivariate model has only + and not * between all the predictors.
      Sorry, I know these may not all be short answer stuff, but I'll appreciate your response as always. Thanks.

    • @yuzaR-Data-Science
      @yuzaR-Data-Science  3 месяца назад

      Hi mate, first, the ggeffects instead of emmeans it's just convenience for visualization. In fact, ggeffects uses emmeans in the background. Tab_model is fine, but does not produce contrasts, emmeans and tbl_regression(add_pairwise_contrasts = T) do. I always show contrasts in my publications! Don't know what do you mean by "both". You can't use interactions between all the predictors, your model would most likely collapse and be hardly interpretable. Interactions are cool, and I use them, but they can be pain in the ass, so I try to use only bivariable interactions (between only two predictors), not multiple interactions in the same model. Cheers!

  • @moviezone8130
    @moviezone8130 3 месяца назад

    You set the bar high sir, I am new to this channel but I found it highly informative and educational. Please can you share the code in pdf or some other means. How can I find you on githu. I am YBMengist from Ethiopia.

    • @yuzaR-Data-Science
      @yuzaR-Data-Science  3 месяца назад +1

      Thank you again for your nice feedback. Have a look at my responses to your two previous questions. Kind regards!

  • @faruqueazamwalid219
    @faruqueazamwalid219 3 месяца назад

    thanks a bunch!! I have a random question: how to add a proportional weightage to a numeric variable on the outcome variable in a lm/glm and visualise. It is much like giving the weightage to the sample size of each study “n” to the outcome. Much like meta analysis but it is a pooled analysis. Thanks in advance

    • @yuzaR-Data-Science
      @yuzaR-Data-Science  3 месяца назад +1

      hmm, before I say something wrong or stupid, I'd rather say I don't know.
      There is a "weights" argument in the "lm/glm" (lm(data = mtcars, am ~ mpg, weights = )), but I never used it to be honest.

    • @faruqueazamwalid219
      @faruqueazamwalid219 3 месяца назад

      @@yuzaR-Data-Science thanks!

    • @yuzaR-Data-Science
      @yuzaR-Data-Science  3 месяца назад

      you are always welcome!

  • @efdalkaya
    @efdalkaya 19 дней назад

    Thank you for video. I am using performance package in shiny web application. How can i import performance package in shiny?

    • @yuzaR-Data-Science
      @yuzaR-Data-Science  19 дней назад

      I never tried. Could you please let me know, whether it worked, when you try it out? Thanks for nice feedback!

  • @Benjiz1337
    @Benjiz1337 3 месяца назад

    Hi yuzaR, is your website down? I'm trying to get get the R code from some of your videos, but is unable to visit your site.

    • @yuzaR-Data-Science
      @yuzaR-Data-Science  3 месяца назад

      Hi Benjiz, unfortunately it was blocked for too much traffic. I’ll try to reopen it ASAP with free alternative, but in the meanwhile please just rewatch the videos, because my blog is the script for them, so you won’t miss anything. If you wanna get the whole code now, consider to join my channel to become a member, because I send the code to members. Cheers

  • @JRFtoPhD
    @JRFtoPhD 4 месяца назад

    Is there any way .. from where i can get the data used by you in this video

    • @yuzaR-Data-Science
      @yuzaR-Data-Science  4 месяца назад

      of coarse!
      install and load ISLR package, the data is in there ;)
      library(ISLR)

  • @NextGenAge
    @NextGenAge 3 месяца назад

    Which version of RStudio are you using? I'm running into error's often.

    • @yuzaR-Data-Science
      @yuzaR-Data-Science  3 месяца назад

      The last one. But R Stuio is most likely not a problem. Just update everything: R, Rstudio and packages 📦 let me know whether it worked

    • @NextGenAge
      @NextGenAge 3 месяца назад

      @@yuzaR-Data-Science It's mostly when I do Multiple LR with many features. I already made sure all were numeric and no categorical but it doesn't plot for check_model(). For some other lr it still works..?

    • @yuzaR-Data-Science
      @yuzaR-Data-Science  3 месяца назад

      still, the rstudio is not a problem, it could be too many predictors, bad data quality, total separation or something else. get it to work with a few predictors first, then you can select good predictors and go with them. check_model works fine a my pc with most models.

  • @Lenman55
    @Lenman55 4 месяца назад

    what happened to your website?

    • @yuzaR-Data-Science
      @yuzaR-Data-Science  4 месяца назад +4

      Netlify shut down my blog since they want me to pay for increased traffic. I refuse to pay for doing something useful for the world (without earning absolutely nothing) and since R is open source. But I want to reopen it ASAP, as soon as I find an alternative for Netlify. It'll take some time though, because I am not an IT guy. but since RUclips is still free, please use the videos till blog is up and running again, since my blog is actually the script for the video, word by word, code by code. thanks for understanding!

    • @Lenman55
      @Lenman55 4 месяца назад

      @@yuzaR-Data-Science I see, too bad I really enjoyed your work! Maybe github pages is an alternative?