SPSS Lesson 21 – One Sample t-test | Dataplexa

One Sample t-test

Sometimes the objective is not to compare two groups, but to compare a sample mean against a known or expected value.

The One Sample t-test is used to determine whether the mean of a sample differs significantly from a specified value.


When to Use a One Sample t-test

This test is appropriate when:

  • You have a single numerical (scale) variable
  • You want to compare it to a known or hypothesized value
  • The data is approximately normally distributed

Typical use cases include:

  • Comparing average salary to an industry standard
  • Checking if average exam score differs from a passing mark
  • Comparing production output to a target value

Example Dataset

Assume a company claims that the average monthly sales per employee is ₹50,000.

You collect data from a sample of employees:

Employee_ID Monthly_Sales
1501 47000
1502 52000
1503 48000
1504 51000

The question is: Is the true average sales value different from ₹50,000?


Formulating Hypotheses

Before running the test, we define hypotheses:

  • Null hypothesis (H₀): μ = 50,000
  • Alternative hypothesis (H₁): μ ≠ 50,000

The one-sample t-test evaluates whether the observed sample mean provides enough evidence to reject the null hypothesis.


Key Assumptions

The assumptions for a one-sample t-test include:

  • Data is numeric
  • Observations are independent
  • Data is approximately normally distributed

Normality becomes especially important for small sample sizes.


Running One Sample t-test (Menu)

To run the test using SPSS menus:

  • Go to Analyze → Compare Means → One-Sample T Test
  • Move the variable into Test Variable(s)
  • Enter the Test Value (e.g., 50000)
  • Click OK

SPSS outputs descriptive statistics and the one-sample t-test results.


Using SPSS Syntax


T-TEST
  /TESTVAL=50000
  /VARIABLES=Monthly_Sales
  /CRITERIA=CI(.95).

This syntax compares the sample mean against ₹50,000.


Interpreting the Output

Key values to examine:

  • Mean Difference – difference from test value
  • t-value – magnitude of difference
  • Sig. (p-value) – statistical significance

Interpretation rule:

  • p < 0.05 → sample mean significantly differs from test value
  • p ≥ 0.05 → no significant difference

Always report both the mean and the p-value.


Common Mistakes

Typical errors include:

  • Using the test for categorical data
  • Ignoring normality assumptions
  • Confusing one-sample with independent tests

Correct test selection ensures valid conclusions.


Quiz 1

What does a one sample t-test compare?

A sample mean against a known value.


Quiz 2

What type of variable is required?

Numerical (scale) variable.


Quiz 3

What does p < 0.05 indicate?

The sample mean significantly differs from the test value.


Quiz 4

Where do you enter the comparison value in SPSS?

In the Test Value field.


Quiz 5

Is normality important for small samples?

Yes.


Mini Practice

A factory claims that the average weight of packaged goods is 1 kg.

Collect a sample of weights and perform a one-sample t-test to verify this claim.

Use Analyze → Compare Means → One-Sample T Test, set Test Value = 1, and interpret the p-value.


What’s Next

In the next lesson, you will learn about Chi-Square Tests, used to analyze relationships between categorical variables.