cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Don’t miss your chance to experience Discovery Summit Europe at our best available rate! Early bird registration through 31 Oct.
  • Graph Builder Toolbar streamlines interactive graphing. Creates shortcuts on Report and GraphBuilder Helpers toolbars. Download and install the extension.
  • JMP will suspend normal business operations for our Rest and Recharge Day on Friday, October 2, 2026.
    Regular business hours will resume on Monday, October 5, 2026.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
GCardin
Level II

How to extract only the prob > |t| from a t test report ?

Probably a very simple question but is there a simple way to extract only the prob > |t| from a t test report ? From this line which extract the full report.:

dt1 = rpt[Outline Box( "t Test" )][Table Box( 1 )];

 

Full script with smaller count of Xs and Ys:

// Entrer analyse et column switchers
Oneway(
	Y(:Name("553")),
	X(:Name("1")),
	t Test(1),
	Column Switcher(:Name("1"), {:Name("1"), :Name("2"), :Name("3")}), 
	Column Switcher(:Name("553"), {:Name("553"), :Name("554")}));

//Report
rpt = Current Report();
colswitcher_obj = rpt[ColumnSwitcherCOntextOutlinebox( 1 )] << get scriptable object;
colswitcher_obj2 = rpt[ColumnSwitcherCOntextOutlinebox( 2 )] << get scriptable object;
colswitch_list = colswitcher_obj << get list;
colswitch_list2 = colswitcher_obj2 << get list;

// Loop column switcher 1
For(j = 1, j <= N Items(colswitch_list2), j++, 

	// Loop column switcher 2
	For(k = 1, k <= N Items(colswitch_list), k++, 

	// Changer le test ici
	dt1 = rpt[Outline Box( "t Test" )][Table Box( 1 )];

	// Concatenate table
	If(j == 1 & k == 1,
		main_tb = dt1;
		main_tb << Set Name( "All" );
	,
		Try( main_tb << Concatenate( dt1, Append to First Table ) );
		Close( dt1, No Save );
	);

        colSwitcher_obj << Next;
	wait(0);
	);

colSwitcher_obj2 << Next;
wait(0);
);
1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: How to extract only the prob > |t| from a t test report ?

This might not be very robust method but gives one possible idea

Names Default To Here(1);

dt = Open("$SAMPLE_DATA/Big Class.jmp");

ow = dt << Oneway(
	Y(:height),
	X(:sex),
	t Test(1),
);

tb = Report(ow)[OutlineBox("t Test"), Table Box(1)];
vals = tb[ColStackBox(2), NumberColBox(2)] << get;
prob = vals[1];

One pretty good option usually is to turn the table box into datatable using << Make Into Data Table and then extracting the value from that. After you have the value, remember to close the table.

Names Default To Here(1);

dt = Open("$SAMPLE_DATA/Big Class.jmp");

ow = dt << Oneway(
	Y(:height),
	X(:sex),
	t Test(1),
);

dt_ttest = Report(ow)[OutlineBox("t Test"), Table Box(1)] << Make Into Data Table(Invisible(1));
val = dt_ttest[3, 6];
Close(dt_ttest, no save);

Both can be made more robust by checking where Prob > |t| is.

-Jarmo

View solution in original post

1 REPLY 1
jthi
Super User

Re: How to extract only the prob > |t| from a t test report ?

This might not be very robust method but gives one possible idea

Names Default To Here(1);

dt = Open("$SAMPLE_DATA/Big Class.jmp");

ow = dt << Oneway(
	Y(:height),
	X(:sex),
	t Test(1),
);

tb = Report(ow)[OutlineBox("t Test"), Table Box(1)];
vals = tb[ColStackBox(2), NumberColBox(2)] << get;
prob = vals[1];

One pretty good option usually is to turn the table box into datatable using << Make Into Data Table and then extracting the value from that. After you have the value, remember to close the table.

Names Default To Here(1);

dt = Open("$SAMPLE_DATA/Big Class.jmp");

ow = dt << Oneway(
	Y(:height),
	X(:sex),
	t Test(1),
);

dt_ttest = Report(ow)[OutlineBox("t Test"), Table Box(1)] << Make Into Data Table(Invisible(1));
val = dt_ttest[3, 6];
Close(dt_ttest, no save);

Both can be made more robust by checking where Prob > |t| is.

-Jarmo

Recommended Articles