Bootstrapping Mediation Analysis in R from Scratch

This tutorial explains how to write code for boostrapping mediation analysis in R from scratch. Mediation analysis is often used in academic research to understand the underlying mechanism. Often, you also need to report a bootstrapping confidence interval for the indirect effect. Steps of Bootstrapping Mediation Analysis in R The following shows the steps. (1) … Read more

Categories R

Logistic Regression in R

This tutorial is to show how to do logistic regression in R with examples. The following is the key syntax for logistic regression in R. glm(Y~ X1 + X2, data = data_frame_name, family = “binomial”) Steps of logistic regression in R Step 1: Read data and determine model In this tutorial, we are going to … Read more

Categories R

Syntax for chi-square test in SPSS

In some situations, the syntax is easier than the visual menu to use in SPSS. This tutorial provides examples of syntax for chi-square test in SPSS. 2 Examples of Syntax for chi-square test in SPSS Example 1: One variable The first example is the one variable chi-square test. The following is example data for one … Read more

One Variable Chi-Square in SPSS

This tutorial shows how you can do one variable chi-square in SPSS with detailed examples. The following shows two examples, one using Syntax and one using a menu interface. Examples of One Variable Chi-Square in SPSS Example 1 A school is offering 3 courses, and you would like to see whether the number of students … Read more

One Variable Chi-square: Definition, examples, and formula

This tutorial explains the definition of One Variable Chi-square, and provides examples for it. Two types of one variable chi-square There are two possible ways of using chi-square tests: Chi-square goodness of fit test: It tests the difference between the observed count values and the expected count values. (see discussion here.) Chi-square test of independence: … Read more

Logistic Regression in SPSS

This tutorial shows how you can do logistic regression in SPSS step by step. Logistic regression is a model testing the relationship between Y (which is a binary variable) and X (X can be more than one). logistic regression is also called logit regression. In this tutorial, we are going to use a dataset posted on the UCLA … Read more

Multiple Linear Regression in SPSS

This tutorial shows how to do multiple linear regression in SPSS. Different from simple linear regression, multiple linear regression has more than 2 or more independent variables (i.e., multiple Xs). In this tutorial, we test if students’ writing scores and math scores can be used to predict reading scores. Read = b0 + b1 Write + b2 Math … Read more

Simple Linear Regression in SPSS

This tutorial shows how to do simple linear regression in SPSS step by step. Simple linear regression estimates the linear relationship between one independent variable and one dependent. In this tutorial, we test whether students’ writing scores can be used to predict reading scores. Read = b0 + b1 Write This dataset in this tutorial … Read more

How to Add Label Values via SPSS Syntax

This tutorial shows how to add label values via SPSS syntax. Such label values can tell readers what these numbers actually represent. In SPSS, you can use the menu to add label values (see the window below). However, you can also achieve the same results by using syntax. Add Label Values via SPSS Syntax The … Read more

Two-Way ANOVA in SPSS

This tutorial shows the steps of how you can do two-way ANOVA in SPSS. A two-way ANOVA is used to estimate how a quantitative variable (i.e., Y) changes according to the levels of two categorical variables (X1 and X2). This tutorial uses hypothetical data of brand (X1) and City (X2) and sales as Y. You can download … Read more