Linear regression using R programming

Поделиться
HTML-код
  • Опубликовано: 5 июл 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

  • @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.

  • @evaashby3460
    @evaashby3460 Год назад

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

  • @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.

  • @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!

  • @huyquach5044
    @huyquach5044 2 года назад +2

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

  • @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.

  • @BulLiT2401
    @BulLiT2401 2 года назад +1

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

  • @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.

  • @jrichalot
    @jrichalot Год назад

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

  • @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)

  • @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! ☺

  • @andresrengifo7801
    @andresrengifo7801 2 года назад +1

    Simple, practical and with R...thanks

  • @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 🎉

  • @kukuab1795
    @kukuab1795 2 года назад +1

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

  • @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?

  • @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.

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

    Really nice explanation of residuals

  • @legiegrieve99
    @legiegrieve99 5 месяцев назад

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

  • @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")

  • @bacayans.b3733
    @bacayans.b3733 Год назад

    Superb video.

  • @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.

  • @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!

  • @madhavanand2787
    @madhavanand2787 9 месяцев назад

    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?

  • @filipk3207
    @filipk3207 2 года назад +1

    Keep up the awesome work!!!

  • @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.

  • @martinabautista
    @martinabautista 5 месяцев назад

    Good video man! Thanks

  • @benlance97
    @benlance97 7 месяцев назад

    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.

  • @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?

  • @hazellu749
    @hazellu749 Год назад

    Nice explanation, thank you!

  • @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!

  • @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.

  • @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. ?

  • @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!

  • @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

  • @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

  • @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?

  • @anonymouslycorrect1
    @anonymouslycorrect1 11 месяцев назад

    Thank you!❤ finals are due Saturday!

  • @bridgettsmith7206
    @bridgettsmith7206 Год назад

    Thank you for the video

  • @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!

  • @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

  • @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

  • @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

  • @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?

  • @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 -

  • @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.

  • @badermuteb4552
    @badermuteb4552 Год назад

    how did you create the plot?

  • @WmRLoughran
    @WmRLoughran Год назад

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

  • @gianluca.pastorelli
    @gianluca.pastorelli 2 года назад

    The video on R Markdown never showed up ☹️

  • @user-zj7cr2pg7c
    @user-zj7cr2pg7c 7 месяцев назад

    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

  • @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!

  • @stuartfechhelm553
    @stuartfechhelm553 2 года назад

    How would you plot an lm model using ggplot?

  • @homataha5626
    @homataha5626 Год назад

    don't you publish the code?

  • @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

  • @user-cg9cf4mk6e
    @user-cg9cf4mk6e 11 месяцев назад

    i hav same paintik

  • @michaeldillman1660
    @michaeldillman1660 2 года назад

    The weird added music ruined it