Dear all,
I have a jmp data table as shown in Input data table format below with multiple columns ~50
Also the number of rows is flexible it can vary from class1 to class 100
I intend to generate a statistics summary jmp table as shown in output table format.
Right now the way I am doing this is very cumbersome as I am hard coding each column name and that occupies much of code.
Is there a quicker way at arriving at the final statistics table.
//---Input data table
A B C ..............about 50 columns
class1 21.5 54.9
class2 22.3 65.9
class3 29.2 58.5
class4 32.1 76.1
class5 54.7 87.1
class6 23.9 89.2
//---Output desired
Mean(of class1 to 6) Median(of class1 to 6) Interquartile range(of class1 to 6) standard deviation(of class1 to 6) range(of class1 to 6)
A
B
C
.
.
.
//--Present approach----bad way: group, stack and then split----->>
Grouped_Sum = dt <<
Summary(
Median(
:Name("A"),:Name("B"),.......
),
Std Dev(
:Name("A"),:Name("B"),.......
),
Mean(
:Name("A"),:Name("B"),.......
),
Interquartile Range(
:Name("A"),:Name("B"),.......
),
Range(
:Name("A"),:Name("B"),.......
),
Freq( "None" ),
Weight( "None" )
);
Stack_me = Grouped_Sum <<
Stack(
columns(
:Name("Median(A)"),:Name("Median(B)"),....,
:Name("Std Dev(A)"),:Name("Std Dev(B)"),
:Name("Interquartile Range(A)",),:Name("Interquartile Range(B)"),
.......
),
Source Label Column( "Label" ),
Stacked Data Column( "Data" ),
Drop All Other Columns( 1 ),
Output Table( "stacked_data" )
);
Final = Stack_NMT << Split(
Split By( :handle ),
Split( :Data ),
Group( :something ),
Remaining Columns( Drop All )
);
Thanks in advance.