R GraphicsLesson 26Free preview
R Scatterplot
This lesson is part of R · All levels
Summary
This study reviews the Scatterplot (scatter diagram) used to study the relationship or correlation between two continuous quantitative variables. Developers will learn how to draw scatterplots, interpret the direction of positive/negative correlation, as well as add linear regression trend lines using the abline() function.
Key points
- Scatterplot maps the pair of coordinate dots (x, y) to see the data correlation
- The pattern of dots that tilt up to the right shows a positive correlation
- The 'cor(x, y)' function calculates the coefficient of mathematical correlation
- The 'abline(lm(y ~ x))' function draws the best linear regression of the trend across data dots
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.