How to Perform Paired Samples t test in SPSS

In this post, we will learn about performing paired samples t test in SPSS. The paired samples t-test is a statistical hypothesis testing procedure used to determine whether the mean differences between two sets of observations are zero. In paired samples t-tests (also known as dependent samples) t-tests, each observation in one set is paired with the corresponding observation in another. In this test means/averages of two related groups are compared. By related we mean that the observations in the two groups are paired or matched in some way.

Points to Remember

The following are points that need to be remembered:

A Paired samples t-test can be used when two measurements are taken from the same individuals/objects/respondents or related units. The paired measurements can be:

  • Before and After Comparisons: A comparison of before and after situations, such as measuring blood pressure before and after taking medication.
  • Matched Pairs: Used when comparing the test scores of twins or blood relations.
  • Repeated Measures: When measuring a person’s happiness level at different points in time.

A paired samples t-test is also known as a dependent samples t-test, paired samples t-test, or repeated measures t-test.

Paired Samples t-test Cannot be used

Note that a paired samples t-test can only be used to compare the means for two related (paired) units having a continuous outcome that is normally distributed. This test is not appropriate when

  • The data is unpaired
  • There are more than two units/ groups
  • The continuous outcome is not normally distribution
  • The outcome is ordinal or ranked

Hypothesis for Paired Samples t test

The hypotheses for a paired/ dependent samples t-test can be stated as

$H_0:\mu_d = 0$ (the difference between the mean of pairs is zero (or equal) )
$H_1: \mu_d \ne$ (the difference between the mean of pairs is not zero (or different) )
$H_1: \mu_d < 0$ (upper tailed test)
$H_1: \mu_d > 0$ (lower-tailed test)

The test statistics for a paired samples t-test are as follows

$$t=\frac{\overline{d} }{\frac{s_d}{\sqrt{n}} }$$

where

  • $\overline{d}$ is the sample mean of the differences
  • $n$ is the sample size
  • $s_d$ is the sample standard deviation of the differences

Performing Paired Samples t test in SPSS

To run a paired samples t test in SPSS, click Analyze > Compare Means > Paired Samples t-test.

Paired Samples t-test in SPSS Analysis Procedure

Paired samples t-test dialog box, the user needs to specify the variables to be used in the analysis. The variables from the left side need to be moved from the paired variables box. A blue button in between both boxes may be used to shift the variables from left to right or right to left side. Note that the variables you specify in paired variables pan need to be in pair form.

Paired Samples t-test in SPSS Dilog box

In the above dialog box, the following are important points to follow:

  • Pair: The pair row (on the right side pane) represents the number of paired samples t-tests to run. More than one paired samples t-test may be run simultaneously by selecting multiple sets of matched variables.
  • Variables 1: The first variable represents the first match group (such as the before situation).
  • Variables 2: The second variable represents the second match group (such as the after situation).
  • Options: The options button can be used to specify the confidence interval percentage and how the analysis will deal with the missing values.
Paired Samples t-test in SPSS Options

Note that setting the confidence interval percentage does not have any impact on the calculation of the p-value.

Paired Samples t test Data Example

Consider the following example about 20 students’ academic performance by taking an examination before and after a particular teaching methodology.

Student NumberMarks before Teaching MethodologyMarks After Teaching Methodology
11822
22125
31617
42224
51916
62429
71720
82123
92319
101820

Testing the Assumptions of Paired Samples t-test

Before performing the Paired Samples t-test, it is better to test the assumptions (or requirements) of the paired samples t-test.

  • The dependent variable should be continuous (that is measured on interval or ratio level).
  • The dependent observations (related samples) should have the same subject/ objects, that is, the subjects in the first group are also in the second group.
  • Sampled data should be random from the respective population.
  • The differences between the paired values should follow the normal (or approximately) normal distribution
  • There should be no outliers in the differences between the two related groups.

Note that when testing the assumptions (such as normality, and outliers detection) related to paired samples t-test, one must use a variable that represents the differences between the paired values, not the original variables themselves.

Also note that when one or more assumptions for a paired samples t-test are not met, you may run the non-parametric test, Wilcoxon Signed Ranks Test.

Paired Samples t-test in SPSS for analysis

Output: Paired Samples T test

The SPSS will result in four tables:

  1. Paired Samples Statistics
    The paired samples statistics table gives univariate descriptive statistics (such as mean, sample, size, standard deviation, and standard error) for each variable entered as paired variables.
  2. Paired Samples Correlations
    The paired samples correlation table gives the bivariate Person correlation coefficient for each pair of variables entered.
  3. Paired Samples Test
    The paired samples test table gives the hypothesis test results with p-value and confidence interval of difference.
  4. Paired Samples Effect Sizes
    The paired sample Effect sizes tables give Cohen’s d and Hedges’ Correction values with confidence interval
Paired Samples t-test Output in SPSS

Interpreting the Paired Samples t test Output

From the “Paired Samples Test” the two-tailed p-value (0.121) is greater than 0.05 (level of significance), which means that the null hypothesis is accepted which means that there is no difference between marks before and after the teaching methodology. It means that improvement in marks is due to chance or random variation marely. The “Paired Samples Correlations” Table shows that the paired variables are correlated/ related to each other as the p-value for Pearson’s Correlation is less than 0.05.

The marks related to before and after teaching methodology are statistically and significantly related to each other, however, the average difference of marks between before and after teaching methodology is not statistically significant. The differences are due to change or random variation.

How to report the Paired Samples t-test Results

One might report the statistics in the following format: t(degrees of freedom) = t-value, p = significance level.
From the above example, this would be: t(9) = -1.714, p > 0.05. Due to the averages of the two situations and the direction of the t-value, one can conclude that there was a statistically non-significant improvement in marks due to the teaching methodology from 19.9 ± 2.685 marks to 21.50 ± 3.922 marks (p > 0.05). So, there is no improvement due to the teaching methodology.

