R — Biostatistics

Lesson 5 — Linear Regression

By


Goals of this lesson:

1) Create scatterplots:

plot() pch() col()

2) Generate correlation:

cor()

2) Generate linear regression result:

lm()

3) Draw a least-squares regression equation on your scatterplot:

abline()

 

Instructions

  • Watch the following video:

Lesson 5 Linear Regression

 

  • For the details on the “pch” argument, see the link:

http://www.sthda.com/english/wiki/r-plot-pch-symbols-the-different-point-shapes-available-in-r

 

  • Here is a list of colors to choose from for the command col():

http://www.stat.columbia.edu/~tzheng/files/Rcolor.pdf

-END-



Content is copyright the author. Layout is copyright Mark Ciotola. See Corsbook.com for further notices.