Hypothesis Tests for Slopes of Regression Lines (College Board AP® Statistics)

Study Guide

Test yourself
Mark Curtis

Written by: Mark Curtis

Reviewed by: Dan Finlay

t-test for slope of regression line

What is a t-test for the slope of a regression line?

  • A t-test for the slope of a regression line is used to test whether the population slope, beta, of the population least-squares regression line, y with hat on top equals alpha plus beta xhas changed

    • A random sample of n observations from the population, open parentheses x subscript i comma space y subscript i close parentheses with a sample least-squares regression line of y with hat on top equals a plus b x is used to try to prove the case

What are the hypotheses for a t-test for a slope?

  • The null hypothesis, straight H subscript 0, is the assumption that the population slope has not changed

    • e.g. straight H subscript 0 space colon space beta equals beta subscript 0 The population slope has the fixed value beta subscript 0

      • It is assumed to be correct, unless evidence proves otherwise

  • The alternative hypothesis, straight H subscript straight a, is how you think the population slope has changed

    • e.g. straight H subscript straight a colon space beta less than beta subscript 0 or beta greater than beta subscript 0 or beta not equal to beta subscript 0

Examiner Tips and Tricks

When writing out your hypotheses, always fully define the symbol used for the population parameter in context, e.g. '... where beta is the slope of the population least-squares regression line of all student weights against all student shoe sizes in the school'

What are the conditions for a t-test for a slope?

  • When performing a t-test for a slope, you must show that it meets the following conditions:

    • The relationship between x and y must be linear

      • Look for randomness in a population residual plot

    • The standard deviation of the y-values (responses), sigma subscript y, cannot vary with x

      • Check on a population residual plot that the lengths (vertical heights) of residuals stay roughly the same as x increases horizontally

    • The residuals are independent

      • by verifying that data is collected by random sampling

      • or random assignment (in an experiment)

      • and, if sampling without replacement, showing that the sample size is less than 10% of the population size

    • For a given value of x, the responses (y-values) follow an approximate normal distribution

      • A population residual plot should show residuals evenly spread either side of the horizontal zero line

      • There should be more points in the inner horizontal band (either side of the zero line) and fewer points in the outer horizontal bands

    • If the sample size is n less than 30, the distribution of responses (y-values) should have no strong skew and no outliers

      • Look at a population residual plot to see if there is a bias (skew) to one side of the horizontal zero line, and look for outliers

      • If the distribution does have a skew, then the sample size must be n greater or equal than 30

How do I calculate the standardized test statistic (t-value)?

  • You need a measure of how far the sample slope is from the population slope

    • This is the standardized test statistic (in this case, called the t-value)

  • The t-value, for the slope is given by:

    • t equals fraction numerator b minus beta subscript 0 over denominator s subscript b end fraction

    • where b is the sample slope, beta subscript 0 is the population slope under the null hypothesis beta equals beta subscript 0, and s subscript b is the standard error of the sample slope given by s subscript b equals fraction numerator s over denominator s subscript x square root of n minus 1 end root end fraction

      • where n is the sample size

      • and where s equals square root of fraction numerator sum from blank to blank of open parentheses y subscript i minus y with hat on top subscript i close parentheses squared over denominator n minus 2 end fraction end root

      • and s subscript x equals square root of fraction numerator sum from blank to blank of open parentheses x subscript i minus x with bar on top close parentheses squared over denominator n minus 1 end fraction end root

  • The t-value shows how many standard errors the sample slope is from the population slope

Examiner Tips and Tricks

The formula for the standardized test statistic is given in the exam, fraction numerator statistic minus parameter over denominator standard space error space of space the space statistic end fraction, along with tables of parameters and standard errors.

You will need to apply this correctly to get the t-value.

How do I read output information on regression from a computer?

  • The formulas for the standardized test statistic are complicated to use in practice

    • Computers are often used to calculate these quantities instead

  • You may be given computer output information from a sample, as follows:

Predictor

Coef

SE Coef

T

P

Constant

33.243

4.436

7.49

0.000

[x-variable name]

1.1356

0.3421

3.32

0.004

S = 7.35829

R-Sq = 35.2 %

R-Sq (adj) = 32.1 %

  • The above computer output says

    • the sample least-squares regression line is y with hat on top equals 33.243 plus 1.1356 x

      • This gives the sample slope, b equals 1.1356, needed for t equals fraction numerator b minus beta subscript 0 over denominator s subscript b end fraction

    • the standard error of the sample slope, s subscript b, is 0.3421

      • This gives the standard error, s subscript b equals 0.3421, needed for t equals fraction numerator b minus beta subscript 0 over denominator s subscript b end fraction

      • do not confuse s subscript b with s equals 7.35829, which is an estimate for the standard deviation of population residuals (the standard error of the residuals)

Examiner Tips and Tricks

Make sure you know how to find the slope of a sample least-squares regression line from any computer output given in the exam (do not use the row for the 'constant' term!).

How do I calculate the p-value?

  • Work out the t-value (standardized test statistic)

  • Find the appropriate number of degrees of freedom ('dof')

    • For a t-test for a slope this is always dof equals n minus 2

      • If alpha is known in y with hat on top equals alpha plus beta x, then dof equals n minus 1

  • Using the t-distribution table given to you:

    • find the row that corresponds to the dof

    • identify the t-value in the row that is closest to the calculated value

    • write down the value in the corresponding column header

      • this is the p-value

  • Note that the p-value from the t-table is for one tail

    • You need to double this value for a two-tail test

