cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar
Kaik
Level I

Representation of the interaction in a bar chart

Hello!

 

I have a question on both graphical and statistical representation. In the following bar chart, the interaction between the two treatments is significant, so the most ideal way to represent the results graphically would be a bar chart with the following aesthetics:

 

Kaik_0-1732530252921.png

 

Performing the Tukey of the interaction, the result of the analysis is as follows:

 

Kaik_2-1732530394002.png

 

Although this JMP output would be the most statistically correct, since you have all the information between treatments, is there a way in JMP pro to be able to statistically compare between main treatment and secondary treatments, simplifying the results graphically for the reader's understanding?

 

How would you represent the results graphically and statistically?

 

Thanks in advance

 

 

2 REPLIES 2
Byron_JMP
Staff

Re: Representation of the interaction in a bar chart

I don't know what the "right" answer is but I might try something like this:

Screenshot 2024-12-02 at 10.34.08 AM.png

 

 I used the fit y by x platform to do a means comparison using Dunnet's with control. 

In this example the control is actually named "control" so the platform doesn't ask which level is the control. It the baseline treatment isn't named "control" then you'll be asked to specify which one is the control.

 

The JSL below takes the big class data table and manipulates it into an example table. I used the workflow builder to generate the JSL, so somethings are a little wonky, but it works. 



Names Default To Here( 1 );
dt=Open( "$SAMPLE_DATA/Big Class.jmp" );

dt << Begin Data Update;
dt << Recode Column(
	dt:age,
	{Format( _rcNow, "Fixed Dec", 5, 0 ), Map Value(
		_rcOrig,
		{12, "Treatment 1", 13, "Treatment 2", 14, "Treatment 3", 15, "Treatment 4", 16, "Control", 17, "Control"
		},
		Unmatched( _rcNow )
	)},
	Update Properties( 1 ),
	Target Column( :age )
);
dt << End Data Update;

dt << Delete Columns( :name );
dt << Delete Columns( :sex );
dt << Set Name( "Big Experiment" );
dt << Delete Scripts(
	{"Distribution", "Bivariate", "Oneway", "Logistic", "Contingency", "Fit Model",
	"Set Sex Value Labels", "Set Age Value Labels", "Graph Builder Smoother Line",
	"Graph Builder Line and Bar Charts", "Graph Builder Line Chart",
	"Graph Builder Heatmap", "JMP Application: Six Quality Graphs"}
);
dt:age << Set Name( "Treatment" ) ;
dt:height << Set Name( "Response 1" );
dt:weight << Set Name( "Response 2" );
dt:Treatment << Set Modeling Type( "Nominal" );
dt << Oneway(
	Y( :Response 1 ),
	X( :Treatment ),
	With Control( 1, {"Control"} )
);


	obj = dt << Oneway(
		Y( :Response 1 ),
		X( :Treatment ),
		With Control( 1, {"Control"} )
	);
	dt2=Report( obj )["Means Comparisons",
	"Comparisons with a control using Dunnett's Method", "LSD Threshold Matrix",
	Table Box( 1 )] << Make Into Data Table;


dt << Update(
	With( dt2 ),
	Match Columns( :Treatment = :Level )
);
Close( dt2, nosave );

	obj = dt << Oneway(
		Y( :Response 1 ),
		X( :Treatment ),
		With Control( 1, {"Control"} )
	);
	obj << Save Script to Data Table(
		"Fit Y by X of Response 1 by Treatment", <<Replace( 0 ), <<Prompt( 0 )
	);
	obj << Close Window;

dt << Graph Builder(
	Size( 514, 442 ),
	Show Control Panel( 0 ),
	Variables( X( :Treatment ), Y( :Response 1 ), Color( :"Abs(Dif)-LSD"n ) ),
	Elements( Bar( X, Y, Legend( 4 ), Error Interval( "Confidence Interval" ) ) )
);

	obj = dt <<
	Graph Builder(
		Size( 514, 442 ),
		Show Control Panel( 0 ),
		Variables( X( :Treatment ), Y( :Response 1 ), Color( :"Abs(Dif)-LSD"n ) ),
		Elements(
			Bar( X, Y, Legend( 4 ), Error Interval( "Confidence Interval" ) )
		)
	);
	obj << Save Script to Data Table(
		"Mean(Response 1) vs. Treatment", <<Replace( 0 ), <<Prompt( 0 )
	);
	obj << Close Window;
JMP Systems Engineer, Health and Life Sciences (Pharma)
statman
Super User

Re: Representation of the interaction in a bar chart

I would use interaction plots, not bar charts to graphically display interactions.

 

https://www.jmp.com/support/help/en/19.0/?os=mac&source=application#page/jmp/interaction-plots.shtml

"All models are wrong, some are useful" G.E.P. Box