<- tibble(
d 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
mean
ofx
. Do this two ways, using thesummary
function and using thelm
function. - Add a new variable called
error
to the data setd
that is equal tox
minus the mean of x.