Logo for Open Library Publishing Platform

Want to create or adapt books like this? Learn more about how Pressbooks supports open publishing practices.

13.6 Testing the Regression Coefficients

Learning objectives.

  • Conduct and interpret a hypothesis test on individual regression coefficients.

Previously, we learned that the population model for the multiple regression equation is

[latex]\begin{eqnarray*} y & = & \beta_0+\beta_1x_1+\beta_2x_2+\cdots+\beta_kx_k +\epsilon \end{eqnarray*}[/latex]

where [latex]x_1,x_2,\ldots,x_k[/latex] are the independent variables, [latex]\beta_0,\beta_1,\ldots,\beta_k[/latex] are the population parameters of the regression coefficients, and [latex]\epsilon[/latex] is the error variable.  In multiple regression, we estimate each population regression coefficient [latex]\beta_i[/latex] with the sample regression coefficient [latex]b_i[/latex].

In the previous section, we learned how to conduct an overall model test to determine if the regression model is valid.  If the outcome of the overall model test is that the model is valid, then at least one of the independent variables is related to the dependent variable—in other words, at least one of the regression coefficients [latex]\beta_i[/latex] is not zero.  However, the overall model test does not tell us which independent variables are related to the dependent variable.  To determine which independent variables are related to the dependent variable, we must test each of the regression coefficients.

Testing the Regression Coefficients

For an individual regression coefficient, we want to test if there is a relationship between the dependent variable [latex]y[/latex] and the independent variable [latex]x_i[/latex].

  • No Relationship .  There is no relationship between the dependent variable [latex]y[/latex] and the independent variable [latex]x_i[/latex].  In this case, the regression coefficient [latex]\beta_i[/latex] is zero.  This is the claim for the null hypothesis in an individual regression coefficient test:  [latex]H_0: \beta_i=0[/latex].
  • Relationship.  There is a relationship between the dependent variable [latex]y[/latex] and the independent variable [latex]x_i[/latex].  In this case, the regression coefficients [latex]\beta_i[/latex] is not zero.  This is the claim for the alternative hypothesis in an individual regression coefficient test:  [latex]H_a: \beta_i \neq 0[/latex].  We are not interested if the regression coefficient [latex]\beta_i[/latex] is positive or negative, only that it is not zero.  We only need to find out if the regression coefficient is not zero to demonstrate that there is a relationship between the dependent variable and the independent variable. This makes the test on a regression coefficient a two-tailed test.

In order to conduct a hypothesis test on an individual regression coefficient [latex]\beta_i[/latex], we need to use the distribution of the sample regression coefficient [latex]b_i[/latex]:

  • The mean of the distribution of the sample regression coefficient is the population regression coefficient [latex]\beta_i[/latex].
  • The standard deviation of the distribution of the sample regression coefficient is [latex]\sigma_{b_i}[/latex].  Because we do not know the population standard deviation we must estimate [latex]\sigma_{b_i}[/latex] with the sample standard deviation [latex]s_{b_i}[/latex].
  • The distribution of the sample regression coefficient follows a normal distribution.

Steps to Conduct a Hypothesis Test on a Regression Coefficient

[latex]\begin{eqnarray*} H_0: &  &  \beta_i=0 \\ \\ \end{eqnarray*}[/latex]

[latex]\begin{eqnarray*} H_a: &  & \beta_i \neq 0 \\ \\ \end{eqnarray*}[/latex]

  • Collect the sample information for the test and identify the significance level [latex]\alpha[/latex].

[latex]\begin{eqnarray*}t & = & \frac{b_i-\beta_i}{s_{b_i}} \\ \\ df &  = & n-k-1 \\  \\ \end{eqnarray*}[/latex]

  • The results of the sample data are significant.  There is sufficient evidence to conclude that the null hypothesis [latex]H_0[/latex] is an incorrect belief and that the alternative hypothesis [latex]H_a[/latex] is most likely correct.
  • The results of the sample data are not significant.  There is not sufficient evidence to conclude that the alternative hypothesis [latex]H_a[/latex] may be correct.
  • Write down a concluding sentence specific to the context of the question.

The required [latex]t[/latex]-score and p -value for the test can be found on the regression summary table, which we learned how to generate in Excel in a previous section.

The human resources department at a large company wants to develop a model to predict an employee’s job satisfaction from the number of hours of unpaid work per week the employee does, the employee’s age, and the employee’s income.  A sample of 25 employees at the company is taken and the data is recorded in the table below.  The employee’s income is recorded in $1000s and the job satisfaction score is out of 10, with higher values indicating greater job satisfaction.

Previously, we found the multiple regression equation to predict the job satisfaction score from the other variables:

[latex]\begin{eqnarray*} \hat{y} & = & 4.7993-0.3818x_1+0.0046x_2+0.0233x_3 \\ \\ \hat{y} & = & \mbox{predicted job satisfaction score} \\ x_1 & = & \mbox{hours of unpaid work per week} \\ x_2 & = & \mbox{age} \\ x_3 & = & \mbox{income (\$1000s)}\end{eqnarray*}[/latex]

At the 5% significance level, test the relationship between the dependent variable “job satisfaction” and the independent variable “hours of unpaid work per week”.

Hypotheses:

[latex]\begin{eqnarray*} H_0: & & \beta_1=0 \\   H_a: & & \beta_1 \neq 0 \end{eqnarray*}[/latex]

The regression summary table generated by Excel is shown below:

The  p -value for the test on the hours of unpaid work per week regression coefficient is in the bottom part of the table under the P-value column of the Hours of Unpaid Work per Week row .  So the  p -value=[latex]0.0082[/latex].

Conclusion:  

Because p -value[latex]=0.0082 \lt 0.05=\alpha[/latex], we reject the null hypothesis in favour of the alternative hypothesis.  At the 5% significance level there is enough evidence to suggest that there is a relationship between the dependent variable “job satisfaction” and the independent variable “hours of unpaid work per week.”

  • The null hypothesis [latex]\beta_1=0[/latex] is the claim that the regression coefficient for the independent variable [latex]x_1[/latex] is zero.  That is, the null hypothesis is the claim that there is no relationship between the dependent variable and the independent variable “hours of unpaid work per week.”
  • The alternative hypothesis is the claim that the regression coefficient for the independent variable [latex]x_1[/latex] is not zero.  The alternative hypothesis is the claim that there is a relationship between the dependent variable and the independent variable “hours of unpaid work per week.”
  • When conducting a test on a regression coefficient, make sure to use the correct subscript on [latex]\beta[/latex] to correspond to how the independent variables were defined in the regression model and which independent variable is being tested.  Here the subscript on [latex]\beta[/latex] is 1 because the “hours of unpaid work per week” is defined as [latex]x_1[/latex] in the regression model.
  • The p -value for the tests on the regression coefficients are located in the bottom part of the table under the P-value column heading in the corresponding independent variable row. 
  • Because the alternative hypothesis is a [latex]\neq[/latex], the p -value is the sum of the area in the tails of the [latex]t[/latex]-distribution.  This is the value calculated out by Excel in the regression summary table.
  • The p -value of 0.0082 is a small probability compared to the significance level, and so is unlikely to happen assuming the null hypothesis is true.  This suggests that the assumption that the null hypothesis is true is most likely incorrect, and so the conclusion of the test is to reject the null hypothesis in favour of the alternative hypothesis.  In other words, the regression coefficient [latex]\beta_1[/latex] is not zero, and so there is a relationship between the dependent variable “job satisfaction” and the independent variable “hours of unpaid work per week.”  This means that the independent variable “hours of unpaid work per week” is useful in predicting the dependent variable.

At the 5% significance level, test the relationship between the dependent variable “job satisfaction” and the independent variable “age”.

[latex]\begin{eqnarray*} H_0: & & \beta_2=0 \\   H_a: & & \beta_2 \neq 0 \end{eqnarray*}[/latex]

The  p -value for the test on the age regression coefficient is in the bottom part of the table under the P-value column of the Age row .  So the  p -value=[latex]0.8439[/latex].

Because p -value[latex]=0.8439 \gt 0.05=\alpha[/latex], we do not reject the null hypothesis.  At the 5% significance level there is not enough evidence to suggest that there is a relationship between the dependent variable “job satisfaction” and the independent variable “age.”

  • The null hypothesis [latex]\beta_2=0[/latex] is the claim that the regression coefficient for the independent variable [latex]x_2[/latex] is zero.  That is, the null hypothesis is the claim that there is no relationship between the dependent variable and the independent variable “age.”
  • The alternative hypothesis is the claim that the regression coefficient for the independent variable [latex]x_2[/latex] is not zero.  The alternative hypothesis is the claim that there is a relationship between the dependent variable and the independent variable “age.”
  • When conducting a test on a regression coefficient, make sure to use the correct subscript on [latex]\beta[/latex] to correspond to how the independent variables were defined in the regression model and which independent variable is being tested.  Here the subscript on [latex]\beta[/latex] is 2 because “age” is defined as [latex]x_2[/latex] in the regression model.
  • The p -value of 0.8439 is a large probability compared to the significance level, and so is likely to happen assuming the null hypothesis is true.  This suggests that the assumption that the null hypothesis is true is most likely correct, and so the conclusion of the test is to not reject the null hypothesis.  In other words, the regression coefficient [latex]\beta_2[/latex] is zero, and so there is no relationship between the dependent variable “job satisfaction” and the independent variable “age.”  This means that the independent variable “age” is not particularly useful in predicting the dependent variable.

At the 5% significance level, test the relationship between the dependent variable “job satisfaction” and the independent variable “income”.

[latex]\begin{eqnarray*} H_0: & & \beta_3=0 \\   H_a: & & \beta_3 \neq 0 \end{eqnarray*}[/latex]

The  p -value for the test on the income regression coefficient is in the bottom part of the table under the P-value column of the Income row .  So the  p -value=[latex]0.0060[/latex].

Because p -value[latex]=0.0060 \lt 0.05=\alpha[/latex], we reject the null hypothesis in favour of the alternative hypothesis.  At the 5% significance level there is enough evidence to suggest that there is a relationship between the dependent variable “job satisfaction” and the independent variable “income.”

  • The null hypothesis [latex]\beta_3=0[/latex] is the claim that the regression coefficient for the independent variable [latex]x_3[/latex] is zero.  That is, the null hypothesis is the claim that there is no relationship between the dependent variable and the independent variable “income.”
  • The alternative hypothesis is the claim that the regression coefficient for the independent variable [latex]x_3[/latex] is not zero.  The alternative hypothesis is the claim that there is a relationship between the dependent variable and the independent variable “income.”
  • When conducting a test on a regression coefficient, make sure to use the correct subscript on [latex]\beta[/latex] to correspond to how the independent variables were defined in the regression model and which independent variable is being tested.  Here the subscript on [latex]\beta[/latex] is 3 because “income” is defined as [latex]x_3[/latex] in the regression model.
  • The p -value of 0.0060 is a small probability compared to the significance level, and so is unlikely to happen assuming the null hypothesis is true.  This suggests that the assumption that the null hypothesis is true is most likely incorrect, and so the conclusion of the test is to reject the null hypothesis in favour of the alternative hypothesis.  In other words, the regression coefficient [latex]\beta_3[/latex] is not zero, and so there is a relationship between the dependent variable “job satisfaction” and the independent variable “income.”  This means that the independent variable “income” is useful in predicting the dependent variable.

Concept Review

The test on a regression coefficient determines if there is a relationship between the dependent variable and the corresponding independent variable.  The p -value for the test is the sum of the area in tails of the [latex]t[/latex]-distribution.  The p -value can be found on the regression summary table generated by Excel.

The hypothesis test for a regression coefficient is a well established process:

  • Write down the null and alternative hypotheses in terms of the regression coefficient being tested.  The null hypothesis is the claim that there is no relationship between the dependent variable and independent variable.  The alternative hypothesis is the claim that there is a relationship between the dependent variable and independent variable.
  • Collect the sample information for the test and identify the significance level.
  • The p -value is the sum of the area in the tails of the [latex]t[/latex]-distribution.  Use the regression summary table generated by Excel to find the p -value.
  • Compare the  p -value to the significance level and state the outcome of the test.

Introduction to Statistics Copyright © 2022 by Valerie Watts is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License , except where otherwise noted.

If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

To log in and use all the features of Khan Academy, please enable JavaScript in your browser.

AP®︎/College Statistics

Course: ap®︎/college statistics   >   unit 13, introduction to inference about slope in linear regression.

  • Conditions for inference on slope
  • Confidence interval for the slope of a regression line
  • Confidence interval for slope

regression line null and alternative hypothesis

Want to join the conversation?

  • Upvote Button navigates to signup page
  • Downvote Button navigates to signup page
  • Flag Button navigates to signup page

Good Answer

Video transcript

  • 3.6 - Further SLR Evaluation Examples

Example 1: Are Sprinters Getting Faster?

The following data set ( mens200m.txt ) contains the winning times (in seconds) of the 22 men's 200 meter olympic sprints held between 1900 and 1996. (Notice that the Olympics were not held during the World War I and II years.) Is there a linear relationship between year and the winning times? The plot of the estimated regression line sure makes it look so!

To answer the research question, let's conduct the formal F -test of the null hypothesis H 0 : β 1 = 0 against the alternative hypothesis H A : β 1 ≠ 0.

The analysis of variance table above has been animated to allow you to interact with the table. As you roll your mouse over the blue numbers , you are reminded of how those numbers are determined.

From a scientific point of view, what we ultimately care about is the P -value, which is 0.000 (to three decimal places). That is, the P -value is less than 0.001. The P -value is very small. It is unlikely that we would have obtained such a large F* statistic if the null hypothesis were true. Therefore, we reject the null hypothesis H 0 : β 1 = 0 in favor of the alternative hypothesis H A : β 1 ≠ 0. There is sufficient evidence at the α = 0.05 level to conclude that there is a linear relationship between year and winning time.

Equivalence of the analysis of variance F -test and the t -test

As we noted in the first two examples, the P -value associated with the t -test is the same as the P -value associated with the analysis of variance F -test. This will always be true for the simple linear regression model. It is illustrated in the year and winning time example also. Both P -values are 0.000 (to three decimal places):

The P -values are the same because of a well-known relationship between a t random variable and an F random variable that has 1 numerator degree of freedom. Namely:

\[(t^{*}_{(n-2)})^2=F^{*}_{(1,n-2)}\]

This will always hold for the simple linear regression model. This relationship is demonstrated in this example as:

(-13.33) 2 = 177.7

  • For a given significance level α, the F -test of β 1 = 0 versus β 1 ≠ 0 is algebraically equivalent to the two-tailed t -test.
  • If one test rejects H 0 , then so will the other.
  • If one test does not reject H 0 , then so will the other.

The natural question then is ... when should we use the F -test and when should we use the t -test?

  • The F -test is only appropriate for testing that the slope differs from 0 ( β 1 ≠ 0).
  • Use the t -test to test that the slope is positive ( β 1 > 0) or negative ( β 1 < 0). Remember, though, that you will have to divide the reported two-tail P -value by 2 to get the appropriate one-tailed P -value.

The F -test is more useful for the multiple regression model when we want to test that more than one slope parameter is 0. We'll learn more about this later in the course!

Example 2: Highway Sign Reading Distance and Driver Age

The data are n = 30 observations on driver age and the maximum distance (feet) at which individuals can read a highway sign ( signdist.txt ). (Data source: Mind On Statistics , 3rd edition, Utts and Heckard).

The plot below gives a scatterplot of the highway sign data along with the least squares regression line. 

scatterplot

Here is the accompanying regression output:

Minitab output

Hypothesis Test for the Intercept ( β 0 )

This test is rarely a test of interest, but does show up when one is interested in performing a regression through the origin (which we touched on earlier in this lesson). In the software output above, the row labeled Constant gives the information used to make inferences about the intercept. The null and alternative hypotheses for a hypotheses test about the intercept are written as:

H 0 : β 0 = 0 H A : β 0 ≠ 0.

