cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Try the Materials Informatics Toolkit, which is designed to easily handle SMILES data. This and other helpful add-ins are available in the JMP® Marketplace
Choose Language Hide Translation Bar
sanqub
Level III

How do I use Graph Builder to fit curve/trendline giving weightage to few relevant points?

Dear Friends,

 

I need your help in following data set.

 
Suppose I have temperature, defects and total parts produced at that temperature,
temperature defect Percent Number of parts produced
640 10 10
645 15 50
650 3 200
655 3.2 1000
660 3 2000
665 2 100
670 10 10

I want a graph of temp v/s defect percentage and giving weightage to total parts produced.

If I don't consider weights(total parts produced) the trend is misleading. For instance at 640 deg, total parts produced is 10, but just one defect makes defect percentage 10%. Which affects the trendline. Is there any way to give weightage based on number of parts produced at that temperature.

In other words 650, 655. 660 actually represent the trend as number of parts produced are high and give clear picture, increase in temperature reduces defects. Also I cannot discard first two and last two points.

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions

Re: how do I use Graph Builder to fit curve/trendline giving weightage to few relevant points?

Graph Builder has limited capabilities for fitting models. The correct analysis of this data is called a 'probit analysis.' You would use the Generalized Linear Models fitting personality through the Analyze > Fit Model dialog instead of the Graph > Graph Builder.

Here is the script that will create the JMP data table with your data and table script to launch the correct analysis.

New Table( "untitled",
	Add Rows( 7 ),
	New Script(
		"Model",
		Fit Model(
			Y( :Defective Parts, :Total Parts ),
			Effects( :Temperature, :Temperature * :Temperature ),
			Personality( "Generalized Linear Model" ),
			GLM Distribution( "Binomial" ),
			Link Function( "Probit" )
		)
	),
	New Column( "Temperature",
		Numeric,
		"Continuous",
		Format( "Best", 12 ),
		Set Values( [640, 645, 650, 655, 660, 665, 670] )
	),
	New Column( "Percentage Defects",
		Numeric,
		"Continuous",
		Format( "Best", 12 ),
		Set Values( [0.1, 0.15, 0.03, 0.032, 0.03, 0.02, 0.1] )
	),
	New Column( "Total Parts",
		Numeric,
		"Continuous",
		Format( "Best", 12 ),
		Set Values( [10, 50, 200, 1000, 2000, 100, 10] )
	),
	New Column( "Defective Parts",
		Numeric,
		"Continuous",
		Format( "Best", 12 ),
		Formula( :Percentage Defects * :Total Parts )
	)
);

Copy this script to a File > New > Script window and then run it. The response appears to be non-linear, with a minimum in the mid-temperature range.

Note that you can save this model and then use it in Graph Builder as a formula column.

View solution in original post

5 REPLIES 5

Re: how do I use Graph Builder to fit curve/trendline giving weightage to few relevant points?

Graph Builder has limited capabilities for fitting models. The correct analysis of this data is called a 'probit analysis.' You would use the Generalized Linear Models fitting personality through the Analyze > Fit Model dialog instead of the Graph > Graph Builder.

Here is the script that will create the JMP data table with your data and table script to launch the correct analysis.

New Table( "untitled",
	Add Rows( 7 ),
	New Script(
		"Model",
		Fit Model(
			Y( :Defective Parts, :Total Parts ),
			Effects( :Temperature, :Temperature * :Temperature ),
			Personality( "Generalized Linear Model" ),
			GLM Distribution( "Binomial" ),
			Link Function( "Probit" )
		)
	),
	New Column( "Temperature",
		Numeric,
		"Continuous",
		Format( "Best", 12 ),
		Set Values( [640, 645, 650, 655, 660, 665, 670] )
	),
	New Column( "Percentage Defects",
		Numeric,
		"Continuous",
		Format( "Best", 12 ),
		Set Values( [0.1, 0.15, 0.03, 0.032, 0.03, 0.02, 0.1] )
	),
	New Column( "Total Parts",
		Numeric,
		"Continuous",
		Format( "Best", 12 ),
		Set Values( [10, 50, 200, 1000, 2000, 100, 10] )
	),
	New Column( "Defective Parts",
		Numeric,
		"Continuous",
		Format( "Best", 12 ),
		Formula( :Percentage Defects * :Total Parts )
	)
);

Copy this script to a File > New > Script window and then run it. The response appears to be non-linear, with a minimum in the mid-temperature range.

Note that you can save this model and then use it in Graph Builder as a formula column.

sanqub
Level III

Re: how do I use Graph Builder to fit curve/trendline giving weightage to few relevant points?

Thank You for the script.

But my main concern was there should be less weightage for temperatures 640, 645 and 670 as number of parts produced at these temperatures is very low. But as can be seen from regression plot, 640, 645 and 670 are given eaqual weightage resulting in a U shaped curve. 

Re: how do I use Graph Builder to fit curve/trendline giving weightage to few relevant points?

I am not sure what you mean by 'weightage.' The total number of parts at each covariate level is already part of the probit analysis. The total number of parts per level affects the confidence intervals of the estimates. There is no need to apply explicit weights to some observations because they occur less frequently. In fact, that additinal weighting would distort the results.

sanqub
Level III

Re: how do I use Graph Builder to fit curve/trendline giving weightage to few relevant points?

Thanks for the script. Please please find attached actual data.

My objective is to plot defect % against temperature. But for lower temperatures number of parts produced is less and defect percentage too high, so the curve gives a wrong indication.

I want a curve of defect% and temperature giving weightage to total number of parts produced.

Steven_Moore
Level VI

Re: how do I use Graph Builder to fit curve/trendline giving weightage to few relevant points?

Your data is very skewed in terms of sample size.  Perhaps you should consider running a Definitive Screening Design with a consistent sample size of perhaps 500.  Barring running a DOE, I do not see anything that excites me when I analyze your data in various platforms.

Steve