Part 10 of my series about the statistical programming language R! In this video I show how a linear regression line can be added to your data-plot. Also I show how you can add lines to your plot manually. Finally you will learn how to generate normal-distributed random values and a line will be generated that fits those random numbers best.

Amazon Auto Links: No products found.

Nice… file.choose() really cool

please do a tutorial for non-linear regression 🙂

Thank you very much. I learn all your 10 videos.

Thank you for this video. Do you know if there are any resources for multivariate multiple regression in r?

Very good video. Thank you for educating community. Best regards from Poland!

I have GCSE results want to do linear regression, first I want to analysis the data, then I want to predicate results for summer. how do I do it?

I have put names on my x-axis and they are too big to be all displayed. Adjusting the size of the font does not help. Can you rotate the names 90 degrees?

abline(lm(y~x)) draws the line on the graph as you already know.

To get the value of the slope, all you have to is write the same thing without the abline. So:

lm(y~x). This will spit out the coefficient and the slope.

very good, thank you

hey, do you know how it is possible to do a multivariate regression/fitting with legendre polynomials (or other orthogonal polynomials) ?

very example oriented, useful!

*th* … german sickness 😀

anbline is showing error , how to solve that?

thanks it was useful

thank you, you helped me a lot!

Excellent collection. Thanks for taking time. Your method is really captivating. I am not sure if you are intentionally making the typos, but those makes me think about what is wrong and makes my learning more effective!!!

Also, the timing is just right to learn a concept without overdose!

Thanks for taking time to do this.

Hi, how can I get a putout about the slope, once i have created abline? I need the value..

Thx

Thankyou sooooooooo much for putting all this together… 🙂

ah good catch! Today. its 102 and problem solved x = 1:102

Thanks a lot dear,,, please keep going; more Plot pleaseeeeeeeeeeee

It’s line of best fit

Thank you for sharing this video clip 🙂

Do you have a tutorial for quantile regression and nonparametric quantile regression? If not, can you make plis?

Thank you very much, nice intro and good example

awesome job…………. thanks for your efforts, teaching this monkey R 🙂

Thank you very much. It’s very helpful

Awesome tutorial. Thank you so much for sharing.

When I write > abline(lm(y~x))

I receive

Error in model.frame.default(formula = y ~ x, drop.unused.levels = TRUE) :

variable lengths differ (found for ‘x’)

What is the problem here?

Thank you very much for your work 🙂

Vielen dank 🙂

Thanks though 🙂

Outstanding. How do you obtain numerically, a—the y intercept—and b the slope after it has been plotted?