Hello,
This is probably an easy question, however so far I just was not able to solve it in JMP 12.
I have a data table that I need to reorder. The data table has basically the following outline
| Batch | Timepoint | Observation |
| 1 | 0 | 2 |
| 1 | 0 | 2 |
| 1 | 0 | 2 |
| 1 | 1 | 4 |
| 1 | 1 | 4 |
| 1 | 1 | 4 |
| 2 | 0 | ... |
To process the data table in another programm I need the following outline
| Timepoint | Observation Batch 1 | Observation Batch 2 |
| 0 | 2 | |
| 0 | 2 | |
| 0 | 2 | |
| 1 | 4 | |
| 1 | 4 | |
| 1 | 4 | |
While it is pretty straight foward to tabulate the mean values for example by using Analyze-> Tabulate, I just can not find a way to have every observation in the new data table.
Any hints how to do that?
Thank you in advance for your help.
Nino
Thank you!
This works perfect.
What confused me was the fact, that I had to keep the "Timepoint" column by choosing an option for the remaining columns in the split dialog (as my data table has some additional columns it does "look" correctly if I keep all the columns).
I had some trouble getting the split command to work with regards to the option for remaining columns in jsl. It would be nice if there was an additional comment in the scripting index on how to get remaining columns to work (since you obviously have to add "keep" or "drop" is you want to select certain columns).
(Even though of course it is easier to just copy the script from the "source" part of the newly created data table).
Have a nice day!
Nino
Take a look at the menu option 'Tables > Split' and the associated Help.
In JSL:
NamesDefaultToHere(1);
dt1 = New Table( "Stacked",
Add Rows( 12 ),
New Column( "Batch",
Numeric,
"Nominal",
Format( "Best", 12 ),
Set Values( [1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2] )
),
New Column( "Timepoint",
Numeric,
"Ordinal",
Format( "Best", 12 ),
Set Values( [0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1] )
),
New Column( "Observation",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values( [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] )
)
);
// 'Tables > Split'
dt2 = dt1 << Split(
Split By( :Batch ),
Split( :Observation ),
Output Table( "Split" )
);
Copy and paste the code above into a new script window ('File > New > New Script'), then do 'Edit > Run Script'.