https://rfaqs.com, https://gmstat.com

How to Convert Continuous Variables in SPSS: A Quick Guide

There may be situations in which one may want to convert continuous variables in SPSS to categorical. For example, one may want to find out how many females earn a starting salary of more than 80,000 using the data of the University of say Florida. For this numeric data, we need to change into categorical variables. In SPSS, this type of transformation is called the recoding of continuous variables to categorical.

Convert Continuous Variables in SPSS to Categorical

Step-by-Step Procedure

In SPSS there are three basic options for recoding the variables.

  • Recode into different variables
  • Recode into the same variable
  • DO IF syntax

Recode into different variables and DO IF syntax creates a new variable without modifying the original variable, while recode into the same variable will permanently overwrite the original variable. Best to record a variable into a different variable. To recode into different variables,

Click Transform > Recode into different variables

Convert Continuous Variables in SPSS to Categorical

The Recode into different variables dialog box will appear as:

Convert Continuous Variables to Categorical in SPSS Input Variable Output variable

The left-side pane of the dialog box lists all of the variables. Select the variable of interest to recode and move the variable to the right-side pane by clicking the arrow button in between the left and right-side dialog box. Let us have the salary variable to transform.

  • Input Variable -> Output
    The center text box lists the variables(s). In this case, we have only a salary variable.
  • Output Variable
    Define the name and label (label is optional) for your recoded variable(s) by typing them in the text field. The new name of the recoded variable (say) will be “new-salary” and then click change.
  • Old and New Variables
  • Click the “old and new values” to specify the categories of the selected variable. A new dialog box will appear, where one needs to specify how to transform the values will appear.
Convert Continuous Variables to Categorical in SPSS Old new Values

Old Values and New Values

The “Old -> New” box specifies the type of value of a recode variable. For example, the value of the recode variable (new value) is 1 or range of 20000 through the highest.

A short description of “Old Values” options.

  • Value:
    Enter a numeric code that represents the category. for example, give the value 1 for 1st category or group.
  • System Missing:
    Apply any system missing value(.).
  • Range or Through:
    This option is used to enter the lower and upper limits that should be coded. The recode category includes both limits (inclusive). For example, 20000 to 40000.
  • Range, Lowest through Value:
    Recode all values greater than or equal to some number.
  • All Other Values:
    Applies any value not explicitly accounted for by the previous recoding rules.

A short description of the “Old -> New” option:

Enter the required group/ category numerical code in the “New Value” and then click the add button below. Repeat this step for each group value that you wish to recode. All the required groups are recorded by adding an “Old -> New” box. Finally, click the continue button. Click the OK button to transform the continuous variable into a categorical variable.

https://gmstat.com, https://rfaqs.com

Data View in SPSS (2024)

The IBM SPSS has two main windows (i) Data View and (ii) Variable View. Data View in SPSS is one of the primary ways of looking at a data file in Data View so that you can see each row as a source of data and each column as a variable. The data view in SPSS is the most useful way to look at the actual values of the data presented in the data set.

By default, SPSS launches in Data View mode.

Data View in SPSS

The following diagram of the SPSS workplace highlights the data view in SPSS and the variable view in SPSS.

Data View in SPSS

If you are not in Data View, click the Data View Tab to enter the data view and the data edit mode. Typically, one should enter the data after establishing the names and other properties of the variables in a data set. Many of the features of Data View are similar to the features that are found in spreadsheet-like applications (such as MS Excel). There are, however, several important distinctions:

SPSS Data view
  • Rows are cases: Each row in a data view represents a case or an observation. For example, each respondent to a questionnaire is a case.
  • Columns are variables: Each column represents a variable or characteristic being measured. For example, each item on a questionnaire is a variable.
  • Cells contain values. The cross-section of the row and column makes a cell. Each cell contains a single value of a variable for a case. The cell is where the case and the variable intersect. Cells contain only data values. Unlike spreadsheet programs, cells in the Data Editor cannot contain formulas.

In summary, the Data View in SPSS is the primary workspace for viewing, manipulating, and understanding the actual values in the dataset. It plays a vital role in data exploration, cleaning, and analysis.

Statistics Help: Itfeature.com

Simulating a Coin Tossing

How to Split Data File in SPSS?

In SPSS (Statistical Packages for Social Sciences) split file option lets the user to splits the data into separate groups for analysis based on the values of one or more grouping variables. If user select multiple grouping variables, the cases are grouped by each variable within categories of the preceding variable on the groups based on list. Let us learn about the step-by-step procedure to Split Data file in SPSS.

How to Split Data File in SPSS

Suppose you want to take the separate mean of male and female (groups/ categories from gender variable) then one may use split file option.

  • First Open the data file you want to split.
  • Second, from the menu bar, click the Data Menu and then Split File Option (Data -> Split File)
Split Data File in SPSS Menu

The following dialog box “Split File” will appears. Click on the radio button title “Organize output by Groups” after clicking the Grouping variable from left pan.

Split File in SPSS Dialog Box Options
  • Select the Gender Varaible (or the grouping variable you want to split) in the dialog box at the left pan and clikc on the arrow at the “Groups based on” box.
Split File in SPSS
  • Click the OK button. Now, subsequent analyses will reflect the split.
  • The data in data windows will be logical splitted. One can run requierd descriptive and inferential analsysi of the splitted data.

Split File Off

  • The most important point is to get back to ‘normal’ where the data are not split, go back to Data/Split Files… and select the option ‘Analyze All cases.’
  • Press OK. It will show SPLIT FILE OFF. Then you can get back output of data without splitting the files.

https://rfaqs.com