How to make a scatterplot in R (with regression line)

preview_player
Показать описание
This tutorial shows how to make a scatterplot in R. We also add a regression line to the graph. We also make a scatterplot with a third variable to add extra insight into our graph.

Thank you for watching this video. Make sure to like the video if you found it helpful and subscribe if you want to see more videos like this one!
Рекомендации по теме
Комментарии
Автор

Great video, but I am trying to do just this, had the same code you used. R didnt return any errors, but my regression line does not show up on my scatterplot. Any help on why that is would be appreciated.

Thatonepersonwholikesmath
Автор

Dude thankyou so much been stuck on this all day!! You’ve helped massively!!

lilygriffiths
Автор

thank you! very simple, straight to the point and very organized

sonam
Автор

Thank you! Quickly and easily explained!

alinawilke
Автор

Please I am working with several subsets of data, can I get an explanation on what to do. The question goes like this, for birth weights and pregnancy, I should assign women who smoke to 1, those who don't to 2, and those who never tried to 3. Them I should later plot a graph of the birth weight in addition to the pregnancy of those who didn't, thus 2.

knowledgeahadzitse
Автор

Hey! Thank you very much for your useful video. I was just wonderin though: somehow I have made it such that my plots appear in a new window (i.e not in the console). Every plot I do, it makes a new window that minimises when I change my code. How do I change it bac so that my plots appear only in the plot section of the console?

daughterofunicorns
Автор

You explained that easy and short and I understood it and it really helped right away, thanks alot!

SerafinKeilin
Автор

My scatter plots don’t look right, what am I doing wrong? Please help because my assignment is due Tuesday!

tamerajames
Автор

Please make more videos on R. I am a psychologist who likes your simple and easy method of teaching stats with R. Please also cover non linear models, ancova, manova, repeated measures etc in your future videos. But using the same easy method. Great stuff.

AsirAjmal
Автор

I keep getting these errors when I plot 2 independent ad one dependent variable. How do I fix it???

## Warning in scatterplot.default(X[, 2], X[, 1], groups = X[, 3], xlab = xlab, : number of groups exceeds number of available colors
## colors are recycled

CB_
Автор

is it necessary to specify the data source in the abline function? I tried with specifying it and without it and the same regression line still plots the same either way.

Arrozito
Автор

I am a complete beginner in programming. Can someone tell me the proper way to enter ~ within the lm() function please? I have tried shift # but didn't work. Thanks

volatility
Автор

Hi.
Thank you for this video.

I have one question:

How can I get the R -squared value or other information about regression, for each regression line recognized trough a third variable with "car-scatterplot"?

If I use summary(lm(y~x, data=mydata)) I have information about the whole selected dataset and not about each subgroup recognized trough "car-scatterplot" and a third variable.

I hope the question is clear.
Sorry, but I'm newbie of R.

antoniomanco
Автор

I cant find the package car when you did library(cars)

oc_pr
Автор

Thanks for the help! Very easy to follow

lilia.
Автор

Awesome vid, so much out of so little

vincentray