안녕,
저는 JMP가 처음입니다. 선형 적합, 적합 요약 및 매개변수 추정치를 데이터 테이블로 가져오려면 어떻게 해야 합니까?
이변량 플롯의 기울기, Y 절편, Rsquare 및 RMSE를 가져와 표 형식으로 만들어야 하기 때문입니다. 도와주세요. 맞춤 스크립트 요약만 가져왔습니다.
bivsumfit = rbiv["Summary of Fit"][1] << make combined data table;
bivsumfit2 = bivsumfit << Split( Split By( :Column 1 ), Split( :Column 2 ) );
결합된 데이터 테이블 만들기 방법은 플랫폼 창에서 모든 동일한 테이블을 수집하고 새 데이터 테이블을 만듭니다. 예를 들어 기준 역할에 3개 수준의 변수가 있는 경우 3개의 매개 변수 추정 테이블이 있습니다.
보고서에서 서로 다른 테이블을 가져오려고 합니다.
다음은 원하는 출력 테이블을 만드는 3가지 방법입니다.

// 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;