Package Rspc. July 30, 2018

Similar documents
Package fastdummies. January 8, 2018

Package cattonum. R topics documented: May 2, Type Package Version Title Encode Categorical Features

Package weco. May 4, 2018

Package datasets.load

Package ggimage. R topics documented: November 1, Title Use Image in 'ggplot2' Version 0.0.7

Package ggimage. R topics documented: December 5, Title Use Image in 'ggplot2' Version 0.1.0

Package SEMrushR. November 3, 2018

Package labelvector. July 28, 2018

Package canvasxpress

Package geojsonsf. R topics documented: January 11, Type Package Title GeoJSON to Simple Feature Converter Version 1.3.

Package catenary. May 4, 2018

Package ECctmc. May 1, 2018

Package diagis. January 25, 2018

Package repec. August 31, 2018

Package validara. October 19, 2017

Package knitrprogressbar

Package spark. July 21, 2017

Package stapler. November 27, 2017

Package RODBCext. July 31, 2017

Package reval. May 26, 2015

Package narray. January 28, 2018

Package kdtools. April 26, 2018

Package fingertipsr. May 25, Type Package Version Title Fingertips Data for Public Health

Package sfc. August 29, 2016

Package bisect. April 16, 2018

Package rgho. R topics documented: January 18, 2017

Package fitur. March 11, 2018

Package nngeo. September 29, 2018

Package raker. October 10, 2017

Package editdata. October 7, 2017

Package statip. July 31, 2018

Package meme. November 2, 2017

Package qicharts. October 7, 2014

Package rsppfp. November 20, 2018

Package pwrab. R topics documented: June 6, Type Package Title Power Analysis for AB Testing Version 0.1.0

Package vinereg. August 10, 2018

Package c14bazaar. October 28, Title Download and Prepare C14 Dates from Different Source Databases Version 1.0.2

Package datapasta. January 24, 2018

Package gtrendsr. August 4, 2018

Package kirby21.base

Package lumberjack. R topics documented: July 20, 2018

Package ggqc. R topics documented: January 30, Type Package Title Quality Control Charts for 'ggplot' Version Author Kenith Grey

Package gtrendsr. October 19, 2017

Package mdftracks. February 6, 2017

Package deductive. June 2, 2017

Package meme. December 6, 2017

Package calpassapi. August 25, 2018

Package projector. February 27, 2018

Package githubinstall

Package utf8. May 24, 2018

Package readxl. April 18, 2017

Package confidence. July 2, 2017

Package gggenes. R topics documented: November 7, Title Draw Gene Arrow Maps in 'ggplot2' Version 0.3.2

Package spelling. December 18, 2017

Package robotstxt. November 12, 2017

Package simsurv. May 18, 2018

Package ecoseries. R topics documented: September 27, 2017

Package opencage. January 16, 2018

Package tidyimpute. March 5, 2018

Package qicharts2. March 3, 2018

Package splithalf. March 17, 2018

Package clipr. June 23, 2018

Package eply. April 6, 2018

Package rprojroot. January 3, Title Finding Files in Project Subdirectories Version 1.3-2

Package BiocManager. November 13, 2018

Package liftr. R topics documented: May 14, Type Package

Package dat. January 20, 2018

Package nlgeocoder. October 8, 2018

Package zebu. R topics documented: October 24, 2017

Package barcoder. October 26, 2018

Package hyphenatr. August 29, 2016

Package fst. December 18, 2017

Package docxtools. July 6, 2018

Package d3plus. September 25, 2017

Package tidytree. June 13, 2018

Package CMPControl. February 19, 2015

Package Numero. November 24, 2018

Package bigreadr. R topics documented: August 13, Version Date Title Read Large Text Files

Package svalues. July 15, 2018

Package rzeit2. January 7, 2019

Package tm.plugin.lexisnexis

Package IATScore. January 10, 2018

Package shinyfeedback

Package fusionclust. September 19, 2017

Package jstree. October 24, 2017

Package zoomgrid. January 3, 2019

Package blandr. July 29, 2017

Package QCAtools. January 3, 2017

Package edfreader. R topics documented: May 21, 2017

