(Old) R — Biostatistics 2020

R5 — Linear Regression

By


Goals of this lesson:

1)  Create scatterplots:

            plot()

2) Generate linear regression result:

            lm()

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

           abline()

 

Instructions

  • Watch the following video:

R5 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

 

  • Practice #4.5 on p97 (from the Check Your Skills Section in your book). Use the data in the question to generate:
        • a scatterplot with a least-square regression line

Here are the results:

coral_reefs_screenshot_1

coral_reefs_screenshot_2

-END-



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