Please enable JavaScript to view this site.

Features and functionality described on this page are available with our new Pro and Enterprise plans. Learn More...

When you run a t-test from a Multiple Variables data table, the first tab of the analysis parameters dialog is the Data tab where you assign variables to different roles in the analysis. This interface lets you specify which variable contains your measurements (response variable), which groups to compare, and whether your design is paired.

Overview of Variable Assignment

The Data tab is divided into two main sections:

Available variables (left side): Shows all columns from your Multiple Variables table

Variable assignment boxes (right side): Where you drag variables to assign their roles

You assign variables by dragging them from the Available variables list into the appropriate boxes on the right, or by clicking the "+ Add variable..." button in each box.

Response (Y) Variable(s)

The Response (Y) variable is the outcome you measured - the continuous numeric variable you want to compare between groups.

Requirements:

Must be a continuous variable

Can assign one or two response variables

All values must be in the same units

How many response variables to use

Use ONE response variable when:

Your data has one measurement column and a grouping variable that identifies which group each observation belongs to

You must also assign a Grouping variable with exactly 2 levels

Example: Blood_Pressure (response) + Treatment (grouping: Control vs Drug)

Use TWO response variables when:

Your two groups are stored in separate columns

You should NOT assign a Grouping variable

Example: Before_Treatment (response 1) and After_Treatment (response 2)

For paired designs, also assign a Subject variable

Good examples of response variables:

Blood pressure (mmHg)

Tumor volume (mm³)

Enzyme activity (units/mL)

Weight (g)

Reaction time (seconds)

Gene expression level (normalized units)

Grouping Variable

The Grouping variable identifies which of the two groups each observation belongs to. This is a categorical variable that defines your comparison.

Critical requirement:

Must have exactly 2 levels (groups)

A t-test compares exactly two groups - no more, no less

If your grouping variable has 3 or more levels, Prism will display an error

If you need to compare more than two groups, use one-way ANOVA instead

When to use a grouping variable:

Use with ONE response variable: When your measurement is in one column and group identity is in another

Don't use with TWO response variables: When your two groups are in separate columns

Good examples of grouping variables for t-tests:

Treatment (Control, Drug)

Sex (Male, Female)

Genotype (Wild_Type, Knockout)

Time (Before, After)

Condition (Healthy, Diseased)

Subject Variable (for Paired t-tests)

The Subject variable identifies which observations are paired - that is, which measurements come from the same experimental unit. This is only needed for paired (or matched) t-test designs.

When to use a Subject variable:

You have repeated measures from the same subjects (e.g., before and after treatment)

You have matched pairs (e.g., twins, matched controls)

The pairing is meaningful and should be accounted for in the analysis

Requirements for Subject variable:

Must be categorical

Subject IDs must be identical for the paired observations

Two examples of paired design data

With two response variables and no grouping variable

SubjectID

Before

After

Patient_001

145

132

Patient_002

138

128

Patient_003

152

141

Patient_004

148

135

Patient_005

142

129




In this example:

Response variables: Before and After (both assigned)

Subject variable: SubjectID

Grouping variable: None (not needed with two response variables)

 

With one response variable and one grouping variable

SubjectID

Response

Timepoint

Patient_001

145

Before

Patient_002

138

Before

Patient_003

152

Before

Patient_004

148

Before

Patient_005

142

Before

Patient_001

132

After

Patient_002

128

After

Patient_003

141

After

Patient_004

135

After

Patient_005

129

After




In this example:

Response variable: Response

Grouping variable: Timepoint

Subject variable: SubjectID

 

How to Assign Variables

There are two ways to assign variables:

Method 1: Drag and drop

1.Click and hold on a variable name in the Available variables list

2.Drag it to the appropriate assignment box on the right

3.Release to drop it into the box

Method 2: Add button

1.Click the "+ Add variable..." button in any assignment box

2.Select or search for the variable you want to assign from the list that appears

To remove a variable:

Hover over the variable then click the X button next to the variable name in the assignment box

The variable will return to the Available variables list

Common Questions

Q: What if my grouping variable has 3 or more groups?

A: A t-test can only compare exactly 2 groups. If you have 3+ groups, you should use ANOVA instead. If you really want to compare just two of the groups, you'll need to filter your data or create a new data table with only those two groups.

Q: Should I use a paired or unpaired t-test?

A: Use a paired t-test (by assigning a Subject variable) when:

You measured the same subjects twice (before/after, pre/post)

You have matched pairs (twins, matched controls, etc.)

Each value in one group has a specific corresponding value in the other group

Use an unpaired t-test (no Subject variable) when the two groups contain completely independent subjects.

Q: Can I compare multiple response variables against multiple groups?

A: No. T-tests are designed to compare exactly two groups for one outcome variable. If you want to compare multiple outcomes or multiple groups, you'll need to run separate t-tests or consider a more complex analysis like two-way ANOVA.

Q: What happens to rows with missing values?

A: Prism will automatically exclude any row that has a missing value in the response variable, grouping variable, or subject variable (if assigned). Only complete cases are used in the analysis.

Q: Do I need to sort my data or arrange it in any particular order?

A: No. The order of rows doesn't matter. Prism uses the grouping variable (or separate response columns) to determine which observations belong to which group.

© 1995-2019 GraphPad Software, LLC. All rights reserved.