File:Xbar chart for a paired xbar and R chart.svg
Original file (SVG file, nominally 630 × 629 pixels, file size: 37 KB)
Captions
Captions
Summary[edit]
| DescriptionXbar chart for a paired xbar and R chart.svg |
English: Example xbar chart for a process that experienced a 1.5σ drift starting at midnight. |
| Date | |
| Source | Own work |
| Author | DanielPenfield |
Creation technique[edit]
- Simulate process observations using en:perl, output to file.
- Read file into R, use qcc package to render control chart.
- Save to PDF.
- Import into en:Inkscape, save to SVG.
en:Perl[edit]
#!/usr/bin/perl -w
use strict;
use Math::Random;
my %shiftSchedule = (
"first" => { "start" => 6.00, "end" => 14.00 },
"second" => { "start" => 14.00, "end" => 22.00 },
"third" => { "start" => 22.00, "end" => 6.00 }
);
my $shift = "third"; # shift to monitor
my $inspectionRate = 1 / 2; # every 1/2 hour
my $drift = 1.5; # drift to simulate
my $m = 25; # samples in control chart setup
my $n = 3; # observations per sample
my $target = 100.0; # quality characteristic target
my $hour;
my $i;
my $j;
my $minute;
my $observation;
my $setupM = $m;
print "timestamp sample observation phase\r\n";
for ($i = 1; $i <= $m; $i++) {
for ($j = 0; $j < $n; $j++) {
$observation = $target + random_normal();
printf " 0:00 %6d %7.3f setup\r\n", $i, $observation;
}
}
$m = $shiftSchedule{$shift}{"end"} - $shiftSchedule{$shift}{"start"};
if ($m < 0) {
$m += 24;
}
$m /= $inspectionRate;
for ($i = 1; $i <= $m; $i++) {
$hour = int($i * $inspectionRate + $shiftSchedule{$shift}{"start"});
if ($hour >= 24) {
$hour -= 24;
}
$minute = ($i & 0x1) ? (60 * $inspectionRate) : 0;
for ($j = 0; $j < $n; $j++) {
$observation = $target + random_normal();
if ($i >= (0.25 * $m)) {
if ($i < (0.75 * $m)) {
$observation += ($drift / (0.5 * $m)) * ($i - (0.25 * $m));
} else {
$observation += $drift;
}
}
printf " %2d:%02d %6d %7.3f monitoring\r\n", $hour, $minute, $setupM + $i, $observation;
}
}
This chart was created with R:
R code
observations <- read.table("observations.txt", TRUE)
require(qcc)
attach(observations)
# identify "observation" and "sample" columns as providing the
# observations and sample numbers
observation <- qcc.groups(observation, sample)
# number of observations per sample
n = ncol(observation)
# number of samples in phase I ("setup")
m = length(phase[phase == "setup"]) / n
# we do not plot the phase I ("setup") data, so just provide a filler
setupTimestamps <- rep.int(c(""), m)
# extract the timestamps to display for the phase II ("monitoring") data
monitoringTimestamps <- as.character(timestamp[phase == "monitoring"])
# reduce from one per observation to one per sample
monitoringTimestamps <- monitoringTimestamps[seq(1, length(monitoringTimestamps), n)]
# reduce to one per hour
for (i in 1:length(monitoringTimestamps)) {
minutes <- strsplit(monitoringTimestamps[[i]], ":")[[1]][[2]]
if (minutes != "00") monitoringTimestamps[[i]] <- ""
}
# plot xbar chart
obj <- qcc(data = observation[1:m,],
type = "xbar",
newdata = observation[-(1:m),],
labels = setupTimestamps,
newlabels = monitoringTimestamps,
axes.las = 3,
chart.all = FALSE,
title = "xbar chart for quality characteristic XXX",
xlab = "Sample",
ylab = "Mean value (units)")
Licensing[edit]
|
This file is licensed under the Creative Commons Attribution-Share Alike 3.0 Unported license. | |
https://creativecommons.org/licenses/by-sa/3.0 CC BY-SA 3.0 Creative Commons Attribution-Share Alike 3.0 truetrue |
| Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled GNU Free Documentation License.http://www.gnu.org/copyleft/fdl.htmlGFDLGNU Free Documentation Licensetruetrue |
File history
Click on a date/time to view the file as it appeared at that time.
| Date/Time | Thumbnail | Dimensions | User | Comment | |
|---|---|---|---|---|---|
| current | 21:53, 16 January 2010 | 630 × 629 (37 KB) | DanielPenfield (talk | contribs) | {{Information |Description={{en|1=Example xbar chart for a process that experienced a 1.5σ drift starting at midnight.}} |Source={{own}} |Author=DanielPenfield |Date=2010-01-16 |Permission= |other_versions |
You cannot overwrite this file.
File usage on Commons
There are no pages that use this file.
File usage on other wikis
The following other wikis use this file:
- Usage on en.wikipedia.org
- Usage on fa.wikipedia.org
- Usage on it.wikipedia.org
- Usage on ja.wikipedia.org
- Usage on pt.wikipedia.org
- Usage on sh.wikipedia.org
- Usage on sr.wikipedia.org
- Usage on vi.wikipedia.org
- Usage on zh.wikipedia.org
Metadata
This file contains additional information such as Exif metadata which may have been added by the digital camera, scanner, or software program used to create or digitize it. If the file has been modified from its original state, some details such as the timestamp may not fully reflect those of the original file. The timestamp is only as accurate as the clock in the camera, and it may be completely wrong.
| Short title | Xbar control chart |
|---|