In other words, the null hypothesis is testing if the population intercept is equal to 0 versus the alternative hypothesis that the population intercept is not equal to 0. In most problems, we are not particularly interested in hypotheses about the intercept. For instance, in our example, the intercept is the mean distance when the age is 0, a meaningless age. Also, the intercept does not give information about how the value of y changes when the value of x changes. Nevertheless, to test whether the population intercept is 0, the information from the software output would be used as follows:

  • The sample intercept is b 0 = 576.68, the value under Coef .
  • The standard error (SE) of the sample intercept, written as se( b 0 ), is se( b 0 ) = 23.47, the value under SE Coef. The SE of any statistic is a measure of its accuracy. In this case, the SE of b 0 gives, very roughly, the average difference between the sample b 0 and the true population intercept β 0 , for random samples of this size (and with these x -values).
  • The test statistic is t = b 0 /se( b 0 ) = 576.68/23.47 = 24.57, the value under T.
  • The p -value for the test is p = 0.000 and is given under P. The p -value is actually very small and not exactly 0.
  • The decision rule at the 0.05 significance level is to reject the null hypothesis since our p < 0.05. Thus, we conclude that there is statistically significant evidence that the population intercept is not equal to 0.

So how exactly is the p -value found? For simple regression, the p -value is determined using a t distribution with n − 2 degrees of freedom ( df ), which is written as t n −2 , and is calculated as 2 × area past | t | under a t n −2 curve. In this example, df = 30 − 2 = 28. The p -value region is the type of region shown in the figure below. The negative and positive versions of the calculated t provide the interior boundaries of the two shaded regions. As the value of t increases, the p -value (area in the shaded regions) decreases.

Hypothesis Test for the Slope ( β 1 )

This test can be used to test whether or not x and y are linearly related. The row pertaining to the variable Age in the software output from earlier gives information used to make inferences about the slope. The slope directly tells us about the link between the mean y and x . When the true population slope does not equal 0, the variables y and x are linearly related. When the slope is 0, there is not a linear relationship because the mean y does not change when the value of x is  changed. The null and alternative hypotheses for a hypotheses test about the slope are written as:

H 0 : β 1 = 0 H A : β 1 ≠ 0.

In other words, the null hypothesis is testing if the population slope is equal to 0 versus the alternative hypothesis that the population slope is not equal to 0. To test whether the population slope is 0, the information from the software output is used as follows:

  • The sample slope is b 1 = −3.0068, the value under Coef in the Age row of the output.
  • The SE of the sample slope, written as se( b 1 ), is se( b 1 ) = 0.4243, the value under SE Coef . Again, the SE of any statistic is a measure of its accuracy. In this case, the SE of b1 gives, very roughly, the average difference between the sample b 1 and the true population slope β 1 , for random samples of this size (and with these x -values).
  • The test statistic is t = b 1 /se( b 1 ) = −3.0068/0.4243 = −7.09, the value under T.
  • The p -value for the test is p = 0.000 and is given under P.
  • The decision rule at the 0.05 significance level is to reject the null hypothesis since our p < 0.05. Thus, we conclude that there is statistically significant evidence that the variables of Distance and Age are linearly related.

As before, the p -value is the region illustrated in the figure above.

Confidence Interval for the Slope ( β 1 )

A confidence interval for the unknown value of the population slope β 1 can be computed as

sample statistic ± multiplier × standard error of statistic

→ b 1 ± t * × se( b 1 ).

In simple regression, the t * multiplier is determined using a t n −2 distribution. The value of t * is such that the confidence level is the area (probability) between − t * and + t * under the t -curve. To find the t * multiplier, you can do one of the following:

  • A table such as the one in the textbook can be used to look up the multiplier.
  • Alternatively, software like Minitab can be used.

95% Confidence Interval

In our example, n = 30 and df = n − 2 = 28. For 95% confidence, t * = 2.05. A 95% confidence interval for β 1 , the true population slope, is:

−3.0068 ± (2.05 × 0.4243) −3.0068 ± 0.870 or about − 3.88 to − 2.14.

Interpretation: With 95% confidence, we can say the mean sign reading distance decreases somewhere between 2.14 and 3.88 feet per each one-year increase in age. It is incorrect to say that with 95% probability the mean sign reading distance decreases somewhere between 2.14 and 3.88 feet per each one-year increase in age. Make sure you understand why!!!

99% Confidence Interval

For 99% confidence, t * = 2.76. A 99% confidence interval for β 1 , the true population slope is:

−3.0068 ± (2.76 × 0.4243) −3.0068 ± 1.1711 or about − 4.18 to − 1.84.

Interpretation: With 99% confidence, we can say the mean sign reading distance decreases somewhere between 1.84 and 4.18 feet per each one-year increase in age. Notice that as we increase our confidence, the interval becomes wider. So as we approach 100% confidence, our interval grows to become the whole real line.

As a final note, the above procedures can be used to calculate a confidence interval for the population intercept. Just use b 0 (and its standard error) rather than b 1 .

Example 3: Handspans Data

Stretched handspans and heights are measured in centimeters for n = 167 college students ( handheight.txt ). We’ll use y = height and x = stretched handspan. A scatterplot with a regression line superimposed is given below, together with results of a simple linear regression model fit to the data.

fitted line plot

Some things to note are:

  • The residual standard deviation S is 2.744 and this estimates the standard deviation of the errors.
  • r 2 = (SSTO-SSE) / SSTO = SSR / (SSR+SSE) = 1500.1 / (1500.1+1242.7) = 1500.1 / 2742.8 = 0.547 or 54.7%. The interpretation is that handspan differences explain 54.7% of the variation in heights.
  • The value of the F statistic is F = 199.2 with 1 and 165 degrees of freedom, and the p -value for this F statistic is 0.000. Thus we reject the null hypothesis H 0 : β 1 = 0 because the p -value is so small. In other words, the observed relationship is statistically significant.

Start Here!

  • Welcome to STAT 462!
  • Search Course Materials
  • Lesson 1: Statistical Inference Foundations
  • Lesson 2: Simple Linear Regression (SLR) Model
  • 3.1 - Inference for the Population Intercept and Slope
  • 3.2 - Another Example of Slope Inference
  • 3.3 - Sums of Squares
  • 3.4 - Analysis of Variance: The Basic Idea
  • 3.5 - The Analysis of Variance (ANOVA) table and the F-test
  • 3.7 - Decomposing The Error When There Are Replicates
  • 3.8 - The Lack of Fit F-test When There Are Replicates
  • Lesson 4: SLR Assumptions, Estimation & Prediction
  • Lesson 5: Multiple Linear Regression (MLR) Model & Evaluation
  • Lesson 6: MLR Assumptions, Estimation & Prediction
  • Lesson 7: Transformations & Interactions
  • Lesson 8: Categorical Predictors
  • Lesson 9: Influential Points
  • Lesson 10: Regression Pitfalls
  • Lesson 11: Model Building
  • Lesson 12: Logistic, Poisson & Nonlinear Regression
  • Website for Applied Regression Modeling, 2nd edition
  • Notation Used in this Course
  • R Software Help
  • Minitab Software Help

Penn State Science

Copyright © 2018 The Pennsylvania State University Privacy and Legal Statements Contact the Department of Statistics Online Programs

Teach yourself statistics

Hypothesis Test for Regression Slope

This lesson describes how to conduct a hypothesis test to determine whether there is a significant linear relationship between an independent variable X and a dependent variable Y .

The test focuses on the slope of the regression line

Y = Β 0 + Β 1 X

where Β 0 is a constant, Β 1 is the slope (also called the regression coefficient), X is the value of the independent variable, and Y is the value of the dependent variable.

If we find that the slope of the regression line is significantly different from zero, we will conclude that there is a significant relationship between the independent and dependent variables.

Test Requirements

The approach described in this lesson is valid whenever the standard requirements for simple linear regression are met.

  • The dependent variable Y has a linear relationship to the independent variable X .
  • For each value of X, the probability distribution of Y has the same standard deviation σ.
  • The Y values are independent.
  • The Y values are roughly normally distributed (i.e., symmetric and unimodal ). A little skewness is ok if the sample size is large.

The test procedure consists of four steps: (1) state the hypotheses, (2) formulate an analysis plan, (3) analyze sample data, and (4) interpret results.

State the Hypotheses

If there is a significant linear relationship between the independent variable X and the dependent variable Y , the slope will not equal zero.

H o : Β 1 = 0

H a : Β 1 ≠ 0

The null hypothesis states that the slope is equal to zero, and the alternative hypothesis states that the slope is not equal to zero.

Formulate an Analysis Plan

The analysis plan describes how to use sample data to accept or reject the null hypothesis. The plan should specify the following elements.

  • Significance level. Often, researchers choose significance levels equal to 0.01, 0.05, or 0.10; but any value between 0 and 1 can be used.
  • Test method. Use a linear regression t-test (described in the next section) to determine whether the slope of the regression line differs significantly from zero.

Analyze Sample Data

Using sample data, find the standard error of the slope, the slope of the regression line, the degrees of freedom, the test statistic, and the P-value associated with the test statistic. The approach described in this section is illustrated in the sample problem at the end of this lesson.

SE = s b 1 = sqrt [ Σ(y i - ŷ i ) 2 / (n - 2) ] / sqrt [ Σ(x i - x ) 2 ]

  • Slope. Like the standard error, the slope of the regression line will be provided by most statistics software packages. In the hypothetical output above, the slope is equal to 35.

t = b 1 / SE

  • P-value. The P-value is the probability of observing a sample statistic as extreme as the test statistic. Since the test statistic is a t statistic, use the t Distribution Calculator to assess the probability associated with the test statistic. Use the degrees of freedom computed above.

Interpret Results

If the sample findings are unlikely, given the null hypothesis, the researcher rejects the null hypothesis. Typically, this involves comparing the P-value to the significance level , and rejecting the null hypothesis when the P-value is less than the significance level.

Test Your Understanding

The local utility company surveys 101 randomly selected customers. For each survey participant, the company collects the following: annual electric bill (in dollars) and home size (in square feet). Output from a regression analysis appears below.

Is there a significant linear relationship between annual bill and home size? Use a 0.05 level of significance.

The solution to this problem takes four steps: (1) state the hypotheses, (2) formulate an analysis plan, (3) analyze sample data, and (4) interpret results. We work through those steps below:

H o : The slope of the regression line is equal to zero.

H a : The slope of the regression line is not equal to zero.

  • Formulate an analysis plan . For this analysis, the significance level is 0.05. Using sample data, we will conduct a linear regression t-test to determine whether the slope of the regression line differs significantly from zero.

We get the slope (b 1 ) and the standard error (SE) from the regression output.

b 1 = 0.55       SE = 0.24

We compute the degrees of freedom and the t statistic, using the following equations.

DF = n - 2 = 101 - 2 = 99

t = b 1 /SE = 0.55/0.24 = 2.29

where DF is the degrees of freedom, n is the number of observations in the sample, b 1 is the slope of the regression line, and SE is the standard error of the slope.

  • Interpret results . Since the P-value (0.0242) is less than the significance level (0.05), we cannot accept the null hypothesis.

9.1 Null and Alternative Hypotheses

The actual test begins by considering two hypotheses . They are called the null hypothesis and the alternative hypothesis . These hypotheses contain opposing viewpoints.

H 0 , the — null hypothesis: a statement of no difference between sample means or proportions or no difference between a sample mean or proportion and a population mean or proportion. In other words, the difference equals 0.

H a —, the alternative hypothesis: a claim about the population that is contradictory to H 0 and what we conclude when we reject H 0 .

Since the null and alternative hypotheses are contradictory, you must examine evidence to decide if you have enough evidence to reject the null hypothesis or not. The evidence is in the form of sample data.

After you have determined which hypothesis the sample supports, you make a decision. There are two options for a decision. They are reject H 0 if the sample information favors the alternative hypothesis or do not reject H 0 or decline to reject H 0 if the sample information is insufficient to reject the null hypothesis.

Mathematical Symbols Used in H 0 and H a :

H 0 always has a symbol with an equal in it. H a never has a symbol with an equal in it. The choice of symbol depends on the wording of the hypothesis test. However, be aware that many researchers use = in the null hypothesis, even with > or < as the symbol in the alternative hypothesis. This practice is acceptable because we only make the decision to reject or not reject the null hypothesis.

Example 9.1

H 0 : No more than 30 percent of the registered voters in Santa Clara County voted in the primary election. p ≤ 30 H a : More than 30 percent of the registered voters in Santa Clara County voted in the primary election. p > 30

A medical trial is conducted to test whether or not a new medicine reduces cholesterol by 25 percent. State the null and alternative hypotheses.

Example 9.2

We want to test whether the mean GPA of students in American colleges is different from 2.0 (out of 4.0). The null and alternative hypotheses are the following: H 0 : μ = 2.0 H a : μ ≠ 2.0

We want to test whether the mean height of eighth graders is 66 inches. State the null and alternative hypotheses. Fill in the correct symbol (=, ≠, ≥, <, ≤, >) for the null and alternative hypotheses.

  • H 0 : μ __ 66
  • H a : μ __ 66

Example 9.3

We want to test if college students take fewer than five years to graduate from college, on the average. The null and alternative hypotheses are the following: H 0 : μ ≥ 5 H a : μ < 5

We want to test if it takes fewer than 45 minutes to teach a lesson plan. State the null and alternative hypotheses. Fill in the correct symbol ( =, ≠, ≥, <, ≤, >) for the null and alternative hypotheses.

  • H 0 : μ __ 45
  • H a : μ __ 45

Example 9.4

An article on school standards stated that about half of all students in France, Germany, and Israel take advanced placement exams and a third of the students pass. The same article stated that 6.6 percent of U.S. students take advanced placement exams and 4.4 percent pass. Test if the percentage of U.S. students who take advanced placement exams is more than 6.6 percent. State the null and alternative hypotheses. H 0 : p ≤ 0.066 H a : p > 0.066

On a state driver’s test, about 40 percent pass the test on the first try. We want to test if more than 40 percent pass on the first try. Fill in the correct symbol (=, ≠, ≥, <, ≤, >) for the null and alternative hypotheses.

  • H 0 : p __ 0.40
  • H a : p __ 0.40

Collaborative Exercise

Bring to class a newspaper, some news magazines, and some internet articles. In groups, find articles from which your group can write null and alternative hypotheses. Discuss your hypotheses with the rest of the class.

As an Amazon Associate we earn from qualifying purchases.

This book may not be used in the training of large language models or otherwise be ingested into large language models or generative AI offerings without OpenStax's permission.

Want to cite, share, or modify this book? This book uses the Creative Commons Attribution License and you must attribute Texas Education Agency (TEA). The original material is available at: https://www.texasgateway.org/book/tea-statistics . Changes were made to the original material, including updates to art, structure, and other content updates.

Access for free at https://openstax.org/books/statistics/pages/1-introduction
  • Authors: Barbara Illowsky, Susan Dean
  • Publisher/website: OpenStax
  • Book title: Statistics
  • Publication date: Mar 27, 2020
  • Location: Houston, Texas
  • Book URL: https://openstax.org/books/statistics/pages/1-introduction
  • Section URL: https://openstax.org/books/statistics/pages/9-1-null-and-alternative-hypotheses

© Jan 23, 2024 Texas Education Agency (TEA). The OpenStax name, OpenStax logo, OpenStax book covers, OpenStax CNX name, and OpenStax CNX logo are not subject to the Creative Commons license and may not be reproduced without the prior and express written consent of Rice University.

Understanding the Null Hypothesis for Linear Regression

Linear regression is a technique we can use to understand the relationship between one or more predictor variables and a response variable .

If we only have one predictor variable and one response variable, we can use simple linear regression , which uses the following formula to estimate the relationship between the variables:

ŷ = β 0 + β 1 x

  • ŷ: The estimated response value.
  • β 0 : The average value of y when x is zero.
  • β 1 : The average change in y associated with a one unit increase in x.
  • x: The value of the predictor variable.

