Universit´e Joseph Fourier L2/STA230
Lab 4: Simulation and estimation
You have to write a report of this lab session, to print it, and to bring it at the beginning of lab 5. The report should not exceed two pages. Be careful to explain your R code and to comment the results.
Exercise 1 (simulations)
1. Choose a value of µ. ForN = 104, n= 100, drawN samples of size nof the normal distribution N(µ,1).
2. Compute theNsample means and and theNmedians which can be computed withapply(X,1,median).
3. Display paired boxplots, superpose the true value ofµ.
4. Which of the two estimators is a better estimator of µ?
Exercise 2 (probabilities and quantiles computation)
In a given country, the cholesterol concentration of a person taken at random is modeled by a normal distribution with mean 200 mg/100 mL and standard deviation 20 mg/100 mL.
1. What is the probability that a person taken at random in that country has a cholesterol rate below 160 mg/100 mL?
2. What proportion of the population has a cholesterol rate between 170 and 230 mg/100 mL?
3. If ten thousand people chosen at random were ranked by increasing cholesterol concentration, how much would be the 9500-th?
Exercise 3 (real data analysis)
1. Upload theher.csvfile, and assign it todata.
2. Assign the fifth column of data to W (weight). Display the summary of W and propose a plot.
Comment.
3. Estimate the mean and the standard-deviation of W. Plot a histogram of W. Superpose the density of the normal distribution, using the estimated parameters. Comment