1. Use the following function to calculate the bootstrapped estimate for the correlation between age and weight on the boys data set. Use R=1000 bootstrap samples.
corfun <- function(data, i){
  data.sample <- data[i,]
  stat <- cor(data.sample$age, data.sample$wgt, use = "pairwise.complete.obs")
    return(stat)
}

  1. Explore the contents of the bootstr.cor object. For example, use function attributes() to see the listed dimensions that are within the bootstr.cor object and the class of the object.

  1. Plot the histogram of the individual bootstrapped estimates for every bootstrapped sample (i.e. $t).

  1. Add a column to boys that indicates whether boys are overweight by taking the boundary bmi > 25.

  1. Bootstrap a \(X^2\)-test that evaluates the distribution of overweight ovw boys over the regions reg.

  1. Plot the histogram of the individual bootstrapped estimates for every bootstrapped sample (i.e. $t).

  1. Do a bootstrap of the regression estimates of the following model:

  1. ** Create a histogram of the individual bootstrapped estimates **

  1. Calculate the confidence intervals for

End of Practical