Exercise 2. Blood pressure 2
Now we will compute the average and standard deviation for the subgroup we defined in the previous exercise (20-29 year old females), which we will use reference for what is typical.
You will determine the average and standard deviation of systolic blood pressure, which are stored in the BPSysAve
variable in the NHANES dataset.
This exercise is part of the course
Data Science Visualization - Module 2
Exercise instructions
- Complete the line of code to save the average and standard deviation of systolic blood pressure as
average
andstandard_deviation
to a variable calledref
. - Use the
summarize
function after filtering for 20-29 year old females and connect the results using the pipe%>%
. When doing this remember there areNA
s in the data!
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
library(dplyr)
library(NHANES)
data(NHANES)
## complete this line of code.
ref <- NHANES %>% filter(AgeDecade == " 20-29" & Gender == "female") %>%