Linear regression using R programming

แชร์
ฝัง
  • เผยแพร่เมื่อ 10 ก.ค. 2024
  • Simple linear regression models using R programming doesn't need to be scary. This video will take you through the basics of how to interpret linear regression results and the code needed to do the regression models. If you are learning regression modelling or just learning statistics and quantitative analysis then this is a good place to start. Data science and research often address questions by looking at how much of a change in one variable can be explained by a change in another. Linear models are used to answer this question. They can also be used to predict the value of one variable given the value of another. I also go through how to use the predict function in R.

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

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

    This good stuff! Thank you. Great explaining of what regression is and what each part of the formula means! Thanks a million!

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

    No words can thank you enough for these videos. You are the best R teacher I've ever seen.

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

      That’s very kind of you to say. Thanks a lot.

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

    Thanks! I haven't programmed in R in roughly two years, and I needed to catch-up on programming in R Studio for a university project, so your video was excellent for that purpose. Appreciate your content.

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

      That's so great to hear - thanks. You got this!

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

    Thank you! you are great at explaining the concepts and applications on this type of analysis and you also make it so easy to learn how to use this information in R data analysis! Please keep making more videos!

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

      Glad you like them! Yes indeed, more to come!

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

    Thank you very much for your easy-to-understand videos. Appreciate your time as well.

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

    Thank you so much 🙏 I'm always looking forward to seeing your videos. It's always very very understandable

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

      Thanks for the feedback (much appreciated).

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

    I am already subscribed and like each of your videos that I watch. Sincerely, if there was a SUPER LIKE, no one would deserve it more than you. Cheers on the fantastic content and your natural teaching ability.

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

      Wow, So nice of you to say, Danly - thanks for the great feedback!!

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

    Great vid. I've been working through the famous ISLR for a few months now and it's nice to revisit the earlier material with a great video like this. It's good to follow along and to try to anticipate where you're going with it. Just shows that even if you're not completely new to the subject, videos like this can be very helpful.
    Looking forward to the markdown video. I've been creating R notebooks for my own learning and they're great.

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

    I absolutely love your material. It's helping me get out of using stupid SPSS and into R.

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

      I'm glad my videos resonated with you and you found it relatable. Thanks for sharing your experience.

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

    Awesome, I’m working on a R project & your videos are a great help.

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

    Thank you
    I can’t wait to see your next video 🙏

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

      That's kind of you to say :) thanks!!

  • @gianluca.pastorelli
    @gianluca.pastorelli 2 ปีที่แล้ว +1

    Another great video! Looking forward to watching your R Markdown tutorial

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

      Thanks. Will publish soon (this week I hope)

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

    Simple, practical and with R...thanks

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

    Would it be possible if you could do a multiple regression with an anova test (to find which model is a better fit), and explain how to interpret the output?

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

    amazing and efficient as always. Thanks. Really enjoying your videos.

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

    Really nice explanation of residuals

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

    Good video man! Thanks

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

    Thank you for the precise videos giving very clear explanations on each step to be taken. Please do a tutorial on Factor analyses (PCA, PCoA etc).

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

      Great suggestion! Thank you for the feedback. Glad you enjoyed it! ☺

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

    Keep up the awesome work!!!

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

    I came here mostly to brush up on my OLS syntax in R, particularly what kinds of data objects (vectors/matrices, data frames, etc.) the function expects to see. (It's the kind of thing that easily slips away from me if I'm not constantly using the software...)
    I know this is a simplified explanation (and a good one too!), but in a model like this, if the intercept term were statistically significant at conventional cut-off levels (it isn't here), it would be evidence - along with things like asymmetric residuals - that the model was mis-specified (i.e. that it didn't capture the theoretically plausible functional form of the relationship).
    No doubt other videos in the playlist will go into how to detect mis-specification and what kinds of changes to the model might be warranted.

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

    Awesome video! I hope you could do one on multiple regression, specifically about model building strategies since that’s not really well discussed in texts. Thank you!

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

      Great suggestion! Thank you for your feedback!

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

      Seconded. Btw great series 🎉

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

    thank you so much for your help your videos are just amazing.good luck

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

      So nice of you. Thank you for the amazing feedback!

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

    Great toturial, NOW I got what's going on

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

      I'm thrilled to hear that. Thank you for letting me know!

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

    Nice explanation, thank you!

  • @bacayans.b3733
    @bacayans.b3733 ปีที่แล้ว

    Superb video.

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

    That's a very nice explanation of a simple linear model so far I've seen. I have one question. How do we know that the slope or the model is a good fit to predict any x value by looking at the P value? Is it like how close the P is to 0, the better model it is?

  • @ManuelLopez-ej8sn
    @ManuelLopez-ej8sn 2 ปีที่แล้ว +4

    Ì tried to reproduce the graph. Is there a better way to:
    1) Left align the annotation and
    2) Import the values of the y intercept, slope, p-value and r2 in the annotation?
    Thank you! 😊
    cars %>%
    filter(dist < 110) %>%
    ggplot(aes(speed, dist))+
    geom_point(colour= "red")+
    geom_smooth(method = "lm", se = 0)+
    theme_bw()+
    annotate("text",
    x= c(9.15, 8, 8.2, 7.7),
    y= c(90, 80, 70, 60),
    label=c ("Y intercept = -17,5",
    "Slope = 3,9",
    "p = 1.49e-12",
    "R2 = 0,65"),
    colour = "blue")+
    labs(title = "The relationship between speed and stopping distance")

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

    Question regarding the data = ., so that means if not written in this example, R would slot the df at the beginning, turning the df into the dependend variable? Hence using data = ., the function defines the variables first then looks them up in the df?

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

    that is a great video, I would like to see you explaining other statistical methods like PCR, RANDOM FOREST, LOSSO, RIDGE KNN, ... etc.
    thank you for your effort I really enjoy watching your videos.

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

    Thank you for your videos, they have been very useful with getting to grips with my course! Will videos on multiple and logistic regression be released in the future?

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

      Thanks for the comment. Glad you like the videos. Yes I'll create videos on logistic regression and multiple regression soon.

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

    Thanks for this video. well explained 🤩 You posted this in 2022 and I am benefitting in 2024. 😍

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

    Thanks for sharing this amazing knowledge.

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

      I am an SAP consultant working on finance domain and I have actually started realizing how much useful this could be. Hopefully I will be able to apply this knowledge in my domain.

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

      Apart from slope, Y-intercept & p-value, there are many other numbers in the model output... Can you please explain them?

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

    Super informative video almost exactly what I was looking for, a few things that would be of interest,
    formal studies have a sort of lack of focus on the R script writing, post grad studies seem to have an assumed knowledge regarding how you write R script, great functions are provided but how do they work in the script or more importantly how do you use them , took me way to long to apply lables to my data when importing it and creating my own data sheets for analysis.
    I'd be more interested in data that is created as in how do you go from a spreadsheet from field data or surveys, like the data hospital staff collect on patients in hospital charts or pharmacy tests or environmnetal studies that have multiple often correlated or covaried data into a format appropriate for R to analyse like the iris data that is built in. like you've done the examples on how to analyse these inbuilt data from starwars or this car speed data... lets go the next step..., your perfoming your own study where you've gathered various data lets go through how to set up this possibly ugly massive dataset into a format before it becomes a monster to plug in so we can analyse it. I'm still a noob with R, your videos are brilliant and said in a manner that is simple and concise and not overly mathematical. unlike Rs user manuals and examples.

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

    May I ask whether there is any update on the markdown video? How to export the regression output table to word, excel, etc. ?

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

    I am looking forward to the presentation on RMarkdown. Hope you explain the difference between R Note book and RMarkdown!
    Thanks!

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

    Thank you for the video

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

    This is an awesome video sir. I love the annotations on your videos. Please what software do you use to make such annotations? This will really help my videos too. Thank you Greg. By the way you are a big inspiration to my channel😊

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

      happy to connect with you about this. I've just checked out your channel - great job - lovely resource!

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

      @@RProgramming101 Wow!!! I am super honored to hear this from you. You are my superhero 😊. I will send you a mail to connect. By the way sir you have inspired (and continue to inspire) thousands of Medical students and researchers in my country and continent! We love you sir. Thank you for all you do

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

    I would like to ask you - when you explain logistic regression - that you would make a video on multiple logistic regression.
    I believe you would explain it very well.

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

    Thank you!❤ finals are due Saturday!

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

    where is the viedo where i can learn how to put the y intercept, slope, R2 ect..

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

    I know this is not a very technical question and I see which theme you use, but im wondering if you have used other editor theme's, which you prefer best and why do you choose to use the theme you show in all of your videos?

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

    Great!
    Quick question. Is the last set of code with nested operations a so-called "windows function"?

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

      I'm not sure but will try to find out for you

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

    how did you create the plot?

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

    I love your videos! Is there any way you can do a video on time series analysis?

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

      Thank you for the feedback and suggestion. Glad you enjoyed it!

  • @gianluca.pastorelli
    @gianluca.pastorelli 2 ปีที่แล้ว

    The video on R Markdown never showed up ☹️

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

    Great video! Thanks a lot for sharing but can the sound quality be improved on, I often struggle to hear as I watch the videos. Thanks again for sharing

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

    Can you elaborate more on what is p hack or how to define alpha before the experiment. I am from biology and sorry if i added this comment to the wrong video. And thanks a lot for your videos (subscribed). Mohamed

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

    Interesting using a social science/statistical methodology on this data set. Wouldn’t this be more a physics question? Objects in motion and measuring the effort it would take to stop?
    A disturbance term in this model would be the weather conditions, I would add in data set of 1 and 0, 1= rain in forecast that day and 0 = no rain in forecast

  • @user-zj7cr2pg7c
    @user-zj7cr2pg7c 8 หลายเดือนก่อน

    Perfect video, watched 2023.11.10

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

    How do I command R to make the linear graph you presented ?

    • @gianluca.pastorelli
      @gianluca.pastorelli 2 ปีที่แล้ว

      Watch his videos about scatter plots with ggplot and you'll learn everything you need

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

    Sir make a video about #Meta analysis in R
    #Meta analysis in R

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

    Sir please Make a video ##Meta analysis**

  • @user-pu9ll7vd5m
    @user-pu9ll7vd5m 3 หลายเดือนก่อน

    Don't know how to have a lm diagram (at Plots). Anyway, it's great content on this. Thanks -

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

    How would you plot an lm model using ggplot?

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

    Thank for your videos
    could you please make a video how to draw linear regression using ggplot

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

      Great suggestion! Thank you for the feedback.

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

    Can we get access to your programming code? Do you post it somewhere?

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

      hi there - I'm going to make my code available at www.learnmore365.com (some of it is there already)

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

      @@RProgramming101 thanks! Much appreciated!

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

    don't you publish the code?

  • @user-cg9cf4mk6e
    @user-cg9cf4mk6e 11 หลายเดือนก่อน

    i hav same paintik

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

    May i say. Your video is very nice and useful, but you always use the data in R, i think better to use the data that you creat it yourself and explan to save it in .csv file at the same time, that will be easy to understand because when we practice some times confusse with eg. "head, car..." hence what is head? what is cars?,etc. that really confuse and complicate when practice

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

    The weird added music ruined it