Lesson 5.1: Inference for One Mean or a Mean Difference from Two Paired Groups
Software Lab 5.1
One-Sample t-Tests and t-Intervals
As you work through the lab, answer the ungraded exercises in the shaded boxes. Check your answers by consulting the Software Lab 5.1 Solutions.
Remember to complete the graded Software Lab Questions for this section in Moodle.
Getting Started: The Data
The National Center of Education Statistics conducted a survey of high school seniors, collecting test data on reading, writing, and several other subjects. Here we examine a simple random sample of 200 students from this survey. The name of the data frame for this lab is hsb2
and the variables we’ll be using in this lab are:
math
: standardized math scorescience
: standardized science score
Download the data from hsb2 [CSV file] (OpenIntro, n.d.), and open it in jamovi. Before we start to analyze the data, we need to change the variable types from “nominal” to “continuous.” Go to the Data
tab and double-click the header for the math
column. Change “Measure type” to “Continuous.” Repeat for science
.
Confidence Interval for a Mean
First, we’ll focus on the variable math
to make inferences about the standardized math scores for high school seniors. A confidence interval for a mean based on a t-model with n − 1 df is: , where
, assuming the following conditions are satisfied:
- The individual responses in the sample are independent of each other.
- The sample is random.
- The sample size
is no more than 10% of the population size.
- The data come from a population that is nearly normal.
Analyses > T-Tests > One Sample T-Test
, move math
to the Dependent Variables
box, and under “Assumption Checks” click “Q–Q Plot.” Use the plot and any other relevant information to check the nearly normal condition. Check your answer by consulting the Software Lab 5.1 Solutions.![Rendered by QuickLaTeX.com t^*](https://introprobabilityandstatistics.pressbooks.tru.ca/wp-content/ql-cache/quicklatex.com-37978e87221fcb11992852a943dad384_l3.png)
R > Rj Editor
and running the following code: qt(0.975, df=199)
.Hypothesis Test for a Mean
A university admissions officer has been told that the mean standardized math score for high school seniors is 55, but the admissions officer doesn’t believe this. We’ll conduct a two-sided hypothesis test for a mean to test the admissions officer’s belief. The hypotheses are H0: µ = 55 versus HA: µ ≠ 55. When the conditions above are met, follows a t-model with n − 1 df.
R > Rj Editor
and running the following code: 2*pt(-3.55, df=199)
.![Rendered by QuickLaTeX.com \alpha = 0.05](https://introprobabilityandstatistics.pressbooks.tru.ca/wp-content/ql-cache/quicklatex.com-ad6ce5c9ea5f3e49e839c4b3d5273902_l3.png)
Confidence Interval for a Mean Difference for Paired Data
Next, we’ll consider whether there is a difference in the mean scores of students for math and science.
Analyses > T-Tests > Paired Samples T-Test
, move math
and science
to the Paired Variables
box, and under “Assumption Checks” click “Q–Q Plot.” Use the plot and any other relevant information to check the nearly normal condition.![Rendered by QuickLaTeX.com t^*](https://introprobabilityandstatistics.pressbooks.tru.ca/wp-content/ql-cache/quicklatex.com-37978e87221fcb11992852a943dad384_l3.png)
![Rendered by QuickLaTeX.com t^*](https://introprobabilityandstatistics.pressbooks.tru.ca/wp-content/ql-cache/quicklatex.com-37978e87221fcb11992852a943dad384_l3.png)
Hypothesis Test for a Mean Difference for Paired Data
The university admissions officer thinks that the mean standardized math score for high school seniors differs from the mean standardized science score. We’ll conduct a two-sided hypothesis test for a mean to test the admissions officer’s belief. The hypotheses are H0: µmath = µscience versus HA: µmath ≠ µscience.
R > Rj Editor
and running the following code: 2*(1-pt(1.36, df=199))
.![Rendered by QuickLaTeX.com \alpha = 0.05](https://introprobabilityandstatistics.pressbooks.tru.ca/wp-content/ql-cache/quicklatex.com-ad6ce5c9ea5f3e49e839c4b3d5273902_l3.png)
References
OpenIntro. (n.d.). Data sets [Data sets]. https://openintro.org/data/