set.seed(1902)
n_nr_obs <- 15
vec_width <- rnorm(n_nr_obs, mean = 73, sd = 2.5)
vec_height <- rnorm(n_nr_obs, mean = 175, sd = 7.9)
plot(vec_width, vec_height)
Measure width of your left hand in mm and your height in cm and enter that data into a table. From that table create a simple plot using the function plot(). As a demo, we are first running that with random numbers. After that run the same with the collected data
set.seed(1902)
n_nr_obs <- 15
vec_width <- rnorm(n_nr_obs, mean = 73, sd = 2.5)
vec_height <- rnorm(n_nr_obs, mean = 175, sd = 7.9)
plot(vec_width, vec_height)
Do the same with the collected data
Order both variables (width and height) in the data according to the width of the left hand, then repeat the plot
vec_order <- order(vec_width)
vec_ord_width <- vec_width[vec_order]
vec_ord_height <- vec_height[vec_order]
plot(vec_ord_width, vec_ord_height)
Do the ordered version of the plot
Fitting different lines through the demo
plot(vec_width, vec_height)
abline(180, 0, col="blue")
abline(170, 0.1, col = "green")
Try to fit some plots for the collected data