BookmarkSubscribeRSS Feed
Choose Language Hide Translation Bar
BioMikey

Occasional Contributor

Joined:

Dec 6, 2018

Custom Error Bars Using the Graph Builder

I love the graph builder, but there is one type of analysis that should be easy, but alas is not. I can easily use the graph builder to add 1 standard deviation error bars, but I am doing some regulatory work that requires 3 standard deviation error bars. It sure would be nice if I could adjust that with a drop down menu. Do you all know of an easy fix for that?

 

Thank you,

BioMike

1 REPLY 1
txnelson

Super User

Joined:

Jun 22, 2012

Re: Custom Error Bars Using the Graph Builder

I do not see an option that will allow you to change the STD for the error bars, however, if you standardize the Y variable to where the mean is equal to the current mean, but the STD is 3 times the size of the current STD, then you will get the chart you want.  Below is an example showing the use of a Transform formula to show you what I am talking about

errorbars.PNG

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
Graph Builder(
	Variables(
		X( :sex ),
		Y( :weight ),
		Y(
			Transform Column(
				"Transform[weight]",
				Formula(
					inSTDs = Abs( :weight - Col Mean( :weight, :sex ) ) /
					Col Std Dev( :weight, :sex );
					If( :weight >= Col Mean( :weight, :sex ),
						Col Mean( :weight, :sex ) + 3 * inSTDs *
						Col Std Dev( :weight, :sex ),
						Col Mean( :weight, :sex ) - 3 * inSTDs *
						Col Std Dev( :weight, :sex )
					);
				)
			),
			Position( 1 )
		)
	),
	Elements(
		Line(
			X,
			Y( 1 ),
			Y( 2 ),
			Legend( 4 ),
			Error Bars( "Standard Deviation" )
		)
	)
);
Jim