How do I conclude a hypothesis test?

  • Conclusions to a hypothesis test need to show two things:

    • a decision about the null hypothesis

    • an interpretation of this decision in the context of the question

  • To make the decision, compare the p-value to the significance level

    • If p less than alpha then the null hypothesis should be rejected

    • If p greater than alpha then the null hypothesis should not be rejected

  • In a two-tailed test, remember to double the p-value and compare this to alpha

Examiner Tips and Tricks

Remember that the conclusion should be interpreted within the context of the question.

Use the same language in your conclusion that is used in the problem, e.g. 'The data provides sufficient evidence that the slope of the population least-squares regression line for all student weights against all student shoe sizes in the school has increased from ...'.

What are the steps for performing a t-test for a slope on a calculator?

  • When using a calculator to conduct a t-test for a slope, you must still write down all steps of the hypothesis testing process:

    • State the null and alternative hypotheses and clearly define your parameter

    • Describe the test being used and show that the situation meets the conditions required

    • Calculate the t-value and the degrees of freedom

    • Calculate the p-value using your calculator

      • select a one-sample t-test and enter the relevant summary statistics or data to generate the p-value

    • Compare the p-value to the significance level

    • Write down the conclusion to the test and interpret it in the context of the problem

Examiner Tips and Tricks

Even if you perform the one-sample t-test on your calculator, it is still important to show all of your working to demonstrate full understanding. Therefore you should still calculate the t-value and the degrees of freedom.

Worked Example

On an island with an inactive volcano, a local ecologist knows that ferns (a type of plant) grow taller the further they are away from the volcanic crater. The slope of the population regression line relating distance from the volcanic crater, x kilometers, to fern height, y centimeters, has a slope of 0.55 cm per km.

The ecologist suspects that the volcano may be becoming active and heating up the island, but does not know what affect this may have on fern heights relative to their distance from the volcanic crater. The ecologist takes a random sample of 26 ferns, measuring their distances from the volcanic crater and their heights, with the results from a computer analysis of the sample shown below.

Predictor

Coef

SE Coef

T

P

Constant

33.243

4.436

7.49

0.000

Distance

1.1356

0.3421

3.32

0.004

S = 7.35829

R-Sq = 35.2 %

R-Sq (adj) = 32.1 %

Is there convincing statistical evidence to support the ecologist's suspicion that there has been a change in the slope of the population regression line, at a significance level of alpha equals 0.05? You may assume all conditions for inference are met.

Answer:

Define the population parameter, beta

Let beta be the slope of the population least-squares regression line relating distance from the volcanic crater, x kilometers, to fern height, y centimeters

Write the null and alternative hypotheses

This will be a two-tailed test as a change is suspected but an increase or a decrease is not specified

straight H subscript 0 space colon space beta equals 0.55
straight H subscript straight a space colon space beta not equal to 0.55

State the type of test being used and verify that the conditions for the test are met

The correct inference procedure is a t-test for the population slope at alpha equals 0.05

It is assumed in the question that all conditions for inference are met

Calculate the standardized test statistic, using t equals fraction numerator b minus beta subscript 0 over denominator s subscript b end fraction where beta subscript 0 equals 0.55, b equals 1.1356 (from the table) and s subscript b equals 0.3421 (from the table)

t equals fraction numerator 1.1356 minus 0.55 over denominator 0.3421 end fraction equals 1.71178...

State the number of degrees of freedom (this is n minus 2 for a t-test for a slope)

degrees of freedom = 26 - 2 = 24

Find the p-value, e.g. from the t-tables

Find the row corresponding to 24 degrees of freedom and identify the t-value that is closest to the calculated t-value of 1.71178...

closest t-value = 1.711

corresponding p-value is p equals 0.05

Double this probability because it is a two-tailed test

p equals 0.05 times 2 equals 0.1

Compare the probability to the significance level and state the conclusion of the test

table row cell 0.1 end cell greater than cell 0.05 end cell row p greater than alpha end table

straight H subscript 0 is not rejected

Interpret the result in the context of the question

There is not sufficient evidence to support the ecologist's suspicion that the slope of the population least-squares regression line relating distance from the volcanic crater, x kilometers, to fern height, y centimeters, has changed from 0.55 cm per km

Last updated:

You've read 0 of your 10 free study guides

Unlock more, it's free!

Join the 100,000+ Students that ❤️ Save My Exams

the (exam) results speak for themselves:

Did this page help you?

Mark Curtis

Author: Mark Curtis

Expertise: Maths

Mark graduated twice from the University of Oxford: once in 2009 with a First in Mathematics, then again in 2013 with a PhD (DPhil) in Mathematics. He has had nine successful years as a secondary school teacher, specialising in A-Level Further Maths and running extension classes for Oxbridge Maths applicants. Alongside his teaching, he has written five internal textbooks, introduced new spiralling school curriculums and trained other Maths teachers through outreach programmes.

Dan Finlay

Author: Dan Finlay

Expertise: Maths Lead

Dan graduated from the University of Oxford with a First class degree in mathematics. As well as teaching maths for over 8 years, Dan has marked a range of exams for Edexcel, tutored students and taught A Level Accounting. Dan has a keen interest in statistics and probability and their real-life applications.