该帮助的版本不再更新,请参见https://www.jmp.com/support/help/zh-cn/15.2 获取最新的版本.


dt = As Table( (0 :: 10)`, << Column Names( {"X"} ) );
Random Reset( 12345 );
dt << New Column( "Y",
"Continuous",
"Numeric",
Set Formula( :X * 2 + 1 + Random Normal() )
res = []; // define results matrix (empty to start)
For( i = 1, i <= 100, i++,
// for each iteration, fit a regression line and save parameter estimates
bv = dt << Bivariate( Y( :Y ), X( :X ), Fit Line( 1 ), Invisible );
res |/= (Report( bv )["Parameter Estimates"][
Number Col Box( "Estimate" )] << Get as Matrix)`;
bv << Close Window;
dt:Y << Eval Formula;
dtres = As Table( res, << Column Names( {"Intercept", "Slope"} ) );
dtres << Distribution( Y( :Intercept, :Slope ) );
If you want to run an analysis as an intermediate step in your script, and do not need the user to see the analysis, hide it with the invisible option. In this case, you might want to show only specific results from the report, which you can output to a journal or to the log.
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dist = dt << Distribution( Y( :height ), CDF Plot( 1 ), invisible );
Report( dist )["CDF Plot"] << Journal;
dist << Close Window;
The following example extracts the F-Ratio from an invisible Bivariate report, and outputs it to the log:
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
biv = dt << Bivariate( x( :height ), y( :weight ), invisible );
biv << Fit Line;
fratio = r[ColumnBox( "F Ratio" )][1];
r << Close Window;
Show( fratio );
You can also use the invisible option on the options in the Tables menu, such as Subset, Sort, Stack, and so on. The following example makes the Subset operation invisible:
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt << Select Where( :age == 14 );
subDt = dt << Subset( invisible );
subDt << Bivariate( x( :height ), y( :weight ), Fit Line );
subDt << Bivariate( x( :height ),y( :weight ), Where( :age == 14 ), Fit Line );