Here is another method. It has only one advantage, in that the script just duplicates what you could do running JMP interactively. I have attached a sample data table that I developed the script around.
// Set a pointer to the sample data
names default to here(1);
dt = current data table();
// Stack the 6 data columns from each row
stacked = dt << Stack(
columns( :_3, :_4, :_5, :_6, :_7, :_8 ),
Source Label Column( "Label" ),
Stacked Data Column( "Data" )
);
// Create a new column that represents the time factor
stacked << new column("time",formula(Num(Substr(:Label, 2, 1)) - 2));
// Run the analysis on the data, by each row(student)
biv=stacked<<Bivariate(invisible,
Y( :Data ),
X( :time ),
Fit Line( {Line Color( {213, 72, 87} )} ),
by(_1)
);
// Create a data table from the estimates output
dtslope=report(biv[1])["Parameter Estimates"][1]<<make combined data table;
// Get rid of the intercept data
dtslope<<select where(:term == "Intercept");
dtslope<<delete rows;
// Select the columns that are not wanted and delete them
dtslope:x<<set selected(1);
dtslope:y<<set selected(1);
dtslope:term<<set selected(1);
dtslope:Name("~bias")<<set selected(1);
dtslope:std error<<set selected(1);
dtslope:t ratio<<set selected(1);
dtslope:Name("prob>|t|")<<set selected(1);
dtslope<<delete columns;
// Rename the Estimate column to Slope
dtslope:Estimate<<set name("Slope");
// Add the slope to the original data table
dt<< Update(
With( dtslope ),
Match Columns( :_1 = :_1 )
);
Jim