Package TVsMiss. April 5, 2018

Package mapsapi. March 12, 2018

Package semver. January 6, 2017

Package haplor. November 1, 2017

Package jdx. R topics documented: January 9, Type Package Title 'Java' Data Exchange for 'R' and 'rjava'

Package graphframes. June 21, 2018

Package estprod. May 2, 2018

Package tropicalsparse

Package Rglpk. May 18, 2017

Package profvis. R topics documented:

Package fitbitscraper

Transcription:

Type Package Title Nelson Rules for Control Charts Version 1.2.2 Package Rspc July 30, 2018 Maintainer Stanislav Matousek (MSD) <rspc@merck.com> Implementation of Nelson rules for control charts in 'R'. The 'Rspc' implements some Statistical Process Control methods, namely Levey-Jennings type of I (individuals) chart, Shewhart C (count) chart and Nelson rules (as described in Montgomery, D. C. (2013) Introduction to statistical quality control. Hoboken, NJ: Wiley.). Typical workflow is taking the time series, specify the control limits, and list of Nelson rules you want to evaluate. There are several options how to modify the rules (one sided limits, numerical parameters of rules, etc.). Package is also capable of calculating the control limits from the data (so far only for i-chart and c- chart are implemented). BugReports https://github.com/merck/spc_package/issues Depends R (>= 3.1.0) License GPL-3 Encoding UTF-8 LazyData true RoygenNote 6.0.1 VignetteBuilder knitr Suggests knitr NeedsCompilation no Author Martin Vagenknecht (MSD) [aut], Jindrich Soukup (MSD) [aut], Stanislav Matousek (MSD) [aut, cre], Janet Alvarado (MSD) [ctb, rev], Merck Sharp & Dohme Corp. a subsidiary of Merck & Co., Inc., Kenilworth, NJ, USA [cph] Repository CRAN Date/Publication 2018-07-30 16:20:06 UTC 1

2 CalculateLimits R topics documented: CalculateLimits....................................... 2 CalculateZoneBorders................................... 3 EvaluateRules........................................ 4 NelsonRules......................................... 5 Rule1............................................ 6 Rule2............................................ 7 Rule3............................................ 7 Rule4............................................ 8 Rule5............................................ 9 Rule6............................................ 10 Rule7............................................ 11 Rule8............................................ 12 SetParameters........................................ 13 Inde 14 CalculateLimits CalculateLimits Evaluates whether to use custom limits or calculate them from the data. CalculateLimits(, lcl = NA, cl = NA, ucl = NA, type = "i", controllimitdistance = 3) lcl cl ucl Lower control limit, single value or NA Central line, single value or NA Upper control limit, single value or NA type Type of control chart, either "i" for i-chart (default) or "c" for c-chart controllimitdistance Multiple of st.dev to be used to calculate limits, possible values: 1, 2, 3 (default); this parameter affect the interpretation of lcl and ucl parameters If at least two limits were provided, the missing ones are calculated from the them. If one or zero limits were provided the rest is computed from data.

CalculateZoneBorders 3 Named list with limits CalculateLimits( = rnorm(10), lcl = NA, cl = 100, ucl = NA, type = 'i') CalculateZoneBorders CalculateZoneBorders Some Nelson rules uses so-called zones. This function calculates the borders of the zones for given limits. CalculateZoneBorders(limits, controllimitdistance = 3) limits List of limits provided by CalculateLimits controllimitdistance Multiple of st.dev to be used to calculate limits, possible values: 1, 2, 3 (default); this parameter affect the interpretation of lcl and ucl parameters Vector of zones limits = CalculateLimits( = rnorm(10), lcl = NA, cl = 100, ucl = NA, type = 'i') CalculateZoneBorders(limits) #limits is object created by CalculateLimits() function

