IS2060 Midterm
Due June 9
1. Generate 10000 values from a triangle distribution with a minimum of
x=10, a maximum of x=20, and a peak at x=15.
- a. Generate a histogram and boxplot of the data
- b. Calculate the mean of sampled values and the standard deviation.
- c. Compare the results of part b with the theoretical values
2. Copy the file ~is2060/SwS/testset and read it into Splus (it is an
array of 2000 elements).
- a. Generate a histogram and boxplot. Compute the mean and standard
deviation.
- b. Determine whether the data are normally distributed. [HINT: to
do this, look at the qqnorm plot and/or generate a normal
distribution with the same mean and variance as the data -- compare
histograms]
- c. Construct density plots with a few different width parameters.
- d. Test for independence of consecutive values. Plot testset[1:1999]
against tsetset[2:2000]. What can you conclude?
3. Using the "hills" data from the MASS libarary:
- a. Construct a linear model that predicts TIME as a function of
DIST and CLIMB as separate regressors and together.
- b. Constuct a separate model that includes an interaction term (a
coefficient for CLIMB*DIST) as if it were a 3rd regressor, and comment
on the results.
- c. Try to invent another function of DIST and CLIMB to include as
a third regressor to give a better fit to the data. Comment on your
results.