Manipulating Data in JMP: Using Tables > Transpose
Oct 23, 2017 7:57 AM
The Transpose platform enables you to rotate your data set such that the columns become the new rows and the rows become the columns. This is a simple task to achieve in JMP.
As we know, JMP requires the data to be in a specific format to use each platform. If you want to see the distribution of your data using the Distribution platform, the values of interest must be in a single column and not spread out among multiple columns. If you want to do a t-test in the Fit Y by X – Oneway platform, your data table must have one column containing the two distinct group values and one column containing the data values, rather than having a column for each group containing the data measurements. Because of the way JMP uses data in each platform, sometimes it may be necessary to restructure your original data table, as data may be recorded in a format not ideal to performing your analysis with a JMP platform.
Let’s discuss a case where using the Transpose platform would be necessary. Say there are patients in a clinic and a certain measurement is taken from each before and after some type of procedure or event. The data is collected in the structure below, with the measurements for each patient entered in only two rows (one for the Before measurement and one for the After), with a new column for each patient.
However, we are interested in using JMP to perform a paired t-test (because the Before and After data values are dependent on one another), which will help us determine whether the two samples (before and after) are significantly different from one another.
To do a paired t-test, we need to use the Matched Pairs platform in JMP (Analyze -> Specialized Modeling -> Matched Pairs). To run the analysis, we must have the Before measurements for each patient in one column and the After measurements in another. In other words, we need the rows Before and After to become the columns, and we need each Patient column to become a row in the new data table.
To do this, simply go to Tables -> Transpose, and place all Patient x columns in the Transpose Columns box. Place Time in the Label box. The result is:
Now, we can open the Matched Pairs platform and place the Before and After columns in the “Y, Paired Response” role. This gives a paired t-test comparing the before and after measurements for the sample of patients.
In this short video, I use a JMP sample data table to demonstrate the Transpose feature with both a simple example and another with a grouping variable.