4 EvaluateRules EvaluateRules EvaluateRules Evaluates the selected Nelson rules for a given numerical vector. EvaluateRules(, type = "i", whichrules = 1:8, lcl = NA, cl = NA, ucl = NA, controllimitdistance = 3, returnallselectedrules = F, parrules = NULL) type Series to be evaluated, numerical vector Type of control chart, either "i" for i-chart (default) or "c" for c-chart whichrules Selection of Nelson rules beeing evaluated, vector with numbers from 1 to 8 lcl cl Lower control limit, single numeric value (epected as mean - controllimitdistance * sigma), if missing the function calculates it from data Central line, single numeric value (epected as mean), if missing the function calculates it from data ucl Upper control limit, single numeric value (epected as mean + controllimitdistance * sigma), if missing the function calculates it from data controllimitdistance Multiple of st.dev to be used to calculate limits, possible values: 1, 2, 3 (default); this parameter affect the interpretation of lcl and ucl parameters returnallselectedrules Resulting dataframe will contain all selected rules, either True or False, if missing only valid rules returned parrules Optional parameters for specific rules, for details see SetParameters # Only Rules 1-4 relevant for c-chart. # Check for non negative data for c-chart. # For controllimitdistance less than or equal to 2 disable rule 5. # For controllimitdistance less than or equal to 1 disable rule 5,6,8. # For returnallselectedrules=true columns of invalid rules for given evaluation are filled with NAs. Dataframe containing original vector and rules evaluation

NelsonRules 5 # Evaluate data, use all 8 Nelson rules, limits are specified by user EvaluateRules( = rnorm(10), whichrules = 1:8, lcl = 0, cl = 50, ucl = 100) #Evaluate only rule 1, 3, 5, calculate limits from data using c-chart formula, #use 2 sigma instead of 3, modify default behaviour of rule by pars variable #created by function SetParameters() pars = SetParameters() EvaluateRules( = rpois(10, lambda = 15), type = 'c', whichrules = c(1,3,5), lcl = NA, cl = NA, ucl = NA, controllimitdistance = 2, parrules = pars) # pars is object of optional parameters created by SetParameters() function NelsonRules NelsonRules Auiliary function to calling individual Rule functions. NelsonRules(ruleN, data, zoneb, limits, parrules = NULL,...) rulen data zoneb limits parrules Name of individual Rule function "Rule1" to "Rule8" Data to be checked, numerical vector Vector of zones created by CalculateLimits List of limit created by CalculateLimits List of optional parameters for this particular rule Handling the missing values: Missing values are represented by the symbol NA - not available. Rule 1: NAs do not violate this rule. Rule 2-8: NAs are ignored, they do not break Rule evaluation. NA values are removed from the vector, the rule function is calculated and then the NAs are returned back to it s original position in the vector. Result of individual Rule function with predefined parameters

6 Rule1 Rule1 Rule 1 One point beyond the control limits Rule1(, lcl, ucl, sides,...) lcl ucl sides Lower control limit, single number Upper control limit, single number Monitored side of the process: either "two-sided" (default), "upper" or "lower" inequality used during evaluation parametr sides is internally encoded as: 1 for "two-sided", 2 for "upper", 3 for "lower" Vector of the same length as Rule1( = rnorm(10), lcl = 10, ucl = 100, sides = "two-sided")

Rule2 7 Rule2 Rule 2 Nine points in a row are on one side of the central line. Rule2(, cl, npoints = 9,...) cl npoints central line, single number Sequence of consequtive points to be evaluated inequality used during evaluation Vector of the same length as Rule2( = rnorm(20), cl=0, npoints = 9) Rule3 Rule 3 Si points in a row steadily increasing or decreasing. Rule3(, npoints = 6, convention = 1, equalbreaksseries = 1,...)

8 Rule4 npoints Sequence of consequtive points to be evaluated convention Calculation according to minitab or jmp (see details) equalbreaksseries Equal values break consequtive series of points parameter equalbreakseries is internally encoded as: 1 for TRUE and 2 for FALSE parameter convention is internally encoded as: 1 for minitab and 2 for jmp Difference in convention parameter is as follows: minitab - seven points in a row steadily increasing or decreasing jmp - si points in a row steadily increasing or decreasing Vector of the same length as Rule3( = rnorm(20), npoints = 6, convention = 1, equalbreaksseries = 1) Rule4 Rule 4 Fourteen or more points in a row alternate in direction, increasing then decreasing. Rule4(, npoints = 14, convention = 1,...) npoints Sequence of consequtive points to be evaluated convention Calculation according to minitab or jmp (see details)

