Which RSquare are you looking for? Generally you would do this manually in JMP and then take the script JMP creates for you (or use workflow and get script from that). So in this case:
1. Open your table
2. Run the analysis

3. Make the changes to report / analysis as needed (I fit line)

4. Make into data table from the table

5. Get script
// Open Data Table: Big Class.jmp
// → Data Table("Big Class")
Open("$SAMPLE_DATA/Big Class.jmp");
// Combine similar TableBoxes into a Data Table
// → Data Table("Untitled")
Local({obj},
obj = Data Table("Big Class") << Bivariate(
Y(:height),
X(:weight),
Fit Line({Line Color({230, 159, 0})}),
By(:age)
);
Report(obj[1])["Linear Fit", "Summary of Fit", Table Box(1)] <<
Make Combined Data Table;
obj[1] << Close Window;
);
Then you can modify that to make it a bit better and end up with something like
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
biv = dt << Bivariate(
Y(:height),
X(:weight),
Fit Line({Line Color({230, 159, 0})}),
By(:age)
);
dt_result = Report(biv[1])["Linear Fit", "Summary of Fit", Table Box(1)] << Make Combined Data Table;
dt_result << Select Where(:Column 1 != "RSquare") << delete rows << clear select;
-Jarmo