Week 1 - Homework

week01
homework

Write your code directly in a Quarto document.

To create a Quarto document: go to File -> New File -> Quarto Document, then click Create.

  1. Import the data file “visceral_fat.csv”.

Tip:

Use the click-button method in RStudio to upload and import the file. Then, copy and paste the R commands generated into a code chunk in your Quarto report.

Once imported, you can use the visceral_fat dataset for further analysis in your report.

  1. Summarize the dataset.

Run the function summary(visceral_fat) to generate a summary of the dataset. Describe what information you obtained.

  1. Draw a histogram.

Create a histogram for the diastolic blood pressure using the column visceral_fat[["diastolic_bp__mmhg"]]. Describe what you observe from the plot.

  1. Handle an outlier.

After consulting with a clinician, you discover that the 27th value of the diastolic blood pressure was incorrectly recorded.

  1. Compare mean and median.

Calculate the mean (mean()) and the median (median()) for the diastolic blood pressure

Describe how the outlier affects the mean and median.

  1. Click “Render” to generate your Quarto report.

The homework correction is available here: link