The following are a set of self-test questions designed to complement the expertConcepts tutorial. These exercises are only meant to be attempted after you have finished the expertConcepts tutorial.
Load in the precip
dataset.
-
What is the mean, median, and standard deviation of
precip
? -
Is
precip
best visualized using abarplot( )
orhist( )
? Why? -
Generate a vector of random numbers drawn from a normal distribution with the same mean, standard deviation, and number of elements as in the
precip
dataset. Name this vectorRandomNormal
. -
Write a function that tests, based on the means of each distribution, whether it is likely that
RandomNormal
andprecip
were drawn from the same underlying distribution. -
Create a
density( )
plot ofprecip
andRandomNormal
. Is the test you performed above (question 4) a good or bad indicator of whether the two distributions are identical? Why or why not?