Hi,
Ich bin neu bei JMP. Wie kann ich die lineare Anpassung, die Zusammenfassung der Anpassungs- und Parameterschätzungen in die Datentabelle aufnehmen?
Weil ich die Steigung, den Y-Achsenabschnitt, Rsquare und RMSE des bivariaten Diagramms erhalten und in tabellarisches Format umwandeln muss. Bitte helfen Sie. Ich habe nur die Zusammenfassung des Fit-Skripts erhalten
bivsumfit = rbiv["Summary of Fit"][1] << make combined data table;
bivsumfit2 = bivsumfit << Split( Split By( :Column 1 ), Split( :Column 2 ) );
Die Methode Make Combined Data Table sammelt alle SAME-Tabellen im Plattformfenster und erstellt eine neue Datentabelle. Wenn Sie beispielsweise eine Variable in der Rolle „Nach“ mit drei Ebenen hätten, gäbe es drei Parameterschätzungstabellen.
Sie möchten unterschiedliche Tabellen aus dem Bericht abrufen.
Hier sind 3 Methoden, um die gewünschte Ausgabetabelle zu erstellen

// Generate the required table by creating output tables
// and then manipulating them to get the results
Names Default To Here( 1 );
// Open Data Table: big class.jmp
// → Data Table( "big class" )
dt = Open( "$SAMPLE_DATA/big class.jmp" );
// Launch platform: Bivariate
biv = Bivariate( Y( :height ), X( :weight ), fit line );
// Output the Summary of Fit data and transfor the output table
// to a single row
rbiv = Report( biv );
bivsumfit = rbiv["Summary of Fit"][Table Box( 1 )] << make combined data table( invisible );
bivsumfit2 = bivsumfit << Split( Split By( :Column 1 ), Split( :Column 2 ), invisible );
Close( bivsumfit, nosave );
// Output the Parameter Estimate data and transfor the output table
// to a single row
bivparmest = rbiv["Parameter Estimates"][Table Box( 1 )] <<
make combined data table( invisible );
bivparmest2 = bivparmest << Split( Split By( :Term ), Split( :Estimate ) );
Close( bivparmest, nosave );
// Combine the 2 tables
bivparmest2 << Update( With( bivsumfit2 ), Match Columns( :X = :X, :Y = :Y ) );
Close( bivsumfit2, nosave );
// Clean up the final table
bivparmest2 << delete columns(
{"X", "Y", "Table", "Mean of Response", "Observations (or Sum Wgts)", "RSquare Adj", "~Bias",
"Std Error", "t Ratio", "Prob>|t|"}
);
bivparmest2:Intercept << set name( "Y Intercept" );
Column( bivparmest2, 2 ) << set name( "Slope" );
bivparmest2:Root Mean Square Error << set name( "RMSE" );
// Create the required ouput table by reading the results
// directly from the ouput report
names default to here(1);
// Open Data Table: big class.jmp
// → Data Table( "big class" )
dt = Open( "$SAMPLE_DATA/big class.jmp" );
// Launch platform: Bivariate
biv = Bivariate( Y( :height ), X( :weight ), fit line );
// Create the new table
dtOut = New Table("Results",
Add Rows( 1 ),
New Column( "Slope" ),
New Column( "Y Intercept" ),
New Column( "Rsquare" ),
New Column( "RMSE" )
);
// Copy the table data to the output data table
rbiv = report( biv );
dtOut:Y Intercept[1] = rbiv["ParameterEstimates"][NumberColBox(1)][1];
dtOut:Slope[1] = rbiv["ParameterEstimates"][NumberColBox(1)][2];
dtOut:Rsquare[1] = rbiv["Summary of Fit"][NumberColBox(1)][1];
dtOut:RMSE[1] = rbiv["Summary of Fit"][NumberColBox(1)][3];
// Create the required ouput table using the Linear Regression
// function and adding in the RMSE
Names Default To Here( 1 );
// Open Data Table: big class.jmp
// → Data Table( "big class" )
dt = Open( "$SAMPLE_DATA/big class.jmp" );
// Calculate the linear regression
x = dt:weight << get values;
y = dt:height << get values;
{Estimates, Std_Error, Diagnostics} = Linear Regression( y, X );
// calculate the RMSE
p = x * estimates[2] + estimates[1];
d = y - p;
RMSE = Sqrt( Sum( d :*</img> d ) / (N Rows( d ) - 2) );
// Create the new table
dtOut = New Table( "Results",
Add Rows( 1 ),
New Column( "Slope" ),
New Column( "Y Intercept" ),
New Column( "Rsquare" ),
New Column( "RMSE" )
);
// Copy the calculated values to the output data table
dtOut:Y Intercept[1] = Estimates[1];
dtOut:Slope[1] = Estimates[2];
dtOut:Rsquare[1] = Diagnostics["RSquare"];
dtOut:RMSE[1] = RMSE;