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.
No words can thank you enough for these videos. You are the best R teacher I've ever seen.
That’s very kind of you to say. Thanks a lot.
This good stuff! Thank you. Great explaining of what regression is and what each part of the formula means! Thanks a million!
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.
That's so great to hear - thanks. You got this!
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!
Glad you like them! Yes indeed, more to come!
Thank you very much for your easy-to-understand videos. Appreciate your time as well.
You are most welcome
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.
Wow, So nice of you to say, Danly - thanks for the great feedback!!
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.
Glad you liked it! Thanks for the feedback!! :)
11😊
Thank you so much 🙏 I'm always looking forward to seeing your videos. It's always very very understandable
Thanks for the feedback (much appreciated).
I absolutely love your material. It's helping me get out of using stupid SPSS and into R.
I'm glad my videos resonated with you and you found it relatable. Thanks for sharing your experience.
Awesome, I’m working on a R project & your videos are a great help.
Great to hear!
amazing and efficient as always. Thanks. Really enjoying your videos.
Wow, so great to hear! Thank you!!
Another great video! Looking forward to watching your R Markdown tutorial
Thanks. Will publish soon (this week I hope)
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).
Great suggestion! Thank you for the feedback. Glad you enjoyed it! ☺
Simple, practical and with R...thanks
You're welcome!
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!
Great suggestion! Thank you for your feedback!
Seconded. Btw great series 🎉
Thank you
I can’t wait to see your next video 🙏
That's kind of you to say :) thanks!!
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?
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.
Great suggestion!
Really nice explanation of residuals
Thanks for this video. well explained 🤩 You posted this in 2022 and I am benefitting in 2024. 😍
Wonderful!
Ì 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")
Superb video.
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.
I am looking forward to the presentation on RMarkdown. Hope you explain the difference between R Note book and RMarkdown!
Thanks!
Will do!
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?
Keep up the awesome work!!!
Thanks! Will do!
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?
Thanks for the comment. Glad you like the videos. Yes I'll create videos on logistic regression and multiple regression soon.
Good video man! Thanks
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.
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?
Nice explanation, thank you!
Glad you enjoyed it! Thanks.
thank you so much for your help your videos are just amazing.good luck
So nice of you. Thank you for the amazing feedback!
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.
Thanks. Will do my best.
May I ask whether there is any update on the markdown video? How to export the regression output table to word, excel, etc. ?
Great toturial, NOW I got what's going on
I'm thrilled to hear that. Thank you for letting me know!
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😊
happy to connect with you about this. I've just checked out your channel - great job - lovely resource!
@@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
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
Thanks for sharing this amazing knowledge.
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.
Apart from slope, Y-intercept & p-value, there are many other numbers in the model output... Can you please explain them?
Thank you!❤ finals are due Saturday!
Thank you for the video
Thanks for watching!
I love your videos! Is there any way you can do a video on time series analysis?
Thank you for the feedback and suggestion. Glad you enjoyed it!
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
Great!
Quick question. Is the last set of code with nested operations a so-called "windows function"?
I'm not sure but will try to find out for you
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
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?
Sir make a video about #Meta analysis in R
#Meta analysis in R
Sir please Make a video ##Meta analysis**
Don't know how to have a lm diagram (at Plots). Anyway, it's great content on this. Thanks -
Thank for your videos
could you please make a video how to draw linear regression using ggplot
Great suggestion! Thank you for the feedback.
how did you create the plot?
where is the viedo where i can learn how to put the y intercept, slope, R2 ect..
The video on R Markdown never showed up ☹️
Perfect video, watched 2023.11.10
How do I command R to make the linear graph you presented ?
Watch his videos about scatter plots with ggplot and you'll learn everything you need
Can we get access to your programming code? Do you post it somewhere?
hi there - I'm going to make my code available at www.learnmore365.com (some of it is there already)
@@RProgramming101 thanks! Much appreciated!
How would you plot an lm model using ggplot?
I'll make a video about that
don't you publish the code?
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
i hav same paintik
oo yes
The weird added music ruined it