15 JASP Workshop - Simple linear Regression

JASP is a free, open-source statistical software package with a user-friendly, point-and-click interface suitable for research in psychology. It offers a wide range of statistical analyses, from basic descriptive statistics to advanced methods like regression and ANOVA.

JASP is available on most of the university computers, however, we recommend that you also install a personal version for your own laptop or desktop computer so that you can continue learning outside of class time.

JASP can be downloaded here: www.jasp-stats.org/

15.1 Simple linear regression - example analysis

In this video I go through the analysis and answers for Simple Linear Regression Exercise 1. If you would like to follow along (or have a go at the exercise yourself first) the question sheet and data can be found in the Week 1 module area for NS5108.

15.2 "Where to click" guide - simple linear regression analysis

The following is a step by step guide for performing a correlation and simple linear regression analysis in JASP. Watch the video above for more context related to these steps.

15.2.1 Correlation

  1. Open JASP.

  2. Load the Data: click on the File tab at the top left and select Open. Then navigate to the folder containing your data file and open it.

  3. Visualise the data: Identify the two variables you want to run your correlation on. Click Descriptives and move the two variables over to the Variables box. Below, in the Customizable plots drop down tick the Scatter plots. You may want to click none for the graphs above and to the right (to make your plot clearer). Also change that regression line (line of best fit) to linear.

  4. Identify outliers: Also in the customizable plots drop down, select boxplots. Tick label outliers if they show any dots outside of the whiskers for the box plots. Note and interpret any outliers.

  5. Calculate correlation coefficient: click Regression -> Correlation from the top bar. Pick the variables you are interested in running a correlation on. Extract and interpret the Pearson's \(r\) and p-value.

15.2.2 Simple linear regression

  1. Check normality (of residuals): Click Regression -> Linear Regression from the top bar. Pick your criterion variable (the variable you are aiming to predict) and place this in the Dependent variable box. Pick your predictor and place that in the Covariates box. In the Plots drop down select Residuals histogram. Visually interpret this histogram for an indication of this assumption check.

  2. Check Homoscedasticity: Also in the Plots drop down, select Residuals vs. predicted. Visually interpret this plot to assess Homoscedasticity.

  3. Extract the \(R^2\) value: This should be in the first table of the Linear Regression section.

  4. Determine the significance of the model: This can be obtained though the ANOVA table. F(df,df)=F-value, p=p-value.

  5. Extract values for your model regression equation: H1 intercept = \(c\), H1 variable = \(m\)

15.3 JASP lab exercises

There are two additional exercises on Moodle. Each exercise question sheet comes with a dataset and answers sheet. Work through the question and then check your answers with the answer sheet.

15.4 APA style guide

Here is an example of a hypothesis for a correlational analysis:

Null Hypothesis (H0): There is no correlation between participants' age and their scores on a cognitive ability test.

Alternative Hypothesis (H1): There is a correlation between participants' age and their scores on a cognitive ability test.

Here is an example of a correlation analysis reported in APA style:

A Pearson correlation was conducted to assess the relationship between participants' age and their scores on a cognitive ability test. Assumptions checks were performed to ensure no violation of the assumptions of normality of residuals, linearity, and homoscedasticity. There was a significant negative correlation between age and cognitive ability scores, r(98) = -.45, p < .001, with older participants tending to have lower scores on the cognitive ability test. As such, the null hypothesis can be rejected.

Here is an example of a hypothesis for a simple linear regression analysis:

Null Hypothesis (H0): The number of study hours is not a significant predictor of test scores.

Alternative Hypothesis (H1): The number of study hours is a significant predictor of test scores.

Here is an example of a simple linear regression analysis reported in APA style:

A simple linear regression was conducted to predict test scores based on the number of study hours. The assumptions of linearity, independence, and normality were checked and met.

The results indicated that there was a significant relationship between the number of study hours and test scores, F(1, 98) = 34.5, p < .001. As such, the null hypothesis can be rejected The R² value was .26, indicating that approximately 26% of the variance in test scores can be explained by the number of study hours.

The regression equation was found to be:

Test Score = 50.2 + 6.7*Study Hours.

For each additional hour of study, there was an increase of 6.7 points in the test score. The intercept value of 50.2 indicates that a student who does not study at all (0 hours) is expected to score 50.2 points on the test.