Highlighted
S_Xue
Level II

How to make different validation automatically using JMP script in standard least square regression?

    How to make different validation (training and validation) automatically using JMP script in standard least square regression?

    I want to do standard least square regression for 1000 times and every time with a new validation. And I do not know how to do this automatically by writing a script.

    I know that, for example, in predictive modeling Neural Networks we can write---- Validation Method ("Holdback", 0.1). But I do not know how to do this in Least Square Method.

    If I choose a fixed validation column, in the regression analysis's script, there would be these lines:
Where( Format( :Validation ) == "Training" )
Where( Format( :Validation ) == "Validation" )

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Byron_JMP
Staff

Re: How to make different validation automatically using JMP script in standard least square regress

Are you using JMP Pro?  Its likely if you are using JMP to build a validation column, and using the validation role in a platform.

 

If I were you, I would right click on the statistic I wanted to bootstrap, and then choose the bootstrap option from the bottom of the pop up menu.

 

or you could do it the hard way..

(this script has a JMP Pro functinon it it)


names default to here(1);

dt=New Table( "Some data",
	Add Rows( 20 ),
	New Column( "Response",
		Numeric,
		"Continuous",
		Format( "Best", 12 ),
		Set Values(
			[-1.82545036264736, 0.728246959467525, -1.00696633045675,
			-1.94845973713604, -0.0621517489644272, 1.31940922160903,
			-1.39078111154494, 2.44117449478401, -0.209184441663871,
			-1.09379674103266, 1.64814151733151, -1.31764655696586,
			0.0254040089481649, -0.755512000894789, -1.2826579879211,
			0.589914544061201, 2.36144445064629, 0.379635414475524,
			-3.78801173090372, -0.434943374358309]
		)
	),
	New Column( "Factor",
		Numeric,
		"Continuous",
		Format( "Best", 12 ),
		Set Values(
			[-1.6221491198447, 1.28782659216483, -2.76536700522009,
			-1.94258144594943, -0.66656328643386, 1.22476702284507,
			-1.92374219399329, 0.343884151691415, -0.0708634559705932,
			-1.96753984956401, 2.36508689631865, -1.3102347891645,
			-0.359555016603859, -1.89982154229024, -2.31502621519621,
			1.18810219397683, 1.7928172570621, 1.19417348867999, -1.68736902315671,
			0.0111059935344733]
		)
	)
);
dtc=New Table( "Crossvalidation table",
	Add Rows( 0 ),
	New Column( "RSquare",
		Numeric,
		"Continuous",
		Format( "Fixed Dec", 12, 4 ),
		Set Selected,
		Set Values( [] )
	),
	New Column( "RASE",
		Numeric,
		"Continuous",
		Format( "Fixed Dec", 12, 5 ),
		Set Selected,
		Set Values( [] )
	),
	New Column( "Freq",
		Numeric,
		"Continuous",
		Format( "Best", 12 ),
		Set Selected,
		Set Values( [] )
	)
);


for (i=1, i<=10, i++, 

dt<<Make Validation Column(
	Training Set( 0.50 ),
	Validation Set( 0.25 ),
	Test Set( 0.25 ),
	Formula Random
);

obj=dt<<Fit Model(
	Validation( :Validation ),
	Y( :Response ),
	Effects( :Factor ),
	Personality( "Standard Least Squares" ),
	Emphasis( "Minimal Report" ),
	Run(
		:Response << {Summary of Fit( 1 ), Analysis of Variance( 1 ),
		Parameter Estimates( 1 ), Lack of Fit( 0 ), Expanded  Estimates( 1 ),
		Indicator Parameterization Estimates( 1 ), Scaled Estimates( 0 ),
		Plot Actual by Predicted( 1 ), Plot Residual by Predicted( 0 ),
		Plot Studentized Residuals( 0 ), Plot Effect Leverage( 1 ),
		Plot Residual by Normal Quantiles( 0 ), Box Cox Y Transformation( 0 )}
	)
);

objr=report(obj);
sumFit=objr[tablebox(6)];
dt2=sumfit<<make into data table();
dt2<<set name("Summary of fit "||char(i));
dt2<<new column("Iteration",formula(i));
dtc << Concatenate( dt2, "Append to first table" );
obj<<close window();
close(dt2, nosave);
dt:Validation << Set Selected;
dt << Delete Columns();
);
JMP Systems Engineer, Pharm and BioPharm Sciences

