Extract or return correlation values using density ellipse from a graph builder plots in JSLHello,
I am kind a new to JSL. I am plotting a graph of numerical vs categorical data using graph builder function in JMP and adding ellipse to see a correlation as well. I am using the scripts for my future plots but I want customize a bit by storing the correlation(pointed with red arrow in figure) values somewhere in a variable so that I can use it in some logical operations. For example if I want to plot graphs only which has correlation more than 0.45. Any JSL script, help or leads would be appreciated. Following I tried some but no success yet.
Thank you!
gb = dt << Graph Builder(
Variables( X( :"A_column"n ), Y( :"B_column"n ) ),
Elements(
Points( X, Y, Legend( 3 ) ),
Ellipse( X, Y, Legend( 4 ), Correlation( 1 ), Mean Point( 1 ) )
),
SendToReport(
Dispatch( {"Ellipse"}, "", OutlineBox, {Close( 0 )} ),
Dispatch( {"Pairwise Correlations"}, "", TableBox, {Sort By Column( 7, 1 )} )
)
);
thing_report = gb << report;
Show Properties( thing_report );
corr = biv << Get Correlation Matrix;
Show( corr );

Store the correlation pointed in with the red arrow.
AnalyticsData TableGraphicsScriptingWindowsRe: Extract or return correlation values using density ellipse from a graph builder plots in JSLI'm not sure if you should be checking for correlation like this between Continuous and Nominal columns, but... you can export the correlation from graph builder with something like this (not sure how easily this will break):
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
gb = dt << Graph Builder(
Size(535, 457),
Show Control Panel(0),
Variables(X(:height), Y(:weight)),
Elements(Points(X, Y, Legend(3)), Ellipse(X, Y, Legend(5), Correlation(1)))
);
ts = Report(gb)[Frame Box(1)] << Find Seg("TextSeg");
corr = ts << get text;
How I got there:
1. Created graph builder and opened Customize menu. Noticed that I could change the Text elements color, so I did

2. Got the script for my graph builder with red text and found out that the color change affects TextSeg()
Graph Builder(
Size(617, 457),
Show Control Panel(0),
Variables(X(:height), Y(:weight)),
Elements(Points(X, Y, Legend(3)), Ellipse(X, Y, Legend(5), Correlation(1))),
SendToReport(
Dispatch(
{},
"Graph Builder",
FrameBox,
{DispatchSeg(TextSeg(1), {Fill Color("Medium Dark Red")})}
)
)
)
3. Checked Scripting Index for Text Seg and found one way to get the value

Re: Extract or return correlation values using density ellipse from a graph builder plots in JSLHi HadelyMyers,
Thank you so much for the solution. In my data one column is numerical and the other one is categorical(Mostly characters). I am not sure how to use multivariate with this type of data. That is the reason I am using graph builder and density ellipse plot to see the correlation over there. Unfortunately, the solution you provide didn't work on my data. Hoping for your response.
Thank you again!
Re: Extract or return correlation values using density ellipse from a graph builder plots in JSLHi,
I'm not sure if there is a way to extract this number from a Graph Builder report, but it is quite simple to do it using Multivariate (see script below). Does this work for you?
Names Default To Here(1);
dt=open("$SAMPLE_DATA/Tablet Production.jmp");
mul=dt<<MULTIVARIATE></MULTIVARIATE>