To Notes

IT 223 -- Mar 9 , 2026

Review Exercises

  • Practice Problems for t-tests
    1. Psychology experiments involve testing the ability of rate to navigate mazes. The mazes are classified according to difficulty, as measured by the average length of time it takes rats to find the food at the end. One researcher needs a maze that will take rats an average of about one minute to solve. He tests one maze on several rats, collecting this data
      38.4 57.6 46.2 55.5 62.5 49.5 38.0 
      40.9 62.8 44.3 33.9 93.8 50.4 47.9
      35.0 69.2 52.8 46.2 60.1 56.3 55.1	
      
      1. Form the normal plot and box plot of the maze times. Are the times normally distributed? Answer:
        > times <- scan( )
        1: 38.4 57.6 46.2 55.5 62.5 49.5 38.0 
        8: 40.9 62.8 44.3 33.9 93.8 50.4 47.9
        15: 35.0 69.2 52.8 46.2 60.1 56.3 55.1
        22: 
        Read 21 items
        > boxplot(times, main="Maze Completion Times")
        > qqnorm(times, main="Maze Completion Times")
        > qqline(times, col="red")
        
        Boxplot for Maze Completing Times    Normal Plot for Maze Completing Times
      2. Test the hypothesis that the true completion time is one minute. Answer:
                One Sample t-test
        
        data:  times
        t = -2.6319, df = 20, p-value = 0.01598
        alternative hypothesis: true mean is not equal to 60
        95 percent confidence interval:
         46.03498 58.38406
        sample estimates:
        mean of x 
         52.20952 
        
        The p-value is less than 0.05 so reject the null hypothesis that the true time to complete the maze is 60 seconds.
      3. Eliminate the outlier and perform the hypothesis test again.
        Answer: the outlier is 93.8 at index 12, which we can delete like this:
        > # Indices with negative values mean
        > # delete the value at that index.
        > times <- times[-12]
        > # Perform t-test again:
        > t.test(times, mu=60)
        
                One Sample t-test
        
        data:  times
        t = -4.4568, df = 19, p-value = 0.0002705
        alternative hypothesis: true mean is not equal to 60
        95 percent confidence interval:
         45.49475 54.76525
        sample estimates:
        mean of x 
            50.13 
        
        The p-value = 0.0002705 is much smaller after deleting the outlier because the standard deviation of the times is smaller.
    2. A food company marks the net weight of their potato chip bags as 28.3 grams. To test whether this claim is true, students collect and measure the net weights of bags. Here is the dataset
      29.3  28.2  29.1  28.7  28.9  28.5
      
      1. Form the normal plot of the new weights of the potato chip bags. Are the weights normally distributed? Answer:
        > weights <- scan( )
        1: 29.3 28.2 29.1 28.7 28.9 28.5
        7: 
        Read 6 items
        > qqnorm(weights)
        > qqline(weights, col="red")
        
        Normal Plot for Potato Chip Bag Weights
      2. Test the hypothesis that the true weight of potato chip bags is 28.3 grams. Answer:
         > t.test(weights, mu=28.3)
         
                One Sample t-test
        
        data:  weights
        t = 2.9445, df = 5, p-value = 0.03209
        alternative hypothesis: true mean is not equal to 28.3
        95 percent confidence interval:
         28.36138 29.20529
        sample estimates:
        mean of x 
         28.78333 
        
        The p-value is less than 0.03209 so reject the null hypothesis.

    The Paired Sample t-test

    The Independent Two-Sample t-test

    Inference for Simple Linear Regression

    The Pendulum Data