Simple linear regression uses the following null and alternative hypotheses:

  • H 0 : β 1 = 0
  • H A : β 1 ≠ 0

The null hypothesis states that the coefficient β 1 is equal to zero. In other words, there is no statistically significant relationship between the predictor variable, x, and the response variable, y.

The alternative hypothesis states that β 1 is not equal to zero. In other words, there is a statistically significant relationship between x and y.

If we have multiple predictor variables and one response variable, we can use multiple linear regression , which uses the following formula to estimate the relationship between the variables:

ŷ = β 0 + β 1 x 1 + β 2 x 2 + … + β k x k

  • β 0 : The average value of y when all predictor variables are equal to zero.
  • β i : The average change in y associated with a one unit increase in x i .
  • x i : The value of the predictor variable x i .

Multiple linear regression uses the following null and alternative hypotheses:

  • H 0 : β 1 = β 2 = … = β k = 0
  • H A : β 1 = β 2 = … = β k ≠ 0

The null hypothesis states that all coefficients in the model are equal to zero. In other words, none of the predictor variables have a statistically significant relationship with the response variable, y.

The alternative hypothesis states that not every coefficient is simultaneously equal to zero.

The following examples show how to decide to reject or fail to reject the null hypothesis in both simple linear regression and multiple linear regression models.

Example 1: Simple Linear Regression

Suppose a professor would like to use the number of hours studied to predict the exam score that students will receive in his class. He collects data for 20 students and fits a simple linear regression model.

The following screenshot shows the output of the regression model:

Output of simple linear regression in Excel

The fitted simple linear regression model is:

Exam Score = 67.1617 + 5.2503*(hours studied)

To determine if there is a statistically significant relationship between hours studied and exam score, we need to analyze the overall F value of the model and the corresponding p-value:

  • Overall F-Value:  47.9952
  • P-value:  0.000

Since this p-value is less than .05, we can reject the null hypothesis. In other words, there is a statistically significant relationship between hours studied and exam score received.

Example 2: Multiple Linear Regression

Suppose a professor would like to use the number of hours studied and the number of prep exams taken to predict the exam score that students will receive in his class. He collects data for 20 students and fits a multiple linear regression model.

Multiple linear regression output in Excel

The fitted multiple linear regression model is:

Exam Score = 67.67 + 5.56*(hours studied) – 0.60*(prep exams taken)

To determine if there is a jointly statistically significant relationship between the two predictor variables and the response variable, we need to analyze the overall F value of the model and the corresponding p-value:

  • Overall F-Value:  23.46
  • P-value:  0.00

Since this p-value is less than .05, we can reject the null hypothesis. In other words, hours studied and prep exams taken have a jointly statistically significant relationship with exam score.

Note: Although the p-value for prep exams taken (p = 0.52) is not significant, prep exams combined with hours studied has a significant relationship with exam score.

Additional Resources

Understanding the F-Test of Overall Significance in Regression How to Read and Interpret a Regression Table How to Report Regression Results How to Perform Simple Linear Regression in Excel How to Perform Multiple Linear Regression in Excel

The Complete Guide: How to Report Regression Results

R vs. r-squared: what’s the difference, related posts, how to normalize data between -1 and 1, how to interpret f-values in a two-way anova, how to create a vector of ones in..., vba: how to check if string contains another..., how to determine if a probability distribution is..., what is a symmetric histogram (definition & examples), how to find the mode of a histogram..., how to find quartiles in even and odd..., how to calculate sxy in statistics (with example), how to calculate sxx in statistics (with example).

  • Prompt Library
  • DS/AI Trends
  • Stats Tools
  • Interview Questions
  • Generative AI
  • Machine Learning
  • Deep Learning

Linear regression hypothesis testing: Concepts, Examples

Simple linear regression model

In relation to machine learning , linear regression is defined as a predictive modeling technique that allows us to build a model which can help predict continuous response variables as a function of a linear combination of explanatory or predictor variables. While training linear regression models, we need to rely on hypothesis testing in relation to determining the relationship between the response and predictor variables. In the case of the linear regression model, two types of hypothesis testing are done. They are T-tests and F-tests . In other words, there are two types of statistics that are used to assess whether linear regression models exist representing response and predictor variables. They are t-statistics and f-statistics. As data scientists , it is of utmost importance to determine if linear regression is the correct choice of model for our particular problem and this can be done by performing hypothesis testing related to linear regression response and predictor variables. Many times, it is found that these concepts are not very clear with a lot many data scientists. In this blog post, we will discuss linear regression and hypothesis testing related to t-statistics and f-statistics . We will also provide an example to help illustrate how these concepts work.

Table of Contents

What are linear regression models?

A linear regression model can be defined as the function approximation that represents a continuous response variable as a function of one or more predictor variables. While building a linear regression model, the goal is to identify a linear equation that best predicts or models the relationship between the response or dependent variable and one or more predictor or independent variables.

There are two different kinds of linear regression models. They are as follows:

  • Simple or Univariate linear regression models : These are linear regression models that are used to build a linear relationship between one response or dependent variable and one predictor or independent variable. The form of the equation that represents a simple linear regression model is Y=mX+b, where m is the coefficients of the predictor variable and b is bias. When considering the linear regression line, m represents the slope and b represents the intercept.
  • Multiple or Multi-variate linear regression models : These are linear regression models that are used to build a linear relationship between one response or dependent variable and more than one predictor or independent variable. The form of the equation that represents a multiple linear regression model is Y=b0+b1X1+ b2X2 + … + bnXn, where bi represents the coefficients of the ith predictor variable. In this type of linear regression model, each predictor variable has its own coefficient that is used to calculate the predicted value of the response variable.

While training linear regression models, the requirement is to determine the coefficients which can result in the best-fitted linear regression line. The learning algorithm used to find the most appropriate coefficients is known as least squares regression . In the least-squares regression method, the coefficients are calculated using the least-squares error function. The main objective of this method is to minimize or reduce the sum of squared residuals between actual and predicted response values. The sum of squared residuals is also called the residual sum of squares (RSS). The outcome of executing the least-squares regression method is coefficients that minimize the linear regression cost function .

The residual e of the ith observation is represented as the following where [latex]Y_i[/latex] is the ith observation and [latex]\hat{Y_i}[/latex] is the prediction for ith observation or the value of response variable for ith observation.

[latex]e_i = Y_i – \hat{Y_i}[/latex]

The residual sum of squares can be represented as the following:

[latex]RSS = e_1^2 + e_2^2 + e_3^2 + … + e_n^2[/latex]

The least-squares method represents the algorithm that minimizes the above term, RSS.

Once the coefficients are determined, can it be claimed that these coefficients are the most appropriate ones for linear regression? The answer is no. After all, the coefficients are only the estimates and thus, there will be standard errors associated with each of the coefficients.  Recall that the standard error is used to calculate the confidence interval in which the mean value of the population parameter would exist. In other words, it represents the error of estimating a population parameter based on the sample data. The value of the standard error is calculated as the standard deviation of the sample divided by the square root of the sample size. The formula below represents the standard error of a mean.

[latex]SE(\mu) = \frac{\sigma}{\sqrt(N)}[/latex]

Thus, without analyzing aspects such as the standard error associated with the coefficients, it cannot be claimed that the linear regression coefficients are the most suitable ones without performing hypothesis testing. This is where hypothesis testing is needed . Before we get into why we need hypothesis testing with the linear regression model, let’s briefly learn about what is hypothesis testing?

Train a Multiple Linear Regression Model using R

Before getting into understanding the hypothesis testing concepts in relation to the linear regression model, let’s train a multi-variate or multiple linear regression model and print the summary output of the model which will be referred to, in the next section. 

The data used for creating a multi-linear regression model is BostonHousing which can be loaded in RStudioby installing mlbench package. The code is shown below:

install.packages(“mlbench”) library(mlbench) data(“BostonHousing”)

Once the data is loaded, the code shown below can be used to create the linear regression model.

attach(BostonHousing) BostonHousing.lm <- lm(log(medv) ~ crim + chas + rad + lstat) summary(BostonHousing.lm)

Executing the above command will result in the creation of a linear regression model with the response variable as medv and predictor variables as crim, chas, rad, and lstat. The following represents the details related to the response and predictor variables:

  • log(medv) : Log of the median value of owner-occupied homes in USD 1000’s
  • crim : Per capita crime rate by town
  • chas : Charles River dummy variable (= 1 if tract bounds river; 0 otherwise)
  • rad : Index of accessibility to radial highways
  • lstat : Percentage of the lower status of the population

The following will be the output of the summary command that prints the details relating to the model including hypothesis testing details for coefficients (t-statistics) and the model as a whole (f-statistics) 

linear regression model summary table r.png

Hypothesis tests & Linear Regression Models

Hypothesis tests are the statistical procedure that is used to test a claim or assumption about the underlying distribution of a population based on the sample data. Here are key steps of doing hypothesis tests with linear regression models:

  • Hypothesis formulation for T-tests: In the case of linear regression, the claim is made that there exists a relationship between response and predictor variables, and the claim is represented using the non-zero value of coefficients of predictor variables in the linear equation or regression model. This is formulated as an alternate hypothesis. Thus, the null hypothesis is set that there is no relationship between response and the predictor variables . Hence, the coefficients related to each of the predictor variables is equal to zero (0). So, if the linear regression model is Y = a0 + a1x1 + a2x2 + a3x3, then the null hypothesis for each test states that a1 = 0, a2 = 0, a3 = 0 etc. For all the predictor variables, individual hypothesis testing is done to determine whether the relationship between response and that particular predictor variable is statistically significant based on the sample data used for training the model. Thus, if there are, say, 5 features, there will be five hypothesis tests and each will have an associated null and alternate hypothesis.
  • Hypothesis formulation for F-test : In addition, there is a hypothesis test done around the claim that there is a linear regression model representing the response variable and all the predictor variables. The null hypothesis is that the linear regression model does not exist . This essentially means that the value of all the coefficients is equal to zero. So, if the linear regression model is Y = a0 + a1x1 + a2x2 + a3x3, then the null hypothesis states that a1 = a2 = a3 = 0.
  • F-statistics for testing hypothesis for linear regression model : F-test is used to test the null hypothesis that a linear regression model does not exist, representing the relationship between the response variable y and the predictor variables x1, x2, x3, x4 and x5. The null hypothesis can also be represented as x1 = x2 = x3 = x4 = x5 = 0. F-statistics is calculated as a function of sum of squares residuals for restricted regression (representing linear regression model with only intercept or bias and all the values of coefficients as zero) and sum of squares residuals for unrestricted regression (representing linear regression model). In the above diagram, note the value of f-statistics as 15.66 against the degrees of freedom as 5 and 194. 
  • Evaluate t-statistics against the critical value/region : After calculating the value of t-statistics for each coefficient, it is now time to make a decision about whether to accept or reject the null hypothesis. In order for this decision to be made, one needs to set a significance level, which is also known as the alpha level. The significance level of 0.05 is usually set for rejecting the null hypothesis or otherwise. If the value of t-statistics fall in the critical region, the null hypothesis is rejected. Or, if the p-value comes out to be less than 0.05, the null hypothesis is rejected.
  • Evaluate f-statistics against the critical value/region : The value of F-statistics and the p-value is evaluated for testing the null hypothesis that the linear regression model representing response and predictor variables does not exist. If the value of f-statistics is more than the critical value at the level of significance as 0.05, the null hypothesis is rejected. This means that the linear model exists with at least one valid coefficients. 
  • Draw conclusions : The final step of hypothesis testing is to draw a conclusion by interpreting the results in terms of the original claim or hypothesis. If the null hypothesis of one or more predictor variables is rejected, it represents the fact that the relationship between the response and the predictor variable is not statistically significant based on the evidence or the sample data we used for training the model. Similarly, if the f-statistics value lies in the critical region and the value of the p-value is less than the alpha value usually set as 0.05, one can say that there exists a linear regression model.

Why hypothesis tests for linear regression models?

The reasons why we need to do hypothesis tests in case of a linear regression model are following:

  • By creating the model, we are establishing a new truth (claims) about the relationship between response or dependent variable with one or more predictor or independent variables. In order to justify the truth, there are needed one or more tests. These tests can be termed as an act of testing the claim (or new truth) or in other words, hypothesis tests.
  • One kind of test is required to test the relationship between response and each of the predictor variables (hence, T-tests)
  • Another kind of test is required to test the linear regression model representation as a whole. This is called F-test.

While training linear regression models, hypothesis testing is done to determine whether the relationship between the response and each of the predictor variables is statistically significant or otherwise. The coefficients related to each of the predictor variables is determined. Then, individual hypothesis tests are done to determine whether the relationship between response and that particular predictor variable is statistically significant based on the sample data used for training the model. If at least one of the null hypotheses is rejected, it represents the fact that there exists no relationship between response and that particular predictor variable. T-statistics is used for performing the hypothesis testing because the standard deviation of the sampling distribution is unknown. The value of t-statistics is compared with the critical value from the t-distribution table in order to make a decision about whether to accept or reject the null hypothesis regarding the relationship between the response and predictor variables. If the value falls in the critical region, then the null hypothesis is rejected which means that there is no relationship between response and that predictor variable. In addition to T-tests, F-test is performed to test the null hypothesis that the linear regression model does not exist and that the value of all the coefficients is zero (0). Learn more about the linear regression and t-test in this blog – Linear regression t-test: formula, example .

Recent Posts

Ajitesh Kumar

  • Python Pickle Security Issues / Risk - May 31, 2024
  • Pricing Analytics in Banking: Strategies, Examples - May 15, 2024
  • How to Learn Effectively: A Holistic Approach - May 13, 2024

Ajitesh Kumar

One response.

Very informative

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

  • Search for:
  • Excellence Awaits: IITs, NITs & IIITs Journey

ChatGPT Prompts (250+)

  • Generate Design Ideas for App
  • Expand Feature Set of App
  • Create a User Journey Map for App
  • Generate Visual Design Ideas for App
  • Generate a List of Competitors for App
  • Python Pickle Security Issues / Risk
  • Pricing Analytics in Banking: Strategies, Examples
  • How to Learn Effectively: A Holistic Approach
  • How to Choose Right Statistical Tests: Examples
  • Data Lakehouses Fundamentals & Examples

Data Science / AI Trends

  • • Prepend any arxiv.org link with talk2 to load the paper into a responsive chat application
  • • Custom LLM and AI Agents (RAG) On Structured + Unstructured Data - AI Brain For Your Organization
  • • Guides, papers, lecture, notebooks and resources for prompt engineering
  • • Common tricks to make LLMs efficient and stable
  • • Machine learning in finance

Free Online Tools

  • Create Scatter Plots Online for your Excel Data
  • Histogram / Frequency Distribution Creation Tool
  • Online Pie Chart Maker Tool
  • Z-test vs T-test Decision Tool
  • Independent samples t-test calculator

Recent Comments

I found it very helpful. However the differences are not too understandable for me

Very Nice Explaination. Thankyiu very much,

in your case E respresent Member or Oraganization which include on e or more peers?

Such a informative post. Keep it up

Thank you....for your support. you given a good solution for me.

Library homepage

  • school Campus Bookshelves
  • menu_book Bookshelves
  • perm_media Learning Objects
  • login Login
  • how_to_reg Request Instructor Account
  • hub Instructor Commons

Margin Size

  • Download Page (PDF)
  • Download Full Book (PDF)
  • Periodic Table
  • Physics Constants
  • Scientific Calculator
  • Reference & Cite
  • Tools expand_more
  • Readability

selected template will load here

This action is not available.

Mathematics LibreTexts

10.2: Null and Alternative Hypotheses

  • Last updated
  • Save as PDF
  • Page ID 155545

\( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

\( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

\( \newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\)

( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\)

\( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

\( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\)

\( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

\( \newcommand{\Span}{\mathrm{span}}\)

\( \newcommand{\id}{\mathrm{id}}\)

\( \newcommand{\kernel}{\mathrm{null}\,}\)

\( \newcommand{\range}{\mathrm{range}\,}\)

\( \newcommand{\RealPart}{\mathrm{Re}}\)

\( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

\( \newcommand{\Argument}{\mathrm{Arg}}\)

\( \newcommand{\norm}[1]{\| #1 \|}\)

\( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\AA}{\unicode[.8,0]{x212B}}\)

\( \newcommand{\vectorA}[1]{\vec{#1}}      % arrow\)

\( \newcommand{\vectorAt}[1]{\vec{\text{#1}}}      % arrow\)

\( \newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

\( \newcommand{\vectorC}[1]{\textbf{#1}} \)

\( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)

\( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)

\( \newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}} \)

The actual test begins by considering two hypotheses . They are called the null hypothesis and the alternative hypothesis . These hypotheses contain opposing viewpoints.

\(H_0\): The null hypothesis: It is a statement of no difference between the variables—they are not related. This can often be considered the status quo and as a result if you cannot accept the null it requires some action.

\(H_a\): The alternative hypothesis: It is a claim about the population that is contradictory to \(H_0\) and what we conclude when we reject \(H_0\). This is usually what the researcher is trying to prove.

Since the null and alternative hypotheses are contradictory, you must examine evidence to decide if you have enough evidence to reject the null hypothesis or not. The evidence is in the form of sample data.

After you have determined which hypothesis the sample supports, you make a decision. There are two options for a decision. They are "reject \(H_0\)" if the sample information favors the alternative hypothesis or "do not reject \(H_0\)" or "decline to reject \(H_0\)" if the sample information is insufficient to reject the null hypothesis.

\(H_{0}\) always has a symbol with an equal in it. \(H_{a}\) never has a symbol with an equal in it. The choice of symbol depends on the wording of the hypothesis test. However, be aware that many researchers (including one of the co-authors in research work) use = in the null hypothesis, even with > or < as the symbol in the alternative hypothesis. This practice is acceptable because we only make the decision to reject or not reject the null hypothesis.

Example \(\PageIndex{1}\)

  • \(H_{0}\): No more than 30% of the registered voters in Santa Clara County voted in the primary election. \(p \leq 30\)
  • \(H_{a}\): More than 30% of the registered voters in Santa Clara County voted in the primary election. \(p > 30\)

Exercise \(\PageIndex{1}\)

A medical trial is conducted to test whether or not a new medicine reduces cholesterol by 25%. State the null and alternative hypotheses.

  • \(H_{0}\): The drug reduces cholesterol by 25%. \(p = 0.25\)
  • \(H_{a}\): The drug does not reduce cholesterol by 25%. \(p \neq 0.25\)

Example \(\PageIndex{2}\)

We want to test whether the mean GPA of students in American colleges is different from 2.0 (out of 4.0). The null and alternative hypotheses are:

  • \(H_{0}: \mu = 2.0\)
  • \(H_{a}: \mu \neq 2.0\)

Exercise \(\PageIndex{2}\)

We want to test whether the mean height of eighth graders is 66 inches. State the null and alternative hypotheses. Fill in the correct symbol \((=, \neq, \geq, <, \leq, >)\) for the null and alternative hypotheses.

  • \(H_{0}: \mu \_ 66\)
  • \(H_{a}: \mu \_ 66\)
  • \(H_{0}: \mu = 66\)
  • \(H_{a}: \mu \neq 66\)

Example \(\PageIndex{3}\)

We want to test if college students take less than five years to graduate from college, on the average. The null and alternative hypotheses are:

  • \(H_{0}: \mu \geq 5\)
  • \(H_{a}: \mu < 5\)

Exercise \(\PageIndex{3}\)

We want to test if it takes fewer than 45 minutes to teach a lesson plan. State the null and alternative hypotheses. Fill in the correct symbol ( =, ≠, ≥, <, ≤, >) for the null and alternative hypotheses.

  • \(H_{0}: \mu \_ 45\)
  • \(H_{a}: \mu \_ 45\)
  • \(H_{0}: \mu \geq 45\)
  • \(H_{a}: \mu < 45\)

Example \(\PageIndex{4}\)

In an issue of U. S. News and World Report , an article on school standards stated that about half of all students in France, Germany, and Israel take advanced placement exams and a third pass. The same article stated that 6.6% of U.S. students take advanced placement exams and 4.4% pass. Test if the percentage of U.S. students who take advanced placement exams is more than 6.6%. State the null and alternative hypotheses.

  • \(H_{0}: p \leq 0.066\)
  • \(H_{a}: p > 0.066\)

Exercise \(\PageIndex{4}\)

On a state driver’s test, about 40% pass the test on the first try. We want to test if more than 40% pass on the first try. Fill in the correct symbol (\(=, \neq, \geq, <, \leq, >\)) for the null and alternative hypotheses.

  • \(H_{0}: p \_ 0.40\)
  • \(H_{a}: p \_ 0.40\)
  • \(H_{0}: p = 0.40\)
  • \(H_{a}: p > 0.40\)

COLLABORATIVE EXERCISE

Bring to class a newspaper, some news magazines, and some Internet articles . In groups, find articles from which your group can write null and alternative hypotheses. Discuss your hypotheses with the rest of the class.

In a hypothesis test , sample data is evaluated in order to arrive at a decision about some type of claim. If certain conditions about the sample are satisfied, then the claim can be evaluated for a population. In a hypothesis test, we:

  • Evaluate the null hypothesis , typically denoted with \(H_{0}\). The null is not rejected unless the hypothesis test shows otherwise. The null statement must always contain some form of equality \((=, \leq \text{or} \geq)\)
  • Always write the alternative hypothesis , typically denoted with \(H_{a}\) or \(H_{1}\), using less than, greater than, or not equals symbols, i.e., \((\neq, >, \text{or} <)\).
  • If we reject the null hypothesis, then we can assume there is enough evidence to support the alternative hypothesis.
  • Never state that a claim is proven true or false. Keep in mind the underlying fact that hypothesis testing is based on probability laws; therefore, we can talk only in terms of non-absolute certainties.

Formula Review

\(H_{0}\) and \(H_{a}\) are contradictory.

  • If \(\alpha \leq p\)-value, then do not reject \(H_{0}\).
  • If\(\alpha > p\)-value, then reject \(H_{0}\).

\(\alpha\) is preconceived. Its value is set before the hypothesis test starts. The \(p\)-value is calculated from the data.References

Data from the National Institute of Mental Health. Available online at http://www.nimh.nih.gov/publicat/depression.cfm .

Library homepage

  • school Campus Bookshelves
  • menu_book Bookshelves
  • perm_media Learning Objects
  • login Login
  • how_to_reg Request Instructor Account
  • hub Instructor Commons

Margin Size

  • Download Page (PDF)
  • Download Full Book (PDF)
  • Periodic Table
  • Physics Constants
  • Scientific Calculator
  • Reference & Cite
  • Tools expand_more
  • Readability

selected template will load here

This action is not available.

Statistics LibreTexts

9.1: Null and Alternative Hypotheses

  • Last updated
  • Save as PDF
  • Page ID 23459

\( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

\( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

\( \newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\)

( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\)

\( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

\( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\)

\( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

\( \newcommand{\Span}{\mathrm{span}}\)

\( \newcommand{\id}{\mathrm{id}}\)

\( \newcommand{\kernel}{\mathrm{null}\,}\)

\( \newcommand{\range}{\mathrm{range}\,}\)

\( \newcommand{\RealPart}{\mathrm{Re}}\)

\( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

\( \newcommand{\Argument}{\mathrm{Arg}}\)

\( \newcommand{\norm}[1]{\| #1 \|}\)

\( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\AA}{\unicode[.8,0]{x212B}}\)

\( \newcommand{\vectorA}[1]{\vec{#1}}      % arrow\)

\( \newcommand{\vectorAt}[1]{\vec{\text{#1}}}      % arrow\)

\( \newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

\( \newcommand{\vectorC}[1]{\textbf{#1}} \)

\( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)

\( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)

\( \newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}} \)

The actual test begins by considering two hypotheses . They are called the null hypothesis and the alternative hypothesis . These hypotheses contain opposing viewpoints.

\(H_0\): The null hypothesis: It is a statement of no difference between the variables—they are not related. This can often be considered the status quo and as a result if you cannot accept the null it requires some action.

\(H_a\): The alternative hypothesis: It is a claim about the population that is contradictory to \(H_0\) and what we conclude when we reject \(H_0\). This is usually what the researcher is trying to prove.

Since the null and alternative hypotheses are contradictory, you must examine evidence to decide if you have enough evidence to reject the null hypothesis or not. The evidence is in the form of sample data.

After you have determined which hypothesis the sample supports, you make a decision. There are two options for a decision. They are "reject \(H_0\)" if the sample information favors the alternative hypothesis or "do not reject \(H_0\)" or "decline to reject \(H_0\)" if the sample information is insufficient to reject the null hypothesis.

\(H_{0}\) always has a symbol with an equal in it. \(H_{a}\) never has a symbol with an equal in it. The choice of symbol depends on the wording of the hypothesis test. However, be aware that many researchers (including one of the co-authors in research work) use = in the null hypothesis, even with > or < as the symbol in the alternative hypothesis. This practice is acceptable because we only make the decision to reject or not reject the null hypothesis.

Example \(\PageIndex{1}\)

  • \(H_{0}\): No more than 30% of the registered voters in Santa Clara County voted in the primary election. \(p \leq 30\)
  • \(H_{a}\): More than 30% of the registered voters in Santa Clara County voted in the primary election. \(p > 30\)

Exercise \(\PageIndex{1}\)

A medical trial is conducted to test whether or not a new medicine reduces cholesterol by 25%. State the null and alternative hypotheses.

  • \(H_{0}\): The drug reduces cholesterol by 25%. \(p = 0.25\)
  • \(H_{a}\): The drug does not reduce cholesterol by 25%. \(p \neq 0.25\)

Example \(\PageIndex{2}\)

We want to test whether the mean GPA of students in American colleges is different from 2.0 (out of 4.0). The null and alternative hypotheses are:

  • \(H_{0}: \mu = 2.0\)
  • \(H_{a}: \mu \neq 2.0\)

Exercise \(\PageIndex{2}\)

We want to test whether the mean height of eighth graders is 66 inches. State the null and alternative hypotheses. Fill in the correct symbol \((=, \neq, \geq, <, \leq, >)\) for the null and alternative hypotheses.

  • \(H_{0}: \mu \_ 66\)
  • \(H_{a}: \mu \_ 66\)
  • \(H_{0}: \mu = 66\)
  • \(H_{a}: \mu \neq 66\)

Example \(\PageIndex{3}\)

We want to test if college students take less than five years to graduate from college, on the average. The null and alternative hypotheses are:

  • \(H_{0}: \mu \geq 5\)
  • \(H_{a}: \mu < 5\)

Exercise \(\PageIndex{3}\)

We want to test if it takes fewer than 45 minutes to teach a lesson plan. State the null and alternative hypotheses. Fill in the correct symbol ( =, ≠, ≥, <, ≤, >) for the null and alternative hypotheses.

  • \(H_{0}: \mu \_ 45\)
  • \(H_{a}: \mu \_ 45\)
  • \(H_{0}: \mu \geq 45\)
  • \(H_{a}: \mu < 45\)

Example \(\PageIndex{4}\)

In an issue of U. S. News and World Report , an article on school standards stated that about half of all students in France, Germany, and Israel take advanced placement exams and a third pass. The same article stated that 6.6% of U.S. students take advanced placement exams and 4.4% pass. Test if the percentage of U.S. students who take advanced placement exams is more than 6.6%. State the null and alternative hypotheses.

  • \(H_{0}: p \leq 0.066\)
  • \(H_{a}: p > 0.066\)

Exercise \(\PageIndex{4}\)

On a state driver’s test, about 40% pass the test on the first try. We want to test if more than 40% pass on the first try. Fill in the correct symbol (\(=, \neq, \geq, <, \leq, >\)) for the null and alternative hypotheses.

  • \(H_{0}: p \_ 0.40\)
  • \(H_{a}: p \_ 0.40\)
  • \(H_{0}: p = 0.40\)
  • \(H_{a}: p > 0.40\)

COLLABORATIVE EXERCISE

Bring to class a newspaper, some news magazines, and some Internet articles . In groups, find articles from which your group can write null and alternative hypotheses. Discuss your hypotheses with the rest of the class.

In a hypothesis test , sample data is evaluated in order to arrive at a decision about some type of claim. If certain conditions about the sample are satisfied, then the claim can be evaluated for a population. In a hypothesis test, we:

  • Evaluate the null hypothesis , typically denoted with \(H_{0}\). The null is not rejected unless the hypothesis test shows otherwise. The null statement must always contain some form of equality \((=, \leq \text{or} \geq)\)
  • Always write the alternative hypothesis , typically denoted with \(H_{a}\) or \(H_{1}\), using less than, greater than, or not equals symbols, i.e., \((\neq, >, \text{or} <)\).
  • If we reject the null hypothesis, then we can assume there is enough evidence to support the alternative hypothesis.
  • Never state that a claim is proven true or false. Keep in mind the underlying fact that hypothesis testing is based on probability laws; therefore, we can talk only in terms of non-absolute certainties.

Formula Review

\(H_{0}\) and \(H_{a}\) are contradictory.

  • If \(\alpha \leq p\)-value, then do not reject \(H_{0}\).
  • If\(\alpha > p\)-value, then reject \(H_{0}\).

\(\alpha\) is preconceived. Its value is set before the hypothesis test starts. The \(p\)-value is calculated from the data.References

Data from the National Institute of Mental Health. Available online at http://www.nimh.nih.gov/publicat/depression.cfm .

Thank you for visiting nature.com. You are using a browser version with limited support for CSS. To obtain the best experience, we recommend you use a more up to date browser (or turn off compatibility mode in Internet Explorer). In the meantime, to ensure continued support, we are displaying the site without styles and JavaScript.

  • View all journals
  • My Account Login
  • Explore content
  • About the journal
  • Publish with us
  • Sign up for alerts
  • Open access
  • Published: 06 June 2024

Heterogeneous peer effects of college roommates on academic performance

  • Yi Cao   ORCID: orcid.org/0009-0003-4811-8788 1 , 2 ,
  • Tao Zhou   ORCID: orcid.org/0000-0003-0561-2316 1 , 2 &
  • Jian Gao   ORCID: orcid.org/0000-0001-6659-5770 3 , 4 , 5 , 6  

Nature Communications volume  15 , Article number:  4785 ( 2024 ) Cite this article

Metrics details

  • Complex networks
  • Interdisciplinary studies
  • Statistical physics

Understanding how student peers influence learning outcomes is crucial for effective education management in complex social systems. The complexities of peer selection and evolving peer relationships, however, pose challenges for identifying peer effects using static observational data. Here we use both null-model and regression approaches to examine peer effects using longitudinal data from 5,272 undergraduates, where roommate assignments are plausibly random upon enrollment and roommate relationships persist until graduation. Specifically, we construct a roommate null model by randomly shuffling students among dorm rooms and introduce an assimilation metric to quantify similarities in roommate academic performance. We find significantly larger assimilation in actual data than in the roommate null model, suggesting roommate peer effects, whereby roommates have more similar performance than expected by chance alone. Moreover, assimilation exhibits an overall increasing trend over time, suggesting that peer effects become stronger the longer roommates live together. Our regression analysis further reveals the moderating role of peer heterogeneity. In particular, when roommates perform similarly, the positive relationship between a student’s future performance and their roommates’ average prior performance is more pronounced, and their ordinal rank in the dorm room has an independent effect. Our findings contribute to understanding the role of college roommates in influencing student academic performance.

Introduction

Peer effects, or peer influence 1 , 2 , 3 , 4 , 5 , have long been studied in the literature on social contagions 6 , 7 , 8 , 9 , 10 , 11 and education 12 , 13 , 14 , 15 , 16 , 17 , 18 . Understanding the influence of student peers on social behavior and learning outcomes is crucial for effective education management 18 , 19 , 20 , 21 , 22 , as it can inform policy decisions on how to improve learning environments inside and outside the classroom 23 , 24 , 25 , 26 , 27 , 28 . Student peers can have both positive and negative effects, depending on their characteristics and behaviors 29 , 30 . For example, when surrounded by high-achieving peers, students may be motivated to improve their academic performance 31 , 32 . Meanwhile, some well-known examples of human behaviors adopted through social influence, such as smoking 33 , 34 , substance abuse 35 , 36 , and alcohol use 37 , 38 , 39 , are often associated with negative student performance. Moreover, student peers may have indirect and lasting effects, for instance, on political ideology 40 , persistence in STEM majors 41 , 42 , 43 , 44 , 45 , occupational preferences 46 , labor market outcomes 47 , 48 , 49 , and earnings 50 , 51 , 52 , 53 . A thorough understanding of peer effects on learning outcomes can inform education management strategies, such as implementing behavioral interventions to mitigate the negative influence of disruptive peers 54 , 55 . Yet, using traditional methods and observational data to study peer effects causally is a challenge.

Dynamic educational and social environments make it difficult to separate peer influence from peer selection due to reverse causality, confounding factors, and complex mechanisms 1 , 2 , 3 , 56 . In particular, similarities in academic performance among student peers may be due to homophily (i.e., the selection of peers based on academic performance similarity) rather than the influence of peers 57 , 58 , 59 . Unlike open and evolving educational environments such as classrooms 23 , 24 , 25 , 26 , dormitories in universities provide a close-knit living environment for students to interact and potentially learn from each other 60 , 61 . While dorm rooms may not be the primary learning place like classrooms and libraries, they offer a highly interpersonal and spillover environment for a small group of stable student peers. In contrast to Western universities, in which freshman students usually have the flexibility to choose dormitories and suite-mates according to their lifestyle and personal preferences, most Chinese universities randomly assign students to dorm rooms 61 , 62 , 63 . There, a typical 4-person dorm room contains four beds and some public areas, providing a more interactive environment than a Western dorm suite containing four separate bedrooms (Supplementary Fig.  1 ).

Research on student peer effects, on the one hand, has primarily relied on static observational data of campus behaviors and performance metrics 11 , 64 . This reliance stems from various factors, such as the high cost and impracticality of conducting large-scale field experiments in learning environments, the dynamic nature of peer relationships 65 , and the scarcity of longitudinal data on student learning outcomes 66 , 67 , 68 , 69 , 70 . The close-knit dormitory environment of Chinese universities, however, provides a unique opportunity to observe a stable group of student peers and track their academic performance over time 61 , 63 . On the other hand, while regression models are widely employed in studying peer effects within the social sciences, methodologies from other disciplines may help expand the functional form in which peer effects can be estimated 64 . Particularly, null models are well suited for studying nontrivial features of complex systems by providing an unbiased random structure of other features 71 , 72 , 73 . Null-model approaches have been applied to test causal effects in complex social systems 74 , 75 , 76 . For instance, in the social network literature, randomizations are used to study the impact of network interventions on social relationships 77 . Utilizing a null model to test whether roommates exhibit similar performance could offer a promising approach to identifying peer effects and quantifying their magnitude, facilitating comparisons across diverse datasets.

One advantage of regression models is their capability to address the issue of inverse causality by utilizing longitudinal data and controlling for confounding factors 68 , 78 . For example, a student’s future performance may be influenced not only by the average prior performance of roommates but also by their own prior performance. Additionally, the composition of roommates may have independent effects 79 . Yet, it remains relatively less explored whether the heterogeneity in performance among roommates provides a ladder for the student to catch up with high-achieving roommates or hamper their motivation due to the inconsistent signal from roommates or the negative impact of disruptive roommates 29 , 30 . Moreover, dorm rooms provide an interactive yet local environment where a student’s ordinal rank in the dorm room, conditional on academic performance, may independently affect learning outcomes 80 , 81 . Therefore, a more comprehensive understanding of the factors contributing to roommate peer effects may help inform education policy and student management strategies, such as designing interventions for dormitories that effectively leverage the influence of high-achieving peers in improving student performance.

In this study, we quantify roommate peer effects using both null models and regression approaches to analyze a longitudinal dataset of student accommodation and academic performance. Sourced from a public research-intensive university in China, our data covers 5,272 undergraduate students residing in 4-person dorm rooms following the random assignment of roommates (see “Methods”). The initialization is plausibly random since the roommate assignment takes into account neither students’ academic performance before college admission nor their personal preferences, and there is no significant reassignment later (see Supplementary Information Section  1.2 for details). Here, we demonstrate the presence of roommate peer effects by showing that roommates with similar performance are more likely to be observed in the actual data than expected by chance alone. We then measure the size of roommate peer effects by developing an assimilation metric of academic performance and contrasting its value in the actual data with that in the roommate null model that we construct by randomly shuffling students among dorm rooms while retaining their controlled characteristics. Further, we use regression models to examine factors influencing roommate peer effects and explore the role of peer heterogeneity in moderating the effects.

Tier combinations within a dorm room

We start by studying the roommate composition of a typical 4-person dorm room in terms of their academic performance. For comparisons across student cohorts (i.e., those who were admitted by the university in the same year), majors, and semesters, we transform each student’s grade point average (GPA) in a semester into the GPA percentile R among students in the same cohort and major, where \(R\)  = 0 and \(R\)  = 1 correspond to the lowest and highest academic performance, respectively. We then divide students into equal-sized tiers based on their GPA percentiles, where those with better performance are in larger tiers. For instance, under the 4-tier classification, students with \(R\)  = 0.3 (i.e., GPA is above 30% of students) and \(R\)  = 0.9 (i.e., GPA is above 90% of students) are in Tier 2 and Tier 4, respectively. Accordingly, each dorm room has a tier combination without particular order. For example, 3444 (i.e., one student is in Tier 3, and the other three are in Tier 4) is identical to 4344 and 4434. Here we use the one in ascending order of tier numbers to delegate all identical ones. Under the 2-tier classification, there are five unique tier combinations (1111, 1112, 1122, 1222, and 2222). The numbers are 15 and 35 under 3-tier and 4-tier classifications, respectively (Fig.  1a ; see Supplementary Information Section  2.1 for details).

figure 1

a The relative ratio \({\mathbb{E}}\) of each combination under the 2-tier, 3-tier, and 4-tier classification of GPA, respectively. The x-axis shows all unique combinations in ascending order of tier numbers under a tier classification, and the y-axis shows the relative ratio \({\mathbb{E}}\) that compares the actual frequency of a combination with its theoretical value. The horizontal dashed line marks 0. Positive and negative \({\mathbb{E}}\) is marked by ‘+‘ and ‘-‘, respectively. b Combinations in ascending order of the relative difference \(D\) , which measures the average pairwise difference between tier numbers of a combination. The staggered shade marks a group of combinations with the same \(D\) . c The negative relationship between the relative ratio \({\mathbb{E}}\) and the relative difference \(D\) based on the actual data. Data points show the \({\mathbb{E}}\) for each combination, and the hollow circle shows the mean \({\mathbb{E}}\) for each group with the same \(D\) .

Given a tier for classification, the probability \({P}_{a}\) of observing a combination in the actual data can be calculated by the fraction of dorm rooms with the combination. The actual probabilities \({P}_{a}\) of observing different combinations (i.e., the frequency of observations), however, shouldn’t be directly compared. This is because their theoretical probabilities \({P}_{t}\) are not always the same even when the tier numbers of roommates are independent of each other, i.e., there is no roommate peer effect (see Supplementary Table  1 and Supplementary Information Section  2.1 ). To give a simple example: under the 2-tier classification, the theoretical probability \({P}_{t}\) of combination 1112 is \({C}_{4}^{1}{\left(\frac{1}{2}\right)}^{3}\left(\frac{1}{2}\right)=\frac{1}{4}\) , which is four times as big as that of combination 1111, namely, \({\left(\frac{1}{2}\right)}^{4}=\frac{1}{16}\) . This leads to the difficulty of assessing, by the value of \({P}_{a}\) , whether a combination is over-represented or under-represented in the actual data. To address this challenge, we calculate the relative ratio \({\mathbb{E}}\) for a combination by comparing the actual probability with its theoretical probability:

where \({P}_{a}\) and \({P}_{t}\) are the actual and theoretical probability of the same combination, respectively. A positive (negative) value of \({\mathbb{E}}\) suggests that the combination is more (less) likely to be observed in data than expected by chance alone (see Supplementary Information Section  2.2 ).

We analyze the student accommodation and academic performance data under 2-tier, 3-tier, and 4-tier classifications and calculate the relative ratio \({\mathbb{E}}\) for each combination (Fig.  1a ). We find that \({\mathbb{E}}\) of different combinations vary substantially and \({\mathbb{E}}\) of some combinations deviates significantly from 0 according to the results of statistical tests (see “Methods” and Supplementary Information Section  3.2 for details). For example, under the 2-tier classification, \({\mathbb{E}}\) of combinations 1111 and 2222 is significantly above 0 and \({\mathbb{E}}\) of combinations 1112 and 1122 are significantly below 0 ( P value < 0.001; see Supplementary Table  2 for the statistical testing results for each combination). More notably, we find that combinations with the same or nearby tier numbers (e.g., 1111 and 1112) tend to have larger \({\mathbb{E}}\) and those with distant tier numbers (e.g., 1122) have smaller \({\mathbb{E}}\) , prompting us to study the relationship between a combination’s tier heterogeneity and its \({\mathbb{E}}\) . Specifically, we first calculate the relative difference \(D\) in the tier numbers for each combination:

where \({l}_{u}\) and \({l}_{v}\) is the tier number of roommates \(u\) and \(v\) , respectively. A smaller \(D\) indicates that roommates have closer tier numbers and thus a smaller difference in their academic performance. We then group combinations with the same \(D\) and arrange them in ascending order of \(D\) . We find that combinations with positive and negative \({\mathbb{E}}\) are overall separated (Fig.  1b ), where those with a smaller \(D\) tend to have positive \({\mathbb{E}}\) (i.e., over-represented in the actual data) and those with a larger \(D\) tend to have negative \({\mathbb{E}}\) (i.e., underrepresented in the actual data). Inspired by this observation, we calculate the mean value of \({\mathbb{E}}\) for each group with the same \(D\) , finding a negative relationship between \(D\) and \({\mathbb{E}}\) (Fig.  1c ). These results demonstrate that roommates tend to have more similar academic performance than random chance, suggesting the presence of roommate peer effects.

Assimilation of roommate academic performance

We generalize the tier combination analysis to the most granular tier for classification by directly dealing with the GPA percentile \(R\in\) [0, 1] (hereafter GPA for short). Specifically, similar to calculating the relative difference \(D\) in the tier combination for each dorm room, we develop an assimilation metric \(A\) to quantify the extent to which the GPAs of roommates differ from each other. Formally, the assimilation metric \(A\) for a 4-person dorm room is calculated by

where \({R}_{u}\) and \({R}_{v}\) are the GPAs of roommates \(u\) and \(v\) , respectively. The assimilation \(A\) of a dorm room is between 0 and 1, with a larger value indicating that roommates have more similar academic performance. If there is no roommate peer effect, each roommate’s GPA should be independent and identically distributed (i.i.d.), and the theoretical assimilation \(A\) of all dorm rooms has a mean value of 0.5 (see Supplementary Information Section  4.1 for detailed explanations).

Inspired by permutation tests, often referred to as the “quadratic assignment procedure” in social network studies 74 , 75 , we perform a statistical hypothesis test to check whether the assimilation of dorm rooms in the actual data deviates significantly from its theoretical value. Specifically, we proxy theoretical assimilation via null-model assimilation that is calculated based on a roommate null model and compare it with actual assimilation. An appropriate null model of a complex system satisfies a collection of constraints and offers a baseline to examine whether displayed features of interest are truly nontrivial 71 , 72 , 73 . We start with the actual roommate configuration and randomly shuffle students between dorm rooms while preserving their compositions of cohort, gender, and major. By repeating this process, we construct a plausible roommate null model that consists of 1000 independent implementations (see Supplementary Information Section  3.1 for details). We find that the mean of actual assimilation (0.549) of all dorm rooms is 10.7% larger than that of null-model assimilation (0.496; Fig.  2a ). A Student’s t -test confirms that the two assimilation distributions have significantly different means ( P value < 0.001; see Supplementary Information Section  4.2 for details). These results suggest that roommate assimilation in academic performance is greater than expected by chance alone, demonstrating significant roommate peer effects.

figure 2

a The density distribution p ( A ) of assimilation \(A\) for all dorm rooms. Larger assimilation means roommates have more similar academic performance. The upper half (in blue) shows the actual assimilation and the lower half (in gray) shows the null-model assimilation. Vertical dashed lines mark the statistically different means of the two assimilation distributions based on a Student’s t -test ( *** P value < 0.001). The mean actual assimilation is 10.7% larger than the mean null-model assimilation, which is close to its theoretical value 0.5. The plot is based on the data from all five semesters. b The overall increasing trend in the actual assimilation from semester 1 to semester 5. The y-axis shows the percentage difference between the mean actual assimilation and the mean null-model assimilation. Error bars represent standard errors clustered for 100 times of independent implementations.

The extent to which the mean of actual assimilation is larger than that of null-model assimilation indicates the magnitude of roommate peer effects, allowing us to examine temporal trends over the five semesters. First, we find that roommate peer effects remain significant when measured using data from each semester (see Supplementary Information Section  4.1 for details). Second, we hypothesize that before the first semester (i.e., the first day of college), roommate peer effects should be 0 due to the plausible random assignment of roommates, where the actual assimilation should be close to the null-model assimilation. As roommates live together longer and establish stronger interactions with each other, the actual assimilation of roommate academic performance would become larger, and the magnitude of roommate peer effects would become bigger. To test this hypothesis, for each semester, we calculate the percentage difference in the means of the actual assimilation and the null-model assimilation that is a proxy of roommate peer effects before the first semester (see Supplementary Information Section  4.1 for details). We find that the percentage difference exhibits an overall increasing trend over time (Fig.  2b ), which supports the hypothesis that, as roommates live together longer, the magnitude of roommate peer effects on academic performance becomes larger. These results are robust when we use an alternative way to estimate the magnitude of roommate peer effects, where we calculate the share of dorm rooms with larger-than-null-model assimilation (see Supplementary Information Section  4.3 for details). Moreover, our further analysis shows that female and male students have similar assimilation, suggesting no significant gender differences (see Supplementary Information Section  4.4 for details).

The effects of heterogeneous peers

The increasing assimilation of roommates in their academic performance raises a question about how a student’s future performance is impacted by their roommates’ prior performance, especially when there is substantial peer heterogeneity in performance, e.g., there are both high-achieving and underachieving roommates. To answer this question, we employ regression models to perform a Granger causality type of statistical analysis. Specifically, we first examine the relationship between a student’s post-GPA (GPA_Post; e.g., their own GPA in the second semester) and the average prior GPA of their roommates (RM_Avg; e.g., their roommate’s average GPA in the first semester) by calculating pairwise correlations for all consecutive semesters and dorm rooms. We find that dorm rooms tend to occupy the diagonal of the “GPA_Post – RM_Avg” plane (Fig.  3a ), suggesting that a student’s post-GPA is positively associated with the average prior GPA of their roommates. We then use an ordinary least squares (OLS) model to study the relationship between GPA_Post and RM_Avg (see “Methods” for the empirical specification) and summarize the regression results in Table  1 . We find that without controlling for the effects of other factors (see column (1) of Table  1 ), the average prior GPA of roommates has a significantly positive effect on a student’s post-GPA (regression coefficient b  = 0.365; P value < 0.001; Fig.  3b ).

figure 3

a The two-dimensional histogram shows the distributions of dorm rooms on the “GPA_Post – RM_Avg” plane. The y-axis shows the student’s post-GPA (GPA_Post), and the x-axis shows the average prior GPA of roommates (RM_Avg). It shows a positive correlation between GPA_Post and RM_Avg (Pearson’s \(r\)  = 0.244; P value < 0.001). b The regression plot for the relationship between GPA_Post and RM_Avg (center line) with the 95% confidence intervals (error bands), where the model includes no controls. c The plot for the relationship between GPA_Post and RM_Avg, where the model includes controls and fixed effects (see Table  1 for details). The “Low” and “High” on the x-axis represent 1 standard deviation (SD) below and above the mean (“Mid”) of RM_Avg, respectively. The horizontal dashed line marks the regression constant. d The plot for the moderating effects of peer heterogeneity. The relationship between GPA_Post and RM_Avg is moderated by the differences in roommate prior GPAs (RM_Diff). The “Low” and “High” in the legend represent 1 SD below and above the mean (“Mid”) of RM_Diff, respectively. The horizontal dashed line marks the regression constant.

Other factors may independently affect a student’s post-GPA and confound its association with the average prior GPA of their roommates. Therefore, we add controls and fixed effects into the OLS model (see “Methods”). The regression results shown in Table  1 convey several findings. First, a student’s prior GPA has the strongest effect on their post-GPA ( \(b\)  = 0.801, which is 16 times as large as \(b\)  = 0.050 for roommate average prior GPA; see columns (2) of Table  1 ), suggesting a significant path dependence on academic achievement. Second, the positive effect of roommate average prior GPA on a student’s post-GPA remains significant with controlling the student’s prior GPA, gender, cohort, major, and semester ( P value < 0.01; see column (2) of Table  1 and Fig.  3c ). Notably, female students perform better than male students on average (see Supplementary Information Section  4.4 for details). Third, the differences in roommate prior GPAs (RM_Diff) have no significant effect ( P value > 0.1; see columns (3) and (4) of Table  1 ), but it significantly moderates the relationship between roommate average prior GPA and post-GPA (see column (5) of Table  1 and Fig.  3d ) such that their positive relationship is more pronounced (slope b  = 0.055; 95% CI = [0.040, 0.070]) when RM_Diff is high (i.e., 1 SD above its mean) and less pronounced (slope b  = 0.028; 95% CI = [ \(-\) 0.001, 0.057]) when RM_Diff is low (i.e., 1 SD below its mean; see Supplementary Information Section  5.1 for detailed results of a simple slope test). The result also shows that high post-GPA is associated with large differences in the roommate’s prior GPA when the roommate’s average prior GPA is low (see the red line on the lower left of Fig.  3d ).

While the regression results suggest that roommate peer effects are significant, it is worth noting that the effect size appears to be modest. Specifically, a 100-point increase in roommate average prior GPA is associated with a 5-point increase in post-GPA ( \(b\)  = 0.050; see column (4) of Table  1 ). The effect is about 6% as large as the effect of a 100-point increase in prior GPA ( \(b\)  = 0.801), and it is about 10% of the average post-GPA. The magnitude is at a similar scale as reported by prior studies for various environments (e.g., dormitories and classrooms) and cultures (e.g., Western universities; see Supplementary Information Section  5.1 for details). To demonstrate its significance, we perform a falsification test by running the same OLS regression on the roommate null model, finding that the reported results are nontrivial (see Supplementary Information Section  5.3 for details). Together, these regression results suggest that a student’s performance is impacted not only by the average performance of roommates but also by their heterogeneity in academic performance.

The effects of in-dorm ordinal rank

Dorm rooms provide a highly interpersonal yet local environment, where competitive dynamics between roommates may affect their academic performance. Conditional on absolute academic performance, the ordinal rank of a student in their dorm room could have an independent effect on future achievement 80 , 81 . For instance, when a student’s ordinal rank is consistently low across all semesters, even if their absolute performance is high (e.g., the student has a GPA \(R\)  = 0.9 and their roommates all have \(R\)  > 0.9), they may still feel discouraged and less motivated, leading to fewer interactions with others and a potential decline in performance (see Supplementary Information Section  5.2 for explanations). This motivates us to study how a student’s in-dorm ordinal rank (OR_InDorm, with 1 being the highest and 4 being the lowest according to their prior performance; i.e., the number of better-achieving roommates including themself) affects their post-GPA. Specifically, we employ an OLS model that not only controls the student’s prior GPA, their roommate’s average prior GPA, and differences in prior GPAs, gender, and semester but also includes the fixed effects of cohort and major (see “Methods” for the empirical specification). We find that ordinal rank has a significantly positive effect on post-GPA ( P value < 0.05; see columns (1) and (2) of Table  2 and Fig.  4a ), suggesting that the number of better-achieving roommates in the dorm room predicts a student’s better academic performance in the future.

figure 4

a The plot for the relationship between a student’s GPA in the current semester (GPA_Post) and their ordinal rank according to GPA in the previous semester (OR_InDorm), where a larger rank value corresponds to a lower GPA. The OLS regression model includes controls and fixed effects (see Table  2 for details). The “Low” and “High” on the x-axis represent 1 standard deviation (SD) below and above the mean (“Mid”) of OR_InDorm, respectively. The horizontal dashed line marks the regression constant. b The plot for the moderating effects of peer heterogeneity. The relationship between GPA_Post and OR_InDorm is moderated by the differences in roommate GPAs in the previous semester (RM_Diff). The “Low” and “High” in the legend represent 1 SD below and above the mean (“Mid”) of RM_Diff, respectively. The horizontal dashed line marks the regression constant.

Through regression, we further examine whether the positive relationship between ordinal rank and post-GPA is moderated by other factors. We find that neither the interaction term of ordinal rank and own prior GPA nor the interaction term of ordinal rank and average roommate’s prior GPA is significant ( P value > 0.1; see columns (3) and (4) of Table  2 ). Yet, the interaction term of ordinal rank and differences in roommate prior GPA (RM_Diff) is significantly negative ( P value < 0.05; see columns (5) of Table  2 ). Specifically, the effect of ordinal rank on post-GPA is more pronounced (slope b  = 0.007; 95% CI = [0.002, 0.012]) when RM_Diff is low (Fig.  4b ), while the effect is not significant (slope b  =  \(-\) 0.000; 95% CI = [ \(-\) 0.007, 0.007]) when RM_Diff is high (see Supplementary Information Section  5.2 for detailed results of a simple slope test). The result also shows that high post-GPA is associated with large differences in roommate prior GPA when ordinal rank is low (see the red line on the lower left of Fig.  4b ). Although the effect size is modest, our falsification test on the roommate null model demonstrates that the results are nontrivial and significant (see Supplementary Information Section  5.3 for details). Taken together, these results suggest that roommate peer effects tend to disproportionately benefit underachieving students with homogeneous roommates (i.e., those who have similar performance) and high-achieving students with heterogeneous peers (i.e., those who have widely varied performance).

We quantified roommate peer effects on academic performance by applying both null-model and regression approaches to analyze a longitudinal dataset of student accommodation and academic performance, where roommate assignments are plausibly random upon enrollment and roommate relationships persist until graduation. We found evidence showing that roommates have a direct influence on a student’s performance, with some heterogeneity in the variation among the roommates and the baseline achievement of the student. Specifically, by constructing a roommate null model and calculating an assimilation metric, we showed that roommates have more similar performance than expected by chance alone. Moreover, the average assimilation of roommate academic performance exhibits an overall increasing trend over time, suggesting that peer effects become stronger as roommates live together longer, get more familiar with each other, and establish stronger interactions that facilitate knowledge spillovers 61 , 65 , 82 . More specifically, the increase in assimilation is more pronounced in the third semester (Fig.  2b and Supplementary Fig.  8 ), which is consistent with previous literature showing that peer effects are strong and persistent when friendships last over a year 79 , 83 , and it appears to be disrupted in the fifth semester, which may be because senior students have a higher chance of taking different elective courses and have more outside activities that might decrease the interactions between roommates 84 .

Our regression analysis further unpacks roommate peer effects, especially along the dimension of peer heterogeneity. We found that a student’s future performance is not only strongly predicted by their prior performance, suggesting a significant path dependence in academic development 85 , 86 , 87 , but also impacted by their roommates’ prior performance. Also, the positive relationship between a student’s future performance and the average prior performance of roommates is moderated by peer heterogeneity such that it is more pronounced when roommates are similar. In particular, when living with roommates who have, on average low prior performance, a student benefits more if roommates are more different, suggesting the positive role of peer heterogeneity 88 , 89 , 90 . Moreover, ordinal rank in the dorm room has an independent effect since the number of better-achieving roommates is positively associated with future performance. Yet, peer heterogeneity moderates this relationship such that it is significant only when roommates are more similar. The magnitudes of peer effects assessed using regression may appear modest, but they are significant and in line with the literature. Together, these results paint a rich picture of roommate peer effects and suggest that the effective strategy for improving a student’s performance may depend on their position in a high-dimensional space of ordinal rank, peer average performance, and peer heterogeneity.

While our work helps better understand roommate peer effects, the results should be interpreted in light of the limitations of the data and analysis. First, the longitudinal data were limited to two cohorts of Chinese undergraduates in one university. The extent to which these findings can be generalized to other student populations, universities, and countries should be further investigated where relevant data on student accommodation and academic outcomes are available. Second, the roommate assignments were plausibly random according to the administrative procedures. While providing some supporting evidence for this assumption (see Supplementary Information Section  1.2 for details), we lacked comprehensive data on student demographics, personal information, and pre-college academic performance to examine it directly. Third, the analysis relies on GPA percentiles normalized for each cohort and major, which allows for fair comparisons between disciplines but, at the same time, may lose more information in the data. A better normalization that preserves the distribution of GPAs, for example, would be an improvement. Fourth, factors outside of the dormitory environment may mediate the assimilation of roommates’ academic performance, such as orderliness, classroom interactions, social networks, behavior patterns, and common external factors 16 , 17 , 65 . Unraveling the mechanisms underlying roommate peer effects (e.g., peer pressure and student identity 91 ) was beyond the reach of this study but is desirable as future work.

In summary, we demonstrate the peer effect of college roommates and assess its magnitude by employing basic statistical methods to analyze new longitudinal data from a quasi-experiment. The university dorm room environment is ideal for identifying a group of frequently interacting and stable student peers whose learning outcomes can be easily tracked over time. The null model we use, which is essentially permutation tests 75 , 76 , does not assume linear relationships between variables and is flexible enough to be applied to study peer effects in other complex social systems. Also, effect sizes assessed by the null model can facilitate comparisons between different datasets. Moreover, the regression model allows us to address concerns about inverse causality and better understand peer effects. Particularly, the regression findings have potential policy implications for education and dormitory management. For example, by adjusting the composition of roommates, such as reducing peer heterogeneity for students with, on average, high-achieving roommates, dorm rooms may be engineered, to some extent, to enhance the positive influence of roommates in improving students’ academic performance. Furthermore, our findings suggest the benefits of exposure to student role models and learning from peers in everyday life in addition to teachers in classrooms only.

Chinese universities provide on-campus dormitories for almost all undergraduates, allowing us to observe a large-scale longitudinal sample of student roommates and relate it to their academic performance. From a public university in China, we collected the accommodation and academic performance data of 5,272 undergraduates, who lived in identical 4-person dorm rooms in the same or nearby dorm building on campus. Different from a dorm suite that contains four separate bedrooms, a 4-person dorm room is a single bedroom with four beds, where each student occupies one bed and shares public areas with roommates (see Supplementary Fig.  1 for an example layout). Per the university’s student accommodation management regulations, newly admitted students were assigned to dorm rooms under the condition that those in the same administrative unit, major, or school live together as much as possible and there is no gender mix in dorm rooms or buildings. The process neither allowed students to choose roommates or rooms nor took into account their academic performance before admission, socioeconomic backgrounds, or personal preferences. Students were informed of their accommodation only when they moved in before the first semester. As a quasi-experiment, the administrative procedure resulted in a plausibly, if not perfect, random assignment of roommates concerning their prior academic performance and personal information. Moreover, there was no significant individual selection later in the semesters. Once assigned together, roommates lived together until their graduation. Moving out or changing roommates was very rare on a few occasions (see Supplementary Information Section  1.2 for more details).

The dataset covers two cohorts of Chinese undergraduates who were admitted by the university in 2011 and 2012, respectively. For each student, we solicited information about their cohort, gender, major, and dorm room, based on which we determined roommate relationships. As a measure of academic performance, we collected the GPA data of these students for the first five successive semesters up to 2014 and further normalized it for each semester to a GPA percentile for students in the same cohort and major (see Supplementary Information Section  1.2 for details). The stable roommate relationship and the longitudinal academic performance data allowed us to study how a student is affected by roommates over time. All students were anonymized in the data collection and analysis process, and the dataset contains no identifiable information. This study was approved by the Institutional Review Board (IRB) at the University of Electronic Science and Technology of China (IRB No. 1061420210802005).

Statistical hypothesis test

Given a tier of classification for students’ GPA, following permutation tests 74 , 75 , 76 , we perform a statistical test to examine whether the relative ratio \({\mathbb{E}}\) of each combination (e.g., 1111) in the actual data deviates significantly from its theoretical value 0. Specifically, we generate a roommate null model by implementing the random shuffling process and calculate the null-model relative ratio for each combination: \(\widetilde{{\mathbb{E}}}=\left({P}_{n}-{P}_{t}\right)/{P}_{t}\) , where \({P}_{n}\) and \({P}_{t}\) is the null-model and theoretical frequency of the combination, respectively. By null-model construction, \({P}_{n}\) should approach \({P}_{t}\) , and thus \(\widetilde{{\mathbb{E}}}\) should be close to 0. For each combination, we compare the actual \({\mathbb{E}}\) with its null-model \(\widetilde{{\mathbb{E}}}\) . If \({\mathbb{E}}\) is significantly above 0, the probability of observing \({\mathbb{E}}\le \widetilde{{\mathbb{E}}}\) in the actual data should be sufficiently small, e.g., less than 0.001. Accordingly, our null hypothesis (H0) is \({\mathbb{E}}\le \widetilde{{\mathbb{E}}}\) , and the alternative hypothesis (H1) is \({\mathbb{E}} \, > \, \widetilde{{\mathbb{E}}}\) . To empirically test H0, we generate 1000 roommate null models (where each null model is an independent implementation of the random shuffling process) and calculate \(\widetilde{{\mathbb{E}}}\) under 2-tier, 3-tier, and 4-tier classifications, respectively. We find that \({\mathbb{E}}\) of some combinations is larger than \(\widetilde{{\mathbb{E}}}\) for all 1000 roommate null models, allowing us to reject H0 and support H1 (i.e., \({\mathbb{E}}\) is significantly larger than 0 with a P value < 0.001 in the one-sided statistical test; the combination is over-represented in the actual data). Similarly, we test whether \({\mathbb{E}}\) of a combination is significantly below 0. Under the 2-tier classification, for example, combinations with significantly positive \({\mathbb{E}}\) include 1111 and 2222 ( P value < 0.001) and those with significantly negative \({\mathbb{E}}\) include 1112 and 1122 ( P value < 0.001) as well as 1222 ( P value < 0.05; see Supplementary Table  2 for the statistical testing results for each combination under these tier classifications). Overall, we find that significantly positive combinations have the same or nearby tier numbers and significantly negative ones have distant tier numbers.

To perform a single statistical test for all combinations together given a tier of classification, we calculate the total relative ratio \(\sum \left|{\mathbb{E}}\right|\) and \(\sum \left|\widetilde{{\mathbb{E}}}\right|\) by summing up the absolute \({\mathbb{E}}\) and \(\widetilde{{\mathbb{E}}}\) of each combination, respectively. As \(\widetilde{{\mathbb{E}}}\) is close to 0, \(\sum \left|\widetilde{{\mathbb{E}}}\right|\) should also be close to 0. If we assume \(\sum \left|{\mathbb{E}}\right|\le \sum \left|\widetilde{{\mathbb{E}}}\right|\) , it is naturally that \(\sum \left|{\mathbb{E}}\right|\) is close to 0, yielding \({\mathbb{E}}\) to be close to 0. There, \({\mathbb{E}}\) and \(\widetilde{{\mathbb{E}}}\) wouldn’t have a significant difference because they are both close to 0. Thereby, to say \({\mathbb{E}}\) is significantly different from \(\widetilde{{\mathbb{E}}}\) , the probability of observing \(\sum \left|{\mathbb{E}}\right|\le \sum \left|\widetilde{{\mathbb{E}}}\right|\) should be sufficiently small, e.g., less than 0.001. Accordingly, our null hypothesis (H0) is \(\sum \left|{\mathbb{E}}\right|\le \sum \left|\widetilde{{\mathbb{E}}}\right|\) , and the alternative hypothesis (H1) is \(\sum \left|{\mathbb{E}}\right| > \sum \left|\widetilde{{\mathbb{E}}}\right|\) . We find that, under 2-tier, 3-tier, and 4-tier classifications, \(\sum \left|{\mathbb{E}}\right|\) is always larger than \(\sum \left|\widetilde{{\mathbb{E}}}\right|\) for all 1000 roommate null models, allowing us to reject H0 and support H1 with a P value < 0.001 (i.e., the overall \({\mathbb{E}}\) of all combinations is different from 0). Taken together, our hypothesis testing results suggest that \({\mathbb{E}}\) of some combinations in the actual data deviate significantly from 0, where those with nearby tier numbers are more likely to be observed and those with distant tier numbers are less likely to be observed than random chance, suggesting significant roommate peer effects (see Supplementary Information Section  3.2 for details).

Regression model

We employ an ordinary least squares (OLS) model to study the relationship between a student’s future performance (GPA_Post) and the average prior performance of their roommate (RM_Avg) and how this relationship is moderated by the differences in roommate prior performance (RM_Diff). The OLS model includes several controls on student demographics and prior performance. Specifically, the empirical specification is given by

where \({\epsilon }_{i}\) is the error term for student i , and the semester index s ranges from 1 to 4. The dependent variable \({G}_{i}^{s+1}\) is the student’s GPA in semester s  + 1 (GPA_Post), and the independent variable of interest \({G}_{i}^{s}\) is the student’s GPA in semester s (GPA_Prior). The variable \({{RA}}_{i}^{s}\) is the roommate average GPA in semester s (RM_Avg), \({{RD}}_{i}^{s}\) is the differences in roommate GPAs in semester s (RM_Diff), and \({{RA}}_{i}^{s}\times {{RD}}_{i}^{s}\) is their interaction term. The variable \({D}^{{Ge}}\) is a gender dummy, which is coded as 1 and 0 for females and males, respectively. The variables \({D}^{{Ma}}\) , \({D}^{{Co}}\) , and \({D}^{{Se}}\) are major, cohort, and semester dummies, respectively (see Supplementary Table  3 for details).

Moreover, we employ an OLS model to study the relationship between a student’s in-dorm ordinal rank (OR_InDorm) according to prior performance and their future performance after controlling their prior performance, the average and differences in roommate prior performance, their gender, major, cohort, and semester. Meanwhile, we examine how this relationship is moderated by other factors, including peer heterogeneity. Specifically, the empirical specification is given by

where \({{OR}}_{i}^{s}\) is the OR_InDorm of student \(i\) in semester \(s\) (ranging from 1 to 4) and \({\epsilon }_{i}\) is the error term. The interaction terms are \({{OR}}_{i}^{s}\times {G}_{i}^{s}\) between OR_InDorm and GPA_Prior, \({{OR}}_{i}^{s}\times {{RA}}_{i}^{s}\) between OR_InDorm and RM_Avg, and \({{OR}}_{i}^{s}\times {{RD}}_{i}^{s}\) between OR_InDorm and RM_Diff for student \(i\) in semester \(s\) . All other controls are the same as above (see Supplementary Information Section  5 for details on these variables and Supplementary Table  3 for summary statistics).

Reporting summary

Further information on research design is available in the  Nature Portfolio Reporting Summary linked to this article.

Data availability

All data necessary to replicate the statistical analyses and main figures are available in Supplementary Information and have been deposited in the open-access repository Figshare ( https://doi.org/10.6084/m9.figshare.25286017 ) 92 . The raw data of anonymized student accommodation and academic performance are protected by a data use agreement. Those who are interested in the raw data may contact the corresponding authors for access after obtaining Institutional Review Board (IRB) approval.

Code availability

All code necessary to replicate the statistical analyses and main figures has been deposited in the open-access repository Figshare ( https://doi.org/10.6084/m9.figshare.25286017 ) 92 .

Lewis, K., Gonzalez, M. & Kaufman, J. Social selection and peer influence in an online social network. Proc. Natl Acad. Sci. USA 109 , 68–72 (2012).

Article   ADS   CAS   PubMed   Google Scholar  

Aral, S., Muchnik, L. & Sundararajan, A. Distinguishing influence-based contagion from homophily-driven diffusion in dynamic networks. Proc. Natl Acad. Sci. USA 106 , 21544–21549 (2009).

Article   ADS   CAS   PubMed   PubMed Central   Google Scholar  

Centola, D. The spread of behavior in an online social network experiment. Science 329 , 1194–1197 (2010).

Muchnik, L., Aral, S. & Taylor, S. J. Social influence bias: a randomized experiment. Science 341 , 647–651 (2013).

Wolske, K. S., Gillingham, K. T. & Schultz, P. Peer influence on household energy behaviours. Nat. Energy 5 , 202–212 (2020).

Article   ADS   Google Scholar  

Falk, A. & Ichino, A. Clean evidence on peer effects. J. Labor Econ. 24 , 39–57 (2006).

Article   Google Scholar  

Banerjee, A., Chandrasekhar, A. G., Duflo, E. & Jackson, M. O. The diffusion of microfinance. Science 341 , 1236498 (2013).

Article   PubMed   Google Scholar  

Contractor, N. S. & DeChurch, L. A. Integrating social networks and human social motives to achieve social influence at scale. Proc. Natl Acad. Sci. USA 111 , 13650–13657 (2014).

Aral, S. & Nicolaides, C. Exercise contagion in a global social network. Nat. Commun. 8 , 14753 (2017).

Quispe-Torreblanca, E. G. & Stewart, N. Causal peer effects in police misconduct. Nat. Hum. Behav. 3 , 797–807 (2019).

Bramoull. Peer effects in networks: A survey. Annual Review of Economics 12 , 603–629 (2020).

Zimmerman, D. J. Peer effects in academic outcomes: evidence from a natural experiment. Rev. Econ. Stat. 85 , 9–23 (2003).

Imberman, S. A., Kugler, A. D. & Sacerdote, B. I. Katrina’s children: evidence on the structure of peer effects from hurricane evacuees. Am. Economic Rev. 102 , 2048–2082 (2012).

Feld, J. & Zlitz, U. Understanding peer effects: on the nature, estimation, and channels of peer effects. J. Labor Econ. 35 , 387–428 (2017).

Golsteyn, B. H. H., Non, A. & Zlitz, U. The impact of peer personality on academic achievement. J. Political Econ. 129 , 1052–1099 (2021).

Cao, Y. et al. Orderliness predicts academic performance: behavioural analysis on campus lifestyle. J. R. Soc. Interface 15 , 20180210 (2018).

Article   PubMed   PubMed Central   Google Scholar  

Yao, H., Lian, D., Cao, Y., Wu, Y. & Zhou, T. Predicting academic performance for college students: a campus behavior perspective. ACM Trans. Intell. Syst. Technol. 10 , 24 (2019).

Sacerdote, B. Peer effects in education: how might they work, how big are they and how much do we know thus far? Handb. Econ. Educ. 3 , 249–277 (2011).

Lewbel, A., Qu, X. & Tang, X. Social networks with unobserved links. J. Political Econ. 131 , 898–946 (2023).

Ha, W. Quasi-experimental evidence of academic peer effects at an Elite University in People’s Republic of China. Asia Pac. Educ. Rev. 17 , 703–718 (2016).

Ma, L. & Huang, Y. Roommate effects on students’ performance in higher education. Peking. Univ. Educ. Rev. 19 , 41–63 (2021).

Google Scholar  

Gao, J., Zhang, Y. C. & Zhou, T. Computational socioeconomics. Phys. Rep. 817 , 1–104 (2019).

Article   ADS   MathSciNet   Google Scholar  

Hoxby, C. M. Peer effects in the classroom: learning from gender and race variation. National Bureau of Economic Research. NBER Working Paper No. w7867 https://doi.org/10.3386/w7867 (2000).

Carman, K. G. & Zhang, L. Classroom peer effects and academic achievement: evidence from a Chinese middle school. China Economic Rev. 23 , 223–237 (2012).

Lavy, V., Paserman, M. D. & Schlosser, A. Inside the black box of ability peer effects: evidence from variation in the proportion of low achievers in the classroom. Economic J. 122 , 208–237 (2012).

Burke, M. A. & Sass, T. R. Classroom peer effects and student achievement. J. Labor Econ. 31 , 51–82 (2013).

Carrell, S. E., Fullerton, R. L. & West, J. E. Does your cohort matter? measuring peer effects in college achievement. J. Labor Econ. 27 , 439–464 (2009).

Lavy, V. & Schlosser, A. Mechanisms and impacts of gender peer effects at school. Am. Economic J.: Appl. Econ. 3 , 1–33 (2011).

Padilla-Walker, L. M. & Bean, R. A. Negative and positive peer influence: relations to positive and negative behaviors for African American, European American, and Hispanic adolescents. J. Adolescence 32 , 323–337 (2009).

Brady, R. R., Insler, M. A. & Rahman, A. S. Bad company: understanding negative peer effects in college achievement. Eur. Economic Rev. 98 , 144–168 (2017).

Eckles, D., Kizilcec, R. F. & Bakshy, E. Estimating peer effects in networks with peer encouragement designs. Proc. Natl Acad. Sci. USA 113 , 7316–7322 (2016).

Booij, A. S., Leuven, E. & Oosterbeek, H. Ability peer effects in university: evidence from a randomized experiment. Rev. Economic Stud. 84 , 547–578 (2017).

Christakis, N. A. & Fowler, J. H. The collective dynamics of smoking in a large social network. N. Engl. J. Med. 358 , 2249–2258 (2008).

Article   CAS   PubMed   PubMed Central   Google Scholar  

Sotoudeh, R., Harris, K. M. & Conley, D. Effects of the peer metagenomic environment on smoking behavior. Proc. Natl Acad. Sci. USA 116 , 16302–16307 (2019).

Kawaguchi, D. Peer effects on substance use among American teenagers. J. Popul. Econ. 17 , 351–367 (2004).

Duncan, G. J., Boisjoly, J., Kremer, M., Levy, D. M. & Eccles, J. Peer effects in drug use and sex among college students. J. Abnorm. Child Psychol. 33 , 375–385 (2005).

Borsari, B. & Carey, K. B. Peer influences on college drinking: a review of the research. J. Subst. Abus. 13 , 391–424 (2001).

Article   CAS   Google Scholar  

Kremer, M. & Levy, D. Peer effects and alcohol use among college students. J. Economic Perspect. 22 , 189–206 (2008).

Han, Y., Grogan-Kaylor, A., Delva, J. & Xie, Y. Estimating the heterogeneous relationship between peer drinking and youth alcohol consumption in Chile using propensity score stratification. Int. J. Environ. Res. Public Health 11 , 11879–11897 (2014).

Strother, L., Piston, S., Golberstein, E., Gollust, S. E. & Eisenberg, D. College roommates have a modest but significant influence on each other’s political ideology. Proc. Natl Acad. Sci. USA 118 , e2015514117 (2021).

Article   CAS   PubMed   Google Scholar  

Xie, Y., Fang, M. & Shauman, K. STEM education. Annu. Rev. Sociol. 41 , 331–357 (2015).

Dennehy, T. C. & Dasgupta, N. Female peer mentors early in college increase women’s positive academic experiences and retention in engineering. Proc. Natl Acad. Sci. USA 114 , 5964–5969 (2017).

Wu, D. J., Thiem, K. C. & Dasgupta, N. Female peer mentors early in college have lasting positive impacts on female engineering students that persist beyond graduation. Nat. Commun. 13 , 6837 (2022).

Bostwick, V. K. & Weinberg, B. A. Nevertheless she persisted? gender peer effects in doctoral STEM programs. J. Labor Econ. 40 , 397–436 (2022).

Thiemann, P. The persistent effects of short-term peer groups on performance: evidence from a natural experiment in higher education. Manag. Sci. 68 , 1131–1148 (2022).

Jones, T. R. & Kofoed, M. S. Do peers influence occupational preferences? evidence from randomly-assigned peer groups at West Point. J. Public Econ. 184 , 104154 (2020).

Herbst, D. & Mas, A. Peer effects on worker output in the laboratory generalize to the field. Science 350 , 545–549 (2015).

Anelli, M. & Peri, G. The effects of high school peers’ gender on college major, college performance and income. Economic J. 129 , 553–602 (2019).

Hasan, S. & Koning, R. Prior ties and the limits of peer effects on startup team performance. Strategic Manag. J. 40 , 1394–1416 (2019).

Chetty, R. et al. How does your kindergarten classroom affect your earnings? evidence from Project STAR. Q. J. Econ. 126 , 1593–1660 (2011).

Cornelissen, T., Dustmann, C. & Schnberg, U. Peer effects in the workplace. Am. Economic Rev. 107 , 425–456 (2017).

Carrell, S. E., Hoekstra, M. & Kuka, E. The long-run effects of disruptive peers. Am. Economic Rev. 108 , 3377–3415 (2018).

Cheng, S., Brand, J. E., Zhou, X., Xie, Y. & Hout, M. Heterogeneous returns to college over the life course. Sci. Adv. 7 , eabg7641 (2021).

Article   ADS   PubMed   PubMed Central   Google Scholar  

DeLay, D. et al. Peer influence on academic performance: a social network analysis of social-emotional intervention effects. Prev. Sci. 17 , 903–913 (2016).

Article   ADS   PubMed   Google Scholar  

Li, Z. A., Wang, G. & Wang, H. Peer effects in competitive environments: field experiments on information provision and interventions. Manag. Inf. Syst. Q. 45 , 163–191 (2021).

Kiessling, L., Radbruch, J. & Schaube, S. Self-selection of peers and performance. Manag. Sci. 68 , 8184–8201 (2022).

Currarini, S., Jackson, M. O. & Pin, P. Identifying the roles of race-based choice and chance in high school friendship network formation. Proc. Natl Acad. Sci. USA 107 , 4857–4861 (2010).

Mercken, L., Steglich, C., Sinclair, P., Holliday, J. & Moore, L. A longitudinal social network analysis of peer influence, peer selection, and smoking behavior among adolescents in British schools. Health Psychol. 31 , 450 (2012).

Jackson, M. O., Nei, S. M., Snowberg, E. & Yariv, L. The dynamics of networks and homophily. National Bureau of Economic Research, NBER Working Paper No. w30815 https://doi.org/10.3386/w30815 (2023).

Sacerdote, B. Peer effects with random assignment: results for Dartmouth roommates. Q. J. Econ. 116 , 681–704 (2001).

Zhang, L. & Pu, S. It takes two shining lights to brighten the room: peer effects with random roommate assignments. Educ. Econ. 25 , 3–21 (2017).

Chen, Y. & Snmez, T. Improving efficiency of on-campus housing: an experimental study. Am. Economic Rev. 92 , 1669–1686 (2002).

Pu, S., Yan, Y. & Zhang, L. Peers, study effort, and academic performance in college education: evidence from randomly assigned roommates in a flipped classroom. Res. High. Educ. 61 , 248–269 (2020).

Eckles, D. & Bakshy, E. Bias and high-dimensional adjustment in observational studies of peer effects. J. Am. Stat. Assoc. 116 , 507–517 (2021).

Article   MathSciNet   CAS   Google Scholar  

Stadtfeld, C., Vrs, A., Elmer, T., Boda, Z. & Raabe, I. J. Integration in emerging social networks explains academic failure and success. Proc. Natl Acad. Sci. USA 116 , 792–797 (2019).

Whitmore, D. Resource and peer impacts on girls’ academic achievement: evidence from a randomized experiment. Am. Economic Rev. 95 , 199–203 (2005).

Duflo, E., Dupas, P. & Kremer, M. Peer effects, teacher incentives, and the impact of tracking: evidence from a randomized evaluation in Kenya. Am. Economic Rev. 101 , 1739–1774 (2011).

Lomi, A., Snijders, T. A., Steglich, C. E. & Torlo, V. J. Why are some more peer than others? evidence from a longitudinal study of social networks and individual academic performance. Soc. Sci. Res. 40 , 1506–1520 (2011).

Sacerdote, B. Experimental and quasi-experimental analysis of peer effects: two steps forward? Annu. Rev. Econ. 6 , 253–272 (2014).

Article   MathSciNet   Google Scholar  

Raudenbush, S. W. & Schwartz, D. Randomized experiments in education, with implications for multilevel causal inference. Annu. Rev. Stat. Its Application 7 , 177–208 (2020).

Mucha, P. J., Richardson, T., Macon, K., Porter, M. A. & Onnela, J.-P. Community structure in time-dependent, multiscale, and multiplex networks. Science 328 , 876–878 (2010).

Article   ADS   MathSciNet   CAS   PubMed   Google Scholar  

Cimini, G. et al. The statistical physics of real-world networks. Nat. Rev. Phys. 1 , 58–71 (2019).

Váša, F. & Mišić, B. Null models in network neuroscience. Nat. Rev. Neurosci. 23 , 493–504 (2022).

Krackhardt, D. Predicting with networks: nonparametric multiple regression analysis of dyadic data. Soc. Netw. 10 , 359–381 (1988).

Hubert, L. & Schultz, J. Quadratic assignment as a general data analysis strategy. Br. J. Math. Stat. Psychol. 29 , 190–241 (1976).

Raudenbush, S. W. & Bryk, A. S. Hierarchical Linear Models: Applications and Data Analysis Methods . Vol. 1 (Sage Publications, 2002).

Boda, Z., Elmer, T., Vörös, A. & Stadtfeld, C. Short-term and long-term effects of a social network intervention on friendships among university students. Sci. Rep. 10 , 2889 (2020).

Angrist, J. D. The perils of peer effects. Labour Econ. 30 , 98–108 (2014).

Patacchini, E., Rainone, E. & Zenou, Y. Heterogeneous peer effects in education. J. Economic Behav. Organ. 134 , 190–227 (2017).

Murphy, R. & Weinhardt, F. Top of the class: the importance of ordinal rank. Rev. Economic Stud. 87 , 2777–2826 (2020).

Bertoni, M. & Nisticò, R. Ordinal rank and the structure of ability peer effects. J. Public Econ . 217 , 104797 (2023).

Webb, N. M. Student interaction and learning in small groups. Rev. Educ. Res. 52 , 421–445 (1982).

Foster, G. It’s not your peers, and it’s not your friends: some progress toward understanding the educational peer effect mechanism. J. Public Econ. 90 , 1455–1475 (2006).

Deslauriers, L., McCarty, L. S., Miller, K., Callaghan, K. & Kestin, G. Measuring actual learning versus feeling of learning in response to being actively engaged in the classroom. Proc. Natl Acad. Sci. USA 116 , 19251–19257 (2019).

Erikson, R., Goldthorpe, J. H., Jackson, M., Yaish, M. & Cox, D. R. On class differentials in educational attainment. Proc. Natl Acad. Sci. USA 102 , 9730–9733 (2005).

Petersen, A. M., Jung, W.-S., Yang, J.-S. & Stanley, H. E. Quantitative and empirical demonstration of the Matthew effect in a study of career longevity. Proc. Natl Acad. Sci. USA 108 , 18–23 (2011).

Miao, L. et al. The latent structure of global scientific development. Nat. Hum. Behav. 6 , 1206–1217 (2022).

Hamilton, B. H., Nickerson, J. A. & Owan, H. Team incentives and worker heterogeneity: an empirical analysis of the impact of teams on productivity and participation. J. Political Econ. 111 , 465–497 (2003).

Lyle, D. S. The effects of peer group heterogeneity on the production of human capital at West Point. Am. Economic J.: Appl. Econ. 1 , 69–84 (2009).

Chan, T. Y., Li, J. & Pierce, L. Compensation and peer effects in competing sales teams. Manag. Sci. 60 , 1965–1984 (2014).

Akerlof, G. A. & Kranton, R. E. Identity and schooling: some lessons for the economics of education. J. Economic Lit. 40 , 1167–1201 (2002).

Cao, Y., Zhou, T. & Gao, J. Heterogeneous peer effects of college roommates on academic performance. Figshare. https://doi.org/10.6084/m9.figshare.25286017 (2024).

Download references

Acknowledgements

The authors thank Min Nie, Shimin Cai, Defu Lian, Zhihai Rong, Huaxiu Yao, Yifan Wu, Lili Miao, and Linyan Zhang for their valuable discussions. This work was partially supported by the National Natural Science Foundation of China Grant Nos. 42361144718 and 11975071 (T.Z.) and the Ministry of Education of Humanities and Social Science Project Grant No. 21JZD055 (T.Z.).

Author information

Authors and affiliations.

CompleX Lab, University of Electronic Science and Technology of China, Chengdu, China

Yi Cao & Tao Zhou

Big Data Research Center, University of Electronic Science and Technology of China, Chengdu, China

Center for Science of Science and Innovation, Northwestern University, Evanston, IL, USA

Kellogg School of Management, Northwestern University, Evanston, IL, USA

Northwestern Institute on Complex Systems, Northwestern University, Evanston, IL, USA

Faculty of Social Sciences, The University of Hong Kong, Hong Kong SAR, China

You can also search for this author in PubMed   Google Scholar

Contributions

T.Z. and J.G. designed research; T.Z. collected data; Y.C. and J.G. performed research; Y.C., T.Z., and J.G. analyzed data; J.G. wrote the paper; Y.C. and T.Z. revised the paper.

Corresponding authors

Correspondence to Tao Zhou or Jian Gao .

Ethics declarations

Competing interests.

The authors declare no competing interests.

Peer review

Peer review information.

Nature Communications thanks the anonymous, reviewer(s) for their contribution to the peer review of this work. A peer review file is available.

Additional information

Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Supplementary information

Supplementary information, peer review file, rights and permissions.

Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article’s Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/ .

Reprints and permissions

About this article

Cite this article.

Cao, Y., Zhou, T. & Gao, J. Heterogeneous peer effects of college roommates on academic performance. Nat Commun 15 , 4785 (2024). https://doi.org/10.1038/s41467-024-49228-7

Download citation

Received : 13 September 2023

Accepted : 24 May 2024

Published : 06 June 2024

DOI : https://doi.org/10.1038/s41467-024-49228-7

Share this article

Anyone you share the following link with will be able to read this content:

Sorry, a shareable link is not currently available for this article.

Provided by the Springer Nature SharedIt content-sharing initiative

By submitting a comment you agree to abide by our Terms and Community Guidelines . If you find something abusive or that does not comply with our terms or guidelines please flag it as inappropriate.

Quick links

  • Explore articles by subject
  • Guide to authors
  • Editorial policies

Sign up for the Nature Briefing newsletter — what matters in science, free to your inbox daily.

regression line null and alternative hypothesis

IMAGES

  1. Simple Linier Regression

    regression line null and alternative hypothesis

  2. 3.3 Regression uncertainty

    regression line null and alternative hypothesis

  3. Comparing two means

    regression line null and alternative hypothesis

  4. Null Hypothesis and Alternative Hypothesis

    regression line null and alternative hypothesis

  5. Hypothesis Testing

    regression line null and alternative hypothesis

  6. Research Hypothesis Generator

    regression line null and alternative hypothesis

VIDEO

  1. Hypothesis Testing: the null and alternative hypotheses

  2. Null Hypothesis vs Alternate Hypothesis

  3. Null Hypothesis vs Alternate Hypothesis

  4. Statistics and probability

  5. Module8: Hypothesis Testing Sigma Unknown

  6. Statistics and probability- Hypothesis testing of coefficients in multiple Linear regression

COMMENTS

  1. Understanding the Null Hypothesis for Linear Regression

    x: The value of the predictor variable. Simple linear regression uses the following null and alternative hypotheses: H0: β1 = 0. HA: β1 ≠ 0. The null hypothesis states that the coefficient β1 is equal to zero. In other words, there is no statistically significant relationship between the predictor variable, x, and the response variable, y.

  2. 12.2.1: Hypothesis Test for Linear Regression

    The null hypothesis of a two-tailed test states that there is not a linear relationship between \(x\) and \(y\). The alternative hypothesis of a two-tailed test states that there is a significant linear relationship between \(x\) and \(y\). Either a t-test or an F-test may be used to see if the slope is significantly different from zero.

  3. PDF Chapter 9 Simple Linear Regression

    218 CHAPTER 9. SIMPLE LINEAR REGRESSION 9.2 Statistical hypotheses For simple linear regression, the chief null hypothesis is H 0: β 1 = 0, and the corresponding alternative hypothesis is H 1: β 1 6= 0. If this null hypothesis is true, then, from E(Y) = β 0 + β 1x we can see that the population mean of Y is β 0 for

  4. Comparing Regression Lines with Hypothesis Tests

    Hypothesis Tests for Comparing Regression Constants. When the constant (y intercept) differs between regression equations, the regression lines are shifted up or down on the y-axis. The scatterplot below shows how the output for Condition B is consistently higher than Condition A for any given Input. These two models have different constants.

  5. 13.6 Testing the Regression Coefficients

    Because p-value[latex]=0.0060 \lt 0.05=\alpha[/latex], we reject the null hypothesis in favour of the alternative hypothesis. At the 5% significance level there is enough evidence to suggest that there is a relationship between the dependent variable "job satisfaction" and the independent variable "income."

  6. 6.4

    For the multiple linear regression model, there are three different hypothesis tests for slopes that one could conduct. They are: Hypothesis test for testing that all of the slope parameters are 0. Hypothesis test for testing that a subset — more than one, but not all — of the slope parameters are 0.

  7. 5.2

    5.2 - Writing Hypotheses. The first step in conducting a hypothesis test is to write the hypothesis statements that are going to be tested. For each test you will have a null hypothesis ( H 0) and an alternative hypothesis ( H a ). Null Hypothesis. The statement that there is not a difference in the population (s), denoted as H 0.

  8. Null & Alternative Hypotheses

    The null hypothesis (H 0) answers "No, there's no effect in the population." The alternative hypothesis (H a) answers "Yes, there is an effect in the population." The null and alternative are always claims about the population. That's because the goal of hypothesis testing is to make inferences about a population based on a sample.

  9. Using a P-value to make conclusions in a test about slope

    So the regression line might look something like that, where the equation of the regression line for the population, y hat would be Alpha plus Beta times, times x. And so our null hypothesis is that Beta's equal to zero, and the alternative hypothesis, which is her suspicion, is that the true slope of the regression line is actually greater ...

  10. Introduction to inference about slope in linear regression

    Therefore, the confidence interval is b2 +/- t × SE (b). *b) Hypothesis Testing:*. The null hypothesis is that the slope of the population regression line is 0. that is Ho : B =0. So, anything other than that will be the alternate hypothesis and thus, Ha : B≠0. This is the stuff covered in the video and I hope it helps!

  11. How to Test the Significance of a Regression Slope

    Step 1. State the hypotheses. The null hypothesis (H0): B1 = 0. The alternative hypothesis: (Ha): B1 ≠ 0. Step 2. Determine a significance level to use. Since we constructed a 95% confidence interval in the previous example, we will use the equivalent approach here and choose to use a .05 level of significance. Step 3.

  12. 15.5: Hypothesis Tests for Regression Models

    Once again, we can reuse a hypothesis test that we discussed earlier, this time the t-test. The test that we're interested has a null hypothesis that the true regression coefficient is zero (b=0), which is to be tested against the alternative hypothesis that it isn't (b≠0). That is: H 0: b=0. H 1: b≠0.

  13. 3.6

    It is unlikely that we would have obtained such a large F* statistic if the null hypothesis were true. Therefore, we reject the null hypothesis H 0: β 1 = 0 in favor of the alternative hypothesis H A: β 1 ≠ 0. There is sufficient evidence at the α = 0.05 level to conclude that there is a linear relationship between year and winning time.

  14. Hypothesis Test for Regression Slope

    Hypothesis Test for Regression Slope. This lesson describes how to conduct a hypothesis test to determine whether there is a significant linear relationship between an independent variable X and a dependent variable Y.. The test focuses on the slope of the regression line Y = Β 0 + Β 1 X. where Β 0 is a constant, Β 1 is the slope (also called the regression coefficient), X is the value of ...

  15. 3.3.4: Hypothesis Test for Simple Linear Regression

    In simple linear regression, this is equivalent to saying "Are X an Y correlated?". In reviewing the model, Y = β0 +β1X + ε Y = β 0 + β 1 X + ε, as long as the slope ( β1 β 1) has any non‐zero value, X X will add value in helping predict the expected value of Y Y. However, if there is no correlation between X and Y, the value of ...

  16. 9.1 Null and Alternative Hypotheses

    The actual test begins by considering two hypotheses.They are called the null hypothesis and the alternative hypothesis.These hypotheses contain opposing viewpoints. H 0, the —null hypothesis: a statement of no difference between sample means or proportions or no difference between a sample mean or proportion and a population mean or proportion. In other words, the difference equals 0.

  17. Understanding the Null Hypothesis for Linear Regression

    Multiple linear regression uses the following null and alternative hypotheses: H 0: β 1 = β 2 = … = β k = 0; H A: β 1 = β 2 = … = β k ≠ 0; The null hypothesis states that all coefficients in the model are equal to zero. In other words, none of the predictor variables have a statistically significant relationship with the response ...

  18. Simple Linear Regression

    Regression allows you to estimate how a dependent variable changes as the independent variable (s) change. Simple linear regression example. You are a social researcher interested in the relationship between income and happiness. You survey 500 people whose incomes range from 15k to 75k and ask them to rank their happiness on a scale from 1 to ...

  19. Linear regression hypothesis testing: Concepts, Examples

    Here are key steps of doing hypothesis tests with linear regression models: Formulate null and alternate hypotheses: The first step of hypothesis testing is to formulate the null and alternate hypotheses. The null hypothesis (H0) is a statement that represents the state of the real world where the truth about something needs to be justified.

  20. 11.1: Testing the Hypothesis that β = 0

    Because \(r\) is significant and the scatter plot shows a linear trend, the regression line can be used to predict final exam scores. METHOD 2: Using a table of Critical Values to make a decision The 95% Critical Values of the Sample Correlation Coefficient Table can be used to give you a good idea of whether the computed value of \(r\) is ...

  21. 10.2: Null and Alternative Hypotheses

    The actual test begins by considering two hypotheses.They are called the null hypothesis and the alternative hypothesis.These hypotheses contain opposing viewpoints. \(H_0\): The null hypothesis: It is a statement of no difference between the variables—they are not related. This can often be considered the status quo and as a result if you cannot accept the null it requires some action.

  22. 9.1: Null and Alternative Hypotheses

    The actual test begins by considering two hypotheses.They are called the null hypothesis and the alternative hypothesis.These hypotheses contain opposing viewpoints. \(H_0\): The null hypothesis: It is a statement of no difference between the variables—they are not related. This can often be considered the status quo and as a result if you cannot accept the null it requires some action.

  23. Heterogeneous peer effects of college roommates on academic ...

    Here we use both null-model and regression approaches to examine peer effects using longitudinal data from 5,272 undergraduates, where roommate assignments are plausibly random upon enrollment and ...