Statistical Computing Activity #2
- Generate 100 uniform(0, 1) random numbers using runif().
- Summarize the distribution with a histogram. Does the shape of the distribution match what you expected?
- Comment on the center, shape, and spread.
- Use qqnorm() and qqline() to check normality.
- Use t.test to check if the random number generator matches the expected mean.
- Create a new variable y = 2x that doubles the range of simulated values
- Create a new variable that generates uniform random numbers between -3 and 3.
- Generate 100 normal(0, 1) random numbers using rnorm().
- Summarize the distribution with a histogram. Does the shape of the distribution match what you expected?
- Comment on the center, shape, and spread.
- Use qqnorm() and qqline() to check normality.
- Change the mean and standard deviation to other values of your choice. Does the shape of the quantile plot change as you change the mean and standard deviation?
- Generate 100 binomial(31, .5) random numbers using rbinom().
- Summarize the distribution with a histogram.
- Comment on the center, shape, and spread.
- Use qqnorm() and qqline() to check normality. Is the distribution approximately normal?
- Change the number of trials and the probability of success to other values of your choice. Does the shape of the distribution change as you change the values of n and p? Make sure that you try some values of p close to zero and others close to 1.
- Generate 100 geometric(1/6) random numbers using rgeom().
- Summarize the distribution with a histogram.
- Comment on the center, shape, and spread
- Use qqnorm() and qqline() to check normality. Is the distribution approximately normal?