CommencerCommencer gratuitement

t-interval at various levels

A random sample was taken of nearly 10% of UCLA courses. The most expensive textbook for each course was identified, and its price at the UCLA Bookstore and on Amazon.com were recorded. These data are recorded in the textbooks dataset. We want to test whether there is a difference between the average prices of textbooks sold in the bookstore vs. on Amazon.

Since the book price data are paired (the price of the same book at the two stores are not independent), rather than using individual variables for the prices from each store, you will look at the a single variables of the differences in price. The diff column the UCLA Bookstore price minus the Amazon.com price for each book.

Cet exercice fait partie du cours

Inference for Numerical Data in R

Afficher le cours

Instructions

  • Construct a 90% confidence interval for the average difference in prices of the same textbook at at the UCLA bookstore and on Amazon.
  • Now construct the same interval at the 95% confidence level.
  • And now at the 99% confidence level.
  • Take a note of the widths of the intervals. You'll need these for the next exercise.

Exercice interactif pratique

Essayez cet exercice en complétant cet exemple de code.

# Run a t-test on diff with a 90% CI
___(___, conf.level = ___)

# Same with 95% CI
___

# Same with 99% CI
___
Modifier et exécuter le code