# Example Exercise: T-Test (Frequentist)

## Solutions

Developed by Naomi Schalken, Lion Behrens and Rens van de Schoot

This tutorial expects:

• Basic knowledge of hypothesis testing
• Any installed version of SPSS on your electronic device

This tutorial provides the reader with a basic introduction to the investigation of data relations using SPSS. Throughout this tutorial, the reader will be guided through importing datafiles, exploring summary statistics and comparing two group means using a T-test. Here, we will exclusively focus on classical frequentist statistics. To conduct Bayesian analyses in SPSS, click here for your Bayes tutorial!

Throughout this tutorial we will use a dataset from Van de Schoot, van der Velden, Boom & Brugman (2010). We will compare Dutch and foreign adolescents in their socially desirable answering patterns (sd). For more information on the sample, instruments, methodology and research context we refer the interested reader to the paper (see references). Here we will focus on data-analysis only. The data set and syntax file can be found in the subfolders tilted 'Assignment Files' and ‘Solutions’.

Note: In many other "How to get started" exercises you will be asked to compare the results from here with results you can obtain e.g. in R or lavaan. Make sure to save or write down the results you found in this exercise.

### Preparation - Importing and Exploring Data

You can find the data in the file popular_regr_1.xlsx, which contains all variables that you need for this analysis. Although it is a .xlsx-file, you can directly load it into SPSS using the following settings.

Once you loaded in your data, it is advisable to check whether your data import worked well. Therefore, first have a look at the summary statistics of your data. You can da so by clicking `Analyze -> Descriptive Statistics -> Descriptives`. Alternatively, to construct a reproducible analysis, you can open a new syntax file by clicking `File -> New -> Syntax` and executing the following code:

```DESCRIPTIVES VARIABLES=respnr Dutch gender sd covert overt
/STATISTICS=MEAN STDDEV MIN MAX.
```

Question: Have all your data been loaded in correctly? That is, do all data points substantively make sense? If you are unsure, go back to the .xlsx-file to inspect the raw data.

### Exercise 1 - T-Test

In this exercise you will compare Dutch and foreign adolescents (0=foreign, 1=Dutch) in their socially desirable answering patterns (sd), which serves as the outcome variable using an independent samples T-test. You can conduct your test by clicking `Analyze -> Compare Means-> Independent Samples T-Test` or executing the following code in your syntax file:

```T-TEST GROUPS=Dutch(0 1)
/MISSING=ANALYSIS
/VARIABLES=sd
/CRITERIA=CI(.95).
```

Question: First, look at the Group Statistics table. Do both groups obtain variances that are likely to be equal in the underlying population? Levene's test for equality of variances is testing this expectation. Interpret its result. Can you assume equal variances?

Question: Second, focus on the T-test itself. Is its value significant? How do you interpret it?

Question: Lastly, focus on the effect size (mean difference). Which group scores higher, which scores lower? Is the difference substantial? The first Descriptives Statistics table that you obtained after importing the data might help you getting an impression about the scale of the outcome variable.

### References

Van de Schoot, R., van der Velden, F., Boom, J. & Brugman, D. (2010). Can at Risk Young Adolescents be Popular and Antisocial? Sociometric Status Groups, AntiSocial Behavior, Gender and Ethnic Background. Journal of Adolescence, 33, 583-592.

### Other software exercises you might be interested in

MPLUS

How to get started

First Bayesian Inference

How to avoid and when to worry about the misuse of Bayesian Statistics

------------------------------------------

Lavaan

How to get started

------------------------------------------

Blavaan

How to get started

First Bayesian Inference

How to avoid and when to worry about the misuse of Bayesian Statistics

------------------------------------------

RJAGS

How to get started

First Bayesian Inference

How to avoid and when to worry about the misuse of Bayesian Statistics

------------------------------------------

JASP

How to get started