Multiple Regression in R, Step by Step!!!

แชร์
ฝัง
  • เผยแพร่เมื่อ 21 ธ.ค. 2024

ความคิดเห็น •

  • @statquest
    @statquest  2 ปีที่แล้ว +2

    Support StatQuest by buying my book The StatQuest Illustrated Guide to Machine Learning or a Study Guide or Merch!!! statquest.org/statquest-store/

  • @smtxtv
    @smtxtv 8 หลายเดือนก่อน +9

    I'm giving this a thumbs up...just on the intro !

    • @statquest
      @statquest  8 หลายเดือนก่อน

      bam! :)

  • @Motorhomemarx
    @Motorhomemarx 7 หลายเดือนก่อน +3

    Excelent work. Double sworded, swiftly slaying the stats serpent from planet r

    • @statquest
      @statquest  7 หลายเดือนก่อน

      Bam! :)

  • @TT-eg1et
    @TT-eg1et 2 ปีที่แล้ว +14

    I love your channel and your way of explaining things!
    Thank you

    • @statquest
      @statquest  2 ปีที่แล้ว +1

      Thank you! :)

  • @thedeeplestofyoursoul
    @thedeeplestofyoursoul 4 หลายเดือนก่อน +2

    Thanks a lot. I'm looking forward to seeing more about multivariate adaptive regression splines!

    • @statquest
      @statquest  4 หลายเดือนก่อน +1

      I'll keep that topic in mind.

  • @JarrodKapeluschnik
    @JarrodKapeluschnik 2 หลายเดือนก่อน +2

    Fantastic video! Thank you

    • @statquest
      @statquest  2 หลายเดือนก่อน +1

      Thank you!

  • @katielui131
    @katielui131 9 หลายเดือนก่อน +3

    This is super as always thanks

    • @statquest
      @statquest  9 หลายเดือนก่อน

      Thanks!

  • @NotMadeOfManitobaFlour
    @NotMadeOfManitobaFlour 8 หลายเดือนก่อน +1

    The r^2, adjusted r^2, and p-value look good;
    HOOOOOORAY!

    • @statquest
      @statquest  8 หลายเดือนก่อน

      bam!

  • @francescomaura5581
    @francescomaura5581 2 ปีที่แล้ว +8

    great video! As usual, I should say :) what about diff-in-diff (with R example, possibly)?

    • @statquest
      @statquest  2 ปีที่แล้ว +2

      I'll keep that in mind.

  • @RedFeather11
    @RedFeather11 ปีที่แล้ว +2

    Thanks a lot Sir. 🤩💐

  • @GetThePun
    @GetThePun 2 ปีที่แล้ว +3

    always amazing!

  • @tabarakalmosawi6659
    @tabarakalmosawi6659 9 หลายเดือนก่อน +1

    thank you very very much!!

    • @statquest
      @statquest  9 หลายเดือนก่อน

      BAM! :)

  • @muss9306
    @muss9306 8 หลายเดือนก่อน +1

    wow amazing video , thank you so much

    • @statquest
      @statquest  8 หลายเดือนก่อน

      Thanks!

  • @sighsha3657
    @sighsha3657 ปีที่แล้ว +1

    why is the results of the tail predicting the linear regression of weight and vice versa?

    • @statquest
      @statquest  ปีที่แล้ว

      What time point, minutes and seconds, are you asking about?

    • @sighsha3657
      @sighsha3657 ปีที่แล้ว

      @@statquest starting at 6.13

    • @statquest
      @statquest  ปีที่แล้ว +1

      @@sighsha3657 At that point we are testing how well we can predict "size" with and without specific variables in the model. So we see how well we can predict "size" with and without "weight" and we see how well we can predict "size" with and without "tail length". These tests help us asses how useful it is to use "weight" or "tail length" to predict "size". A small p-value suggests that a variable is useful.

    • @yourube4367
      @yourube4367 7 หลายเดือนก่อน

      Yeah, I'm struggling with this bit too. It feels like the coefficient line for 'weight' should be comparing the full model against a model with just weight as a predictor, but the explanation suggests the full model is being compared to a model with only tail length as a predictor.

  • @christopherwitt6283
    @christopherwitt6283 2 ปีที่แล้ว +2

    Please can you do a video on multi nominal logistic regression in R?

    • @statquest
      @statquest  2 ปีที่แล้ว

      I'll keep that in mind.

  • @HuyenNguyenNgoc-v3e
    @HuyenNguyenNgoc-v3e 11 หลายเดือนก่อน

    I'm sorry if I'm asking a stupid question, why p-value of weight can tell us using weight and tail isn't significantly better than only tail. Thank you so much

    • @statquest
      @statquest  11 หลายเดือนก่อน +1

      First you need to understand linear regression: th-cam.com/video/nk2CQITm_eo/w-d-xo.html and then you can find the answer to your question in this video that describes the theory of multiple regression: th-cam.com/video/zITIFTsivN8/w-d-xo.html

    • @HuyenNguyenNgoc-v3e
      @HuyenNguyenNgoc-v3e 11 หลายเดือนก่อน +1

      @@statquest thank you so much Sir, I appreciate it a lot

  • @nichananwanchai9910
    @nichananwanchai9910 ปีที่แล้ว +1

    what is data mouse data i kinda confuse but your video really help me

  • @marcingrzebalski103
    @marcingrzebalski103 6 หลายเดือนก่อน

    hello, very helpful video. Anyway I have question though - why inference (06:35) 'using weight and tail isnt significanlty better than using tail alone' is derived from line "weight" and not from "tail" line below? Does the line "weight" of regression output compares exactly 'if using weight and tail is better than using tail alone to predict size'? shouldnt it be 'if predictor WEIGHT alone is better at prediction of size than MODEL WITH BOTH WEIGHT AND TAIL' instead or im wrong? I had course about multiple regression at academics couple years ago and trying to remind everything, I have found your video , but still I actually wanted to know that. Best wishes
    edit: i remember that in stepwise regression we somehow exclude predictors which do not make a significant contribution and are therefore not statistically significant, so reading/watching about stepwise regression may do the thing for me?

    • @statquest
      @statquest  6 หลายเดือนก่อน +1

      For each variable that we test "weight" and "tail", we test the "full model" vs the model without that specific variable. So, for testing "weight" the full model is "weight + tail" and the model without that variable is just "tail". For testing "tail", the full model is "weight + tail" and the model with that that variable is just "weight." You can learn more details here: th-cam.com/video/zITIFTsivN8/w-d-xo.html

    • @marcingrzebalski103
      @marcingrzebalski103 6 หลายเดือนก่อน +1

      ​@@statquest thanks

  • @writerdirect
    @writerdirect 6 หลายเดือนก่อน +1

    i like that you sing; me writer director producer who is also very statistically literate for my work in psychology with daughter who is statistics major

    • @statquest
      @statquest  6 หลายเดือนก่อน

      Thank you!

  • @hrk201
    @hrk201 ปีที่แล้ว +1

    Hey, thank you for your videos, it is really helpful, how do we conduct full inference for multiple linear regression model?

    • @statquest
      @statquest  ปีที่แล้ว

      I'm not sure I understand your question. Can you elaborate on it?

    • @hrk201
      @hrk201 ปีที่แล้ว

      @@statquest hey josh thanks for responding, I have done a linear regression model that describes the data best by using test based and criterion based model selection. I have been asked to "conduct full inference using the best fit model". I am slightly confused as to what needs to be done for this step, is it just the explanation of f-statistics and hypothesis testing obtained from summery of the model?

    • @statquest
      @statquest  ปีที่แล้ว +1

      @@hrk201 That would be my guess, but it's just a guess.

  • @katherinechau5594
    @katherinechau5594 ปีที่แล้ว +1

    So when do you use MLR versus multidimensional scaling?

    • @statquest
      @statquest  ปีที่แล้ว

      Multidimensional Scaling is pretty different. To learn about it, first learn about PCA (only 5 minutes long: th-cam.com/video/HMOI_lkzW08/w-d-xo.html ) and then MDS: th-cam.com/video/GEn-_dAyYME/w-d-xo.html

  • @Cheese_Coffee_
    @Cheese_Coffee_ ปีที่แล้ว +1

    StatQuest is TOTES CRAY CRAY🤣

  • @faizahkhalid9468
    @faizahkhalid9468 ปีที่แล้ว

    How do you know that the relationship between tail and weight? Is there any decision rules? I don't get how to conclude using r square and p values

    • @statquest
      @statquest  ปีที่แล้ว

      A small p-value would cause us to reject the hypothesis that random noise generated the data. For details about p-values, see: th-cam.com/video/vemZtEM63GY/w-d-xo.html

  • @jeffrisher6965
    @jeffrisher6965 11 หลายเดือนก่อน

    Sorry if this is a stupid question, but is there a good way to format the results table? For instance, if I wanted the beta to be rounded to 3 digits, and the t and p values to be rounded to 4 digits?

    • @statquest
      @statquest  11 หลายเดือนก่อน +1

      Good question! The only way I can think of doing it is drawing it yourself using the original values (in this case, they are stored in the variable "multiple.regression") and running them through the round() function.

    • @jeffrisher6965
      @jeffrisher6965 11 หลายเดือนก่อน

      @@statquest Thanks. I bought your machine learning book, but have not had a single minute to sit down and read any of it. Maybe in a couple months...

    • @statquest
      @statquest  11 หลายเดือนก่อน +1

      @@jeffrisher6965 Thank you for your support! I hope you enjoy the book when you have time to read it. :)

  • @LuisSantiago-xo4fm
    @LuisSantiago-xo4fm 2 ปีที่แล้ว +1

    What if the relationship between Y and one of the Xs is not linear?

    • @statquest
      @statquest  2 ปีที่แล้ว

      Then you might need to use a different method.

    • @LuisSantiago-xo4fm
      @LuisSantiago-xo4fm 2 ปีที่แล้ว

      Is there any video of yours on that? This is actually a matter that gets me a bit confused 😅

    • @statquest
      @statquest  2 ปีที่แล้ว +1

      @@LuisSantiago-xo4fm When the relationship is non-linear, you can try regression trees: th-cam.com/video/_L39rN6gz7Y/w-d-xo.html and th-cam.com/video/g9c66TUylZ4/w-d-xo.html

  • @dawmi3140
    @dawmi3140 ปีที่แล้ว

    how to transform large data to be like the smaller values in teh video?

    • @statquest
      @statquest  ปีที่แล้ว

      What time point, minutes and seconds, are you asking about?

  • @montahatfifha4389
    @montahatfifha4389 ปีที่แล้ว +1

    hey! should i perform any tests beforehand ? or not ?

    • @montahatfifha4389
      @montahatfifha4389 ปีที่แล้ว

      is it better to perform this model with R or python ? and is it okay to have 20 observation per variable ?

    • @statquest
      @statquest  ปีที่แล้ว +1

      It depends on what you mean by tests. However, usually multiple regression fits the model and then tests each variable as described. So this would be regression first, tests second.

    • @statquest
      @statquest  ปีที่แล้ว

      20 observations per variable is find. And it's up to you if you want to use R or Python.

    • @montahatfifha4389
      @montahatfifha4389 ปีที่แล้ว

      @@statquest um i thought i should perform the multicollinearity and heteroscedasticity and stationarity and do any correction before proceeding to fitting data?!

    • @montahatfifha4389
      @montahatfifha4389 ปีที่แล้ว

      @@statquest can I contact you please on a more practical platform I have some confusions ://

  • @danielcontreras3744
    @danielcontreras3744 8 หลายเดือนก่อน +1

    the best

    • @statquest
      @statquest  8 หลายเดือนก่อน

      Thanks!

  • @miles6939
    @miles6939 2 ปีที่แล้ว +1

    Matlab?

    • @statquest
      @statquest  2 ปีที่แล้ว +2

      Maybe one day!

  • @victorvasquesribeiro5407
    @victorvasquesribeiro5407 หลายเดือนก่อน

    Not really 'step by step'

    • @statquest
      @statquest  หลายเดือนก่อน

      What parts would you like more details for?