Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp", Invisible);
dt << New Column("R", Numeric, Continuous, Formula(Row()));
// Linear Regression()
{Estimates, Std_Error, Diagnostics} = Linear Regression(dt[0, "height"], dt[0, "R"],);
// lr_eq = Eval Insert("height = ^Estimates[1]^ + ^Estimates[2]^ * R");
lr_s1 = Estimates[2];
// Bivariate + Fit Line
biv = dt << Bivariate(Y(:height), X(:R), << Fit Line, Invisible);
biv_eq = Report(biv)[Outline Box("Linear Fit"), Text Edit Box(1)] << get text;
biv << close window;
biv_s1 = Regex(biv_eq, "\s([0-9\.]+)*\D+$", "\1");
//biv_s2 = Word(-2, eq, " +*");
// Graph Builder + Line Of Fit + Equation(1)
gb = dt << Graph Builder(
Size(525, 454),
Show Control Panel(0),
Variables(X(:R), Y(:height)),
Elements(Points(X, Y, Legend(3)), Line Of Fit(X, Y, Legend(5), Equation(1))),
Invisible
);
tseg = Report(gb)[FrameBox(1)] << Find Seg(Text Seg(1));
gb_eq = tseg << get text;
gb << Close Window;
gb_s1 = Regex(gb_eq, "\s([0-9\.]+)*\D+$", "\1");
//gb_s2 = Word(-2, eq, " +*");
Close(dt, no save);
Show(lr_s1, biv_s1, gb_s1);