Rule5 9 parameter convention is internally encoded as: 1 for minitab and 2 for jmp Difference in convention parameter is as follows: minitab - 15 or more points (14 changes of direction) in a row alternate in direction, increasing then decreasing jmp - 14 or more points (13 changes of direction) in a row alternate in direction, increasing then decreasing Vector of the same length as Rule4( = rnorm(20), npoints = 14,convention = 1) Rule5 Rule 5 Two out of three consecutive points beyond the 2*sigma limits on same side of center line. Rule5(, zoneb, minnpoints = 2, npoints = 3,...) zoneb minnpoints npoints Vector of zone borders Minimal number of points in a sequence violating a rule Sequence of consequtive points to be evaluated inequality used during evaluation Rule is violated also if the first two points are beyond the 2*sigma limits During calculation of EvaluateRules function wiht controllimitdistance <= 2, the evaluation of this rule is suppressed

10 Rule6 Vector of the same length as limits = CalculateLimits( = rnorm(10), lcl = NA, cl = 100, ucl = NA, type = 'i') zones = CalculateZoneBorders(limits) Rule5( = rnorm(20), zoneb = zones, minnpoints = 2, npoints = 3) #zones is object created by function CalculateZoneBorders() Rule6 Rule 6 Four or five out of five points in a row are more than 1 standard deviation from the mean in the same direction. Rule6(, zoneb, minnpoints = 4, npoints = 5,...) zoneb Vector of zone borders minnpoints Minimal number of points in a sequence violating a rule npoints Sequence of consequtive points to be evaluated inequality used during evaluation Rule is violated also if the first four points are beyond the 1 standard deviation from the mean During calculation of EvaluateRules function wiht controllimit- Distance <= 1, the evaluation of this rule is suppressed Vector of the same length as

Rule7 11 limits = CalculateLimits( = rnorm(10), lcl = NA, cl = 100, ucl = NA, type = 'i') zones = CalculateZoneBorders(limits) Rule6( = rnorm(20), zoneb = zones, minnpoints = 4, npoints = 5) #zones is object created by function CalculateZoneBorders() Rule7 Rule 7 Fifteen points in a row are all within 1 standard deviation of the mean on either side of the mean. Rule7(, npoints = 15, zoneb,...) npoints Sequence of consequtive points to be evaluated zoneb Vector of zone borders equality used during evaluation Vector of the same length as limits = CalculateLimits( = rnorm(10), lcl = NA, cl = 100, ucl = NA, type = 'i') zones = CalculateZoneBorders(limits) Rule7( = rnorm(20), zoneb = zones, npoints = 15) #zones is object created by function CalculateZoneBorders()

12 Rule8 Rule8 Rule 8 Eight points in a row outside 1 standard deviation of the mean in both directions. Rule8(, npoints = 8, zoneb,...) npoints Sequence of consequtive points to be evaluated zoneb Vector of zone borders inequality used during evaluation During calculation of EvaluateRules function wiht controllimit- Distance <= 1, the evaluation of this rule is suppressed Vector of the same length as limits = CalculateLimits( = rnorm(10), lcl = NA, cl = 100, ucl = NA, type = 'i') zones = CalculateZoneBorders(limits) Rule8( = rnorm(20), zoneb = zones, npoints = 8) #zones is object created by function CalculateZoneBorders()

SetParameters 13 SetParameters SetParameters Creates optional parameters with default settings. SetParameters() The function is called without any parameter. If you want to modify any or the rules setting, modify the result of this function and plug it to EvaluateRules s parrules parameter. List of optional parameters pars <- SetParameters() pars$rule1$sides <- "upper" #function doos not need any input parameters

Inde CalculateLimits, 2, 3, 5 CalculateZoneBorders, 3 EvaluateRules, 4, 13 NelsonRules, 5 Rule1, 6 Rule2, 7 Rule3, 7 Rule4, 8 Rule5, 9 Rule6, 10 Rule7, 11 Rule8, 12 SetParameters, 4, 13 14