JMSL Chart Programmer's Guide
Quality Control and Improvement Charts >> XbarR and RChart  Previous Page  Contents  Next Page

XbarR and RChart

If the sample sizes are small, say less than 10, then the in-sample ranges can be used instead of the in-sample standard deviations. The XbarR class plots the mean of each sample as well as control limits computed using the mean of the in-sample ranges, . The positions of the control limits are determined by the equations.

where is the grand mean (the average of all observations), and is the mean of the distribution of the ranges of n samples from the normal distribution with mean of zero and standard deviation of one. The standard deviation of this distribution is . Therefore

is an estimator of the standard deviation of the ranges.

XbarR Example

This example creates an XbarR chart using the same piston ring data previously used limit for the XbarS chart. Here the in-sample ranges are used to compute the control limits, rather than the in-sample standard deviations (Montgomery 215).

(Download Code)
import com.imsl.chart.*;
import com.imsl.chart.qc.*;
import javax.swing.JFrame;

public class SampleXbarR extends JFrameChart {    
    public SampleXbarR() {
        Chart chart = getChart();
        AxisXY axis = new AxisXY(chart);
        XbarR xbarr = new XbarR(axis, SampleXbarS.diameter);
        
        xbarr.getUpperControlLimit().setTitle("ucl = {0,number,0.0000}");
        
        axis.getAxisX().getAxisTitle().setTitle("Sample Number");
        axis.getAxisX().getAxisLabel().setTextFormat("0");
        axis.getAxisY().getAxisTitle().setTitle("Piston Ring Diameter");
        axis.getAxisY().setAutoscaleInput(axis.AUTOSCALE_OFF);
        axis.getAxisY().setWindow(73.985, 74.015);
    }
    
    public static void main(String argv[]) {
        new SampleXbarR().setVisible(true);
    }
}

XbarRCombo Example

This example combines the XbarR chart with the corresponding RChart into a single chart. This is done by adjusting the Viewport attribute values for the two subcharts (Montgomery 215).

(Download Code)
import com.imsl.chart.*;
import com.imsl.chart.qc.*;

public class SampleXbarRCombo extends JFrameChart {  
    
    public SampleXbarRCombo() {
        Chart chart = getChart();
        ShewhartControlChart charts[] =
            XbarR.createCharts(chart, SampleXbarS.diameter);
        AxisXY axis = (AxisXY)(charts[0].getAxis());
        axis.getAxisY().setAutoscaleInput(axis.AUTOSCALE_OFF);
        axis.getAxisY().setWindow(73.985, 74.015);
    }
  
    public static void main(String argv[]) {
        new SampleXbarRCombo().setVisible(true);
    }
}



©  Visual Numerics, Inc.  All rights reserved.  Previous Page  Contents  Next Page