View solution in original post

1 REPLY 1
Highlighted
Byron_JMP
Staff

Re: How to make different validation automatically using JMP script in standard least square regress

Are you using JMP Pro?  Its likely if you are using JMP to build a validation column, and using the validation role in a platform.

 

If I were you, I would right click on the statistic I wanted to bootstrap, and then choose the bootstrap option from the bottom of the pop up menu.

 

or you could do it the hard way..

(this script has a JMP Pro functinon it it)


names default to here(1);

dt=New Table( "Some data",
	Add Rows( 20 ),
	New Column( "Response",
		Numeric,
		"Continuous",
		Format( "Best", 12 ),
		Set Values(
			[-1.82545036264736, 0.728246959467525, -1.00696633045675,
			-1.94845973713604, -0.0621517489644272, 1.31940922160903,
			-1.39078111154494, 2.44117449478401, -0.209184441663871,
			-1.09379674103266, 1.64814151733151, -1.31764655696586,
			0.0254040089481649, -0.755512000894789, -1.2826579879211,
			0.589914544061201, 2.36144445064629, 0.379635414475524,
			-3.78801173090372, -0.434943374358309]
		)
	),
	New Column( "Factor",
		Numeric,
		"Continuous",
		Format( "Best", 12 ),
		Set Values(
			[-1.6221491198447, 1.28782659216483, -2.76536700522009,
			-1.94258144594943, -0.66656328643386, 1.22476702284507,
			-1.92374219399329, 0.343884151691415, -0.0708634559705932,
			-1.96753984956401, 2.36508689631865, -1.3102347891645,
			-0.359555016603859, -1.89982154229024, -2.31502621519621,
			1.18810219397683, 1.7928172570621, 1.19417348867999, -1.68736902315671,
			0.0111059935344733]
		)
	)
);
dtc=New Table( "Crossvalidation table",
	Add Rows( 0 ),
	New Column( "RSquare",
		Numeric,
		"Continuous",
		Format( "Fixed Dec", 12, 4 ),
		Set Selected,
		Set Values( [] )
	),
	New Column( "RASE",
		Numeric,
		"Continuous",
		Format( "Fixed Dec", 12, 5 ),
		Set Selected,
		Set Values( [] )
	),
	New Column( "Freq",
		Numeric,
		"Continuous",
		Format( "Best", 12 ),
		Set Selected,
		Set Values( [] )
	)
);


for (i=1, i<=10, i++, 

dt<<Make Validation Column(
	Training Set( 0.50 ),
	Validation Set( 0.25 ),
	Test Set( 0.25 ),
	Formula Random
);

obj=dt<<Fit Model(
	Validation( :Validation ),
	Y( :Response ),
	Effects( :Factor ),
	Personality( "Standard Least Squares" ),
	Emphasis( "Minimal Report" ),
	Run(
		:Response << {Summary of Fit( 1 ), Analysis of Variance( 1 ),
		Parameter Estimates( 1 ), Lack of Fit( 0 ), Expanded  Estimates( 1 ),
		Indicator Parameterization Estimates( 1 ), Scaled Estimates( 0 ),
		Plot Actual by Predicted( 1 ), Plot Residual by Predicted( 0 ),
		Plot Studentized Residuals( 0 ), Plot Effect Leverage( 1 ),
		Plot Residual by Normal Quantiles( 0 ), Box Cox Y Transformation( 0 )}
	)
);

objr=report(obj);
sumFit=objr[tablebox(6)];
dt2=sumfit<<make into data table();
dt2<<set name("Summary of fit "||char(i));
dt2<<new column("Iteration",formula(i));
dtc << Concatenate( dt2, "Append to first table" );
obj<<close window();
close(dt2, nosave);
dt:Validation << Set Selected;
dt << Delete Columns();
);
JMP Systems Engineer, Pharm and BioPharm Sciences

View solution in original post

Article Labels

    There are no labels assigned to this post.