Homework

Using Tinn-R or R-Studio, write down a code that:

  1. Creates a sample of 1000 points from a normal distribution, and place them in a data.frame, with one column named X.

  2. Estimate the mean, median and mode of variable X; have these individual values stored in their own variable names.

  3. Estimate the standard deviation and place it in its own variable name.

  4. Make a histogram of the data you created in numeral one. Adjust parameters of the figure to the guidelines for good figures.

  5. Place the mean, median, mode and 2SDs from the mean as vertical lines. Make the color lines distinctive.

  6. Name the vertical lines above. Work with the XY position of the ‘text’ so the labels look nice.

  7. Save the code and email it as a homework.