For the latest version of JMP Help, visit JMP.com/help.


Using JMP > Reshape Your Data > Stack Columns in Data Tables > Example of Stacking Columns into More Than One Column
Publication date: 05/05/2023

Example of Stacking Columns into More Than One Column

Suppose that a researcher has data on blood pressure readings. The readings were taken over three days: Monday, Wednesday, and Friday. Three readings were taken each day, at 8am, 12pm, and 6pm.

1. Select Help > Sample Data Folder and open Blood Pressure.jmp.

Each BP (blood pressure) column is delineated according to the date and time. The BP 8M column corresponds to readings that were taken at 8am on Monday. The BP 12W column corresponds to readings that were taken on 12pm on Wednesday, and so on. The researcher wants to stack all of the blood pressure columns into three columns that correspond to each day: Monday, Wednesday, and Friday.

2. Select Tables > Stack.

3. Select all of the BP readings and click Stack Columns.

The order of the columns reflects how the columns in the series should be grouped.

4. Select Multiple series stack.

5. Next to Number of Series, type 3.

6. Because you want to stack the columns vertically, select Contiguous.

7. Rename the Stacked Data Column from Data to BP (for blood pressure).

8. Rename the Source Label Column from Label to Day.

Figure 6.9 Completed Stack Window 

Completed Stack Window

9. Click OK.

In the stacked data table, note the following:

The first Day column represents Monday.

The Day 2 column represents Wednesday.

The Day 3 column represents Friday.

Want more information? Have questions? Get answers in the JMP User Community (community.jmp.com).