Subscribe Bookmark RSS Feed

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

sanqub

Community Trekker

Joined:

Jan 11, 2016

Dear Friends,

 

I need your help in following data set.

 
Suppose I have temperature, defects and total parts produced at that temperature,
temperaturedefect PercentNumber of parts produced
6401010
6451550
6503200
6553.21000
66032000
6652100
6701010

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

5 REPLIES
markbailey

Staff

Joined:

Jun 23, 2011

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

Community Trekker

Joined:

Jan 11, 2016

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. 

markbailey

Staff

Joined:

Jun 23, 2011

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

Community Trekker

Joined:

Jan 11, 2016

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

Super User

Joined:

Jun 4, 2014

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