Search code examples
linear-regressionsas-jmp

How do I extract the R-square and slope of the data from JMP report?


Using a JSL script, I plot several variables V1, V2, V3 (and so on) from two conditions A and B against each other to see how well-correlated they are. For example. V1 of A vs. V1 of B.

I then send the graphs to a JMP report so all graphs will appear in just one window.

In JMP, I use the "Fit Line" command to generate the R square table. Then, I used "Fit Special" command to generate a line where the slope is equal to 1. Hence, I create linear regression lines and create regression reports. See http://www.jmp.com/support/help/Regression_Reports.shtml#846953

My question is this. How do I "extract" the numbers from the regression reports and place them in a variable?

My purpose is this. I need to tabulate the R square values and y-intercept in single table. Right now, I am manually typing.

Thank you very much.


Solution

  • Here's a sample based on the Blood Pressure sample data in JMP:

    We'll do a "Fit X to Y" using "BP 6M" for X and "BP 8M" for Y and add a fit line. This initial part was done with "Save Script to Script Window." The naming of biv + the rest was added.

    /* get the Bivariate fit with its Fit Line into a variable */
    biv = Bivariate( Y( :BP 8M ), X( :BP 6M ), Fit Line( {Line1 Color( {213, 72, 87} )} ) );
    
    /* get the report into a variable */
    reportbiv = biv << Report;
    
    /* output the Summary of Fit to a table */
    dt = reportbiv["Summary of Fit"][1] << MakeIntoDataTable;