d <- tibble(
x = c(3, 5, 1, 7, 8)
)Appex 05
STA 112 - Fall 2022
Part 1
| data | |
|---|---|
| \(x_1\) | 3 |
| \(x_2\) | 5 |
| \(x_3\) | 1 |
| \(x_4\) | 7 |
| \(x_5\) | 8 |
- Using the data to the left, what is \(n\)?
- What is \(\bar{x}\)?
Part 2
Open your 04-appex.qmd file in RStudio Pro. Load the packages by running the top R chunk of code.
- Copy the code below into an R chunk at the bottom of the file:
What do you think this code does? Try typing ?tibble in the Console - what does this function do?
- Calculate the
meanofx. Do this two ways, using thesummaryfunction and using thelmfunction. - Add a new variable called
errorto the data setdthat is equal toxminus the mean of x.
