Giter Site home page Giter Site logo

qicharts2's People

Contributors

andrjohns avatar anhoej avatar katrinleinweber avatar rmadillo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

qicharts2's Issues

"Error in if (getOption("qic.clshade")) { : argument is of length zero"

Hi,

I've just upgraded to qicharts2 0.60 from CRAN (from whatever the previous CRAN release was). I had a fairly straightforward chart plotted with the following code which was working yesterday:

qicharts2::qic(ReportPeriod, TCNoBrainImagingWithin1hrD, TCn72hrs,
  data     = ssnapScores, target = 0.5,
  chart    = 'p',
  title     = 'Proportion not receiving brain imaging within 1hr',
  xlab     = 'Month')

I've tried it today and I get the error message in the title. I'm assuming that the error is suggesting that qic.clshade is NULL, which is clearly an internal function. I can't see any changes to my code - so I don't think I've broken it myself.

Any thoughts what may be going on?

Get violation points using qic chart type pp

Trying to obtain violation list after qic is invoked but only able to see $sigma.signal which is only the count of points beyond control limits.

I think in previous versions was able to get $signals from the object created after qic()

Here my example:

qcc_data = qic(FailTime, Numerato, Denominator,
data=df_data,
chart='pp',
y.percent=TRUE,
decimals=2,
title='P chart',
ylab=NULL,
x.format="%m/%d/%y",
xlab='Month'
)

Results:
summary(qcc_data)
facet1 facet2 part n.obs n.useful longest.run longest.run.max n.crossings
1 1 1 1 89 89 10 9 40
n.crossings.min runs.signal aLCL CL aUCL sigma.signal
1 36 1 0.6569478 0.923569 1 4

CUSUM/bchart Update

Hello!

I am looking for an update on the status of the Bernoulli CUSUM chart, currently labelled as "EXPERIMENTAL." I currently use the qicharts2 package to supply wonderful visuals to my superiors for their SPC charts and am receiving a request for CUSUM charts. Is there anything I should be concerned with in using the current bchart() as it stands?

Thank you.

Wrong calculation of control limits for xbar chart when using freeze or exclude argument

When using the freeze or exclude argument in qic(), the control limits are not correctly calculated. Here’s a simple example:

I generate a data frame with 30 observations (rows), paired into subgroups (group 1 = row 1 and 2; group 2 = row 3 and 4 &c.). I then create an xbar chart using either a) the first 20 observations (10 groups), or b) all observations but with a freeze/exclude value after the first 20 observations. The result should be identical control limits, but they differ, and only the limits from the a) calculations seem to be correct.

# Generate some random data
set.seed(1)
d_full = data.frame(x = c(rnorm(20, 0), rnorm(10, 5)))
d_full$gr = rep(1:15, each = 2)
d1 = d_full[1:20, ]

# Limits: -1.802 to 2.183
qicharts2::qic(gr, x, data=d1, chart="xbar", decimals = 3)

# Limits: -1.775 to 2.156
qicharts2::qic(gr, x, data=d_full, chart="xbar", decimals = 3, freeze=10)
qicharts2::qic(gr, x, data=d_full, chart="xbar", decimals = 3, exclude=11:15)


# With the old qicharts package we get identical limits for
# the two different methods of calculating the limits
# (but the limits differ from the qicharts2 limits!)
qicharts::qic(x, x = gr, data=d1, chart="xbar", decimals = 3)
qicharts::qic(x, x = gr, data=d_full, chart="xbar", decimals = 3, freeze=10)

# The qicharts2 limits for d1 seems to be correct,
# i.e. they agree with the qcc package
library(qcc)
qcc::qcc(t(unstack(d1)), type="xbar") # Quick and ugly code for generating the chart
qcc::qcc(t(unstack(d1)), newdata=t(unstack(d_full))[11:15,], type="xbar")

facet by pre/post intervention

Great package here! I work on the same team as Paul from earlier requests. I would like to be able to use an intervention variable as the facet variable and it doesn't seem to respect the scales = "free_x" argument on the left-hand side. The effect I'm looking for is similar to the freeze argument. I am building a dashboard where the user can toggle between week, month, or quarter and this would be easier than creating an if statement to find the number of data points to freeze. For the chart to have the same look on both sides, I would also like to be able to pass along space = "free_x".

I hope this is something you can implement.

cabg_month <-
    cabg %>% 
    mutate(month = floor_date(date, "month"),
           death = as.logical(death),
           intervention = ifelse(year(date) < 2014, "baseline", "intervention"),
           n = 1)

qic(x = month, 
    y = death, 
    n = n,
    data = cabg_month,
    facets = ~intervention,
    scales = "free_x",
    chart = 'p')

image

cabg_month %>% 
group_by(month, intervention) %>% 
summarise(death = sum(death)/sum(n)) %>%
ungroup() %>% 
ggplot() +
    geom_line(aes(x = month, y = death)) +
    facet_grid(~intervention, scales = "free_x", space = "free_x") +
    scale_x_date(breaks = date_breaks("2 months"),
                 labels = date_format("%m/%y"))

image

Match line colors to points

Would you consider changing the line color to match the points? I like that the excluded points are greyed out and believe that greying out the line helps direct the users eye to focus on non-excluded points. Similarly, I like that the pink points pop more when the line changes color along with it.

image

Here is the code I used

library(tidyverse)
library(qicharts2)

qic_plot <-
  qic(
    data = cdi,
    x = month,
    exclude = c(3, 20),
    y = n,
    chart = "c"
  )

plot_data <- 
  qic_plot$data %>%
  arrange(x, facet1, facet2, part, linecol) %>%
  mutate(
    dotcol =
      recode(dotcol,
        col1 = "grey",
        col2 = "dodgerblue",
        col3 = "deeppink",
        col4 = "green",
        col5 = "grey"
      ),
    next_dotcol = lead(dotcol, default = last(dotcol)),
    prev_dotcol = lag(dotcol, default = first(dotcol)),
    new_linecol =
      case_when(
        next_dotcol == dotcol ~ dotcol,
        next_dotcol == "grey" ~ "grey",
        prev_dotcol == "grey" ~ "grey",
        next_dotcol == "deeppink" ~ "deeppink",
        TRUE ~ dotcol
      )
  )

ggplot(plot_data, aes(x = x, y = y, group = 1)) +
  geom_line(aes(color = new_linecol), size = 1) +
  geom_point(aes(color = dotcol), size = 2) +
  scale_color_identity() +
  theme_minimal()

CL on xbar different to standard formulas

Dear Jacob,

From work with my undergraduate students it seems that the part where qic calculates std.dev it gives a different value to what we expect:
we could use the following from general stats for 25 samples of 17 each:
ss <- 1:25
for (j in 1:25){
scalc <- 0
for (k in 1:17){
scalc <- scalc + ((manualSDC[k,j]-mean(manualSDC[,j]))^2) #where manualSDC has 17 rows & 25 columns
}
ss[j] <- (scalc/24)^0.5
}
ssMean <- mean(ss) #calculates sbar

our sbar is different from the one you calculate in line 191 in helper.functions:
stdev <- sqrt(sum((x$y.length[base] - 1) * x$y.sd[base]^2, na.rm = TRUE) /
sum(x$y.length[base] - 1, na.rm = TRUE))

I'm not quite sure how your function gets sd in one function

Could you help me understand where the difference comes from?

Kind regards,

Part & Freeze don't work together

We love this function at work. We want to be able to part a baseline mean and then freeze the new mean after a set number of points. It appears we cannot use both part and freeze together when using qic(). Below is an example of the desired output but not a good example of best practices.

Tagging @pwildenhain to follow the discussion.

Thanks a ton.

image

df <-
  hospital_infections %>% 
  filter(infection == "UTI",
         hospital == "BOH")

qic(month, n, days,
    data = df,
    chart  = 'u',
    point.size = 4,
    part = 5,
    freeze = 9)

Suggestion - Ability to select Testing Variation rules

Hi Anhoej,

I have run the same data with qcc/minitab and qicharts2 and I get slightly different results. Qicharts2 gives slightly narrow band. I assume this is because qcc(type = "xbar.one") uses Shewart rules where as qicharts2 uses Shewarts rules + Anhoej's rules.

Qicharts2 I am finding much nicer to use then qcc because of the integration with ggplot. It would be great to be able to select type in qicharts2 too. Such as "anhoej = true" or type = c(shewart, anhoej, WH).

Simply put, I might have to use qcc because the customer expects Shewarts rules.

Cheers,

Aaron

Exclude different points for different facets

Is there a possibility to exclude different points for different facets? For example, if I select one of the posted examples:

qic(month, n,
n = days,
data = hospital_infections,
facets = infection ~ hospital,
chart = 'u',
multiply = 10000,
title = 'Hospital infection rates',
ylab = 'Number of infections per 10.000 risk days',
xlab = 'Month')

And get this plot:
Captura de pantalla 2023-03-29 a las 21 05 01

I can define a random vector to remove points:

to_exclude <- c(1:5, 10:12)

qic(month, n,
n = days,
data = hospital_infections,
facets = infection ~ hospital,
chart = 'u',
multiply = 10000,
title = 'Hospital infection rates',
ylab = 'Number of infections per 10.000 risk days',
xlab = 'Month',
exclude = to_exclude)

But then I get the numbers 1 to 5 and 10 to 12 removed from all the control charts:
Captura de pantalla 2023-03-29 a las 21 08 09

Is there a possibility or a workaround to remove different points by referring them to the original dataset? Maybe it could be added by referring to a column of the dataset having a label '1' to remove '0' to use.

Format y as percentage automatically for p charts

Great job on this package! We are going to start using this at my job as the standard for spc graphing in R.

We usually p-charts frequently, and it would be nice if when we have chart = 'p' or chart = 'pp', the y-axis was automatically formatted as a percentage.

Question re XmR chart R

Hi Jacob,
I have a general question re making XmR charts for healthcare quality improvement initiatives and the rules applied for an XmR chart. I need to apply the following:

  1. Any point beyond 3sigma
  2. A shift of 7 points above or below the centre line
  3. A trend of 7 consecutive points all going up or down
  4. Any point above or below 3.27 * average moving range

Is it at all possible to customise the rules in qicharts2 or in other available R packages? Is there any way I can achieve the 4 rules above?

Thanks

Maurizio

Add a return.data argument to qic()

I know you can already get the data from the plot with something like this

plot_data <- qic(...)$data

It would be quicker, especially if you only need the data to have something like this

plot_data <- qic(..., return.data = TRUE)

Returning the aggregated data.frame, without having to plot the data first.

As far as implementation, possibly placing a early return() here right before the data gets plotted, if return.data = TRUE

Looking forward to hearing your thoughts about this feature request 😄

Using tibbletime for date manipulation

We recently released an internal R package for my Quality Improvement team that heavily relies on qic() for it's spc chart functionality. In doing this we added something that I wanted to pitch to you.

We work almost exclusively with logitudinal analyses. To save our team from messing with dplyr::mutate() and lubridate, we decided to utilize functions from the tibbletime package to abstract away the process of date manipulation. Here's a vignette thats shows how well tibbletime works with dplyr.

The end product looks something like this:

qic(data = data, x = date_column, y = metric_column, n = n, period = "monthly")

Where the period argument does the date manipulation on x for you.

If you like this idea I'd be happy to dive more into the specifics and figure out if/how this best fits into your existing API.

Change Text Size of Control Chart UCL and LCL and Mean?

Is there a way to change the font size for the UCL and the LCL in a control chart? I've looked into a few things, and this is likely my ggplot2 ignorance, but I can't seem to find the right geom_x setting to change the font size. Thanks.

using ggplot2 commands to format x and y axis

Love the qichart2 package. Thank you for all your work.

I'm recent working on "p" chart over a series of years.
years are "double".
when I graph the qic chart, the x-axis shows decimals (e.g. 2015.2).

I was hoping to use ggplot2 package commands (https://scales.r-lib.org/index.html), or scale_x_continuous(label = scales::label_comma(accuracy = 1) (https://stackoverflow.com/questions/15622001/how-to-display-only-integer-values-on-an-axis-using-ggplot2)
but I'm having figure out syntax for the qic() function to also respect ggplot.
-I thought it might be possible since per the documentation, I saw that qic() was based on ggplot.

Thank you.

Altering x or y axis through ggplot2 replaces existing scale

When creating a qic-chart, if you want to make changes to the x or y axes with ggplot2-commands outside of the qic-command, without having specified how the x y axis should be inside the qic-command, you replace a previously defined axis and receive a message.

Example:

library(qicharts2)

qic(x = i, y = r, n = n, data = nhs_accidents, chart = "p") +
scale_y_continuous(breaks = c(0.95, 0.96))

Scale for 'y' is already present. Adding another scale for 'y', which will replace the existing scale.

A suggestion for improvement is for the user to not receive the message if they have not specified the x or y axis in the qic-command when they make the axis-specifications with ggplot2.

notes overlap if close together

The notes function is great, though the notes overlap if labeled interventions are too close in days. Is it possible to automatically nudge the labels up or down instead of on same line so they are readable? See example attached.
example

Include arbitrary sigma values in qic-function

Dear anhoey,

im a German psychologist, currently trying to create resolution control charts for a psychotherapy research project.

I came across the excellent qicharts2 package and wondered if there is any possibility to adapt the 3-sigma default
to a user-specified one. (we want to use a sigma of 1 or 1.5.

I couldnt find anything in the documentation so i hope you can point me in the right direction.

Best regards,
Matt

Suggestion: Document difference between title = NULL and title = ""

Hi,

I'm using a Pareto chart in Shiny. The titling is being handled by the Box() function of shiny, so I want the box header to show the title and not the chart.

This is possible by just setting title = "". If title = NULL, then the variable name is used to produce 'Pareto chart of ....'

However, I don't think this is in the documentation - certainly it's not in ?Paretochart. I stumbled upon the solution by accident.

Could you consider adding it to the documentation when you next do any significant work on qicharts()?

If x.period is NULL, qic returns error message

When using time data and defining x.period, qic works just fine:
library(qicharts2)
qic(x = date, y = los, data = cabg, x.period = "month", chart = "xbar")

Also, you can run qic without specifying x.period:
library(qicharts2)
qic(x = date, y = los, data = cabg, chart = "xbar")

But if you define x.period as NULL, the qic command returns an error and the figure is not returned:

library(qicharts2)
qic(x = date, y = los, data = cabg, x.period = NULL, chart = "xbar")
#> Error in cut.POSIXt(x, breaks = x.period): invalid specification of 'breaks'

This is problematic when someone calls the qic-command in a function where x.period is defined as NULL by default.

I think this can be solved by replacing !missing with !is.null in this part of the qic function:

if (inherits(x, c('Date', 'POSIXt'))) { 
x <- as.POSIXct(as.character(x), tz = 'UTC')    
if (!missing(x.period)) {   
x <- as.POSIXct(cut(x, breaks = x.period))  
 }  
}

xbar control limits disappear for large subgroup sizes

When I try to create an xbar chart, with a large N size, the control limits disappear from my chart

Here's the reproduced example from the vignette

cabg <- cabg %>% 
  mutate(month = as.Date(cut(date, 'month')))

qic(month, age, data  = cabg, chart = "xbar")

image

However, when I scale up the data set, some of my control limits disappear

cabg_big <- rbind(cabg, cabg, cabg, cabg, cabg)

qic(month, age, data  = cabg_big, chart = "xbar")

image

I get this warning message: In c4(n) : value out of range in 'gammafn'. When I tested the c4() function, I saw that error message specifically occurs when n > 343

> qicharts2:::c4(343)
[1] 0.9992693
> qicharts2:::c4(344)
[1] Inf
Warning message:
In qicharts2:::c4(344) : value out of range in 'gammafn'

Can you help me understand why this is happening?

part parameter as character vector – bug with subgrouped data?

Thank you very much for the package – I’ve been experimenting with it and making demos for my NHS clinical science students (masters and doctoral level).

Apologies if I’m missing something, but does feeding the qic ‘part’ parameter a “character vector indicating chart parts” work as intended for data with subgroups? Or at least could it work in a more friendly way?!

A convenient way. I suggest, to feed the part parameter is from a character variable column [e.g. “Regime”] of the data dataframe which the user feeds to qic, which holds the part labels e.g. “baseline”, “PDSA1”, “PDSA2” etc.
This works fine with “i” etc. charts but not with “xbar” etc (subgrouped data).

Looking at plot$data$part, qic seems to be using the number of rows of the ORIGINAL (user) dataframe that have each part label (character variable value) to assign the plot$data$part counter, rather than counting the number of SUBGROUPS.
Since “xbar” etc charts work from qic-calculated subgroup data, plot$data has fewer rows than the ORIGINAL (user) dataframe!
So, the splitting into parts goes wrong, and can generate a warning message.

I can write some extra code to calculate the datapoint (sequence) split numbers, and so feed the qic parts parameter an integer vector, and also extract the part labels to feed to qic,
but internal calculation of both in qic from a character variable column in the original data would be much more convenient!

Example of problem:

######### PROBLEM with parts

N1 = 20
df1 <- data.frame(Sequence = 1:N1,
Regime = replicate(N1, "Baseline"),
metric_value = round(rnorm(n = N1, mean = 5.5, sd = 2)))
N2 = 100
df2 <- data.frame(Sequence = (N1+1):(N1+N2),
Regime = replicate(N2, "PDSA1"),
metric_value = round(rnorm(n = N2, mean = 4, sd = 1.7)))
N3 = 100
df3 <- data.frame(Sequence = (N1+N2+1):(N1+N2+N3),
Regime = replicate(N3, "PDSA2"),
metric_value = round(rnorm(n = N3, mean = 3.5, sd = 1)))

data.df <- rbind(df1, df2, df3) %>%
mutate(Subgroup = ceiling(Sequence/5))

plot <- qic(x = Sequence,
y = metric_value,
data = data.df,
chart = 'i',
part = Regime)

this works fine (though the default X axis title is "Subgrounp" rather than "Sequence")

plot

plot <- qic(x = Subgroup,
y = metric_value,
data = data.df,
chart = 'xbar',
part = Regime)

this produces a warning message:

"Length of part.labels argument must match the number of parts to label."

plot
plot$data

we can see from the plot and plot$data$part that it has considered the first 20 subgroups (80 original datapoints)

to be part = 1 rather than the first 4 (20 original datapoints)

WORKAROUND for part splits with subgroup data

temp <- data.df %>%
distinct(Subgroup, Regime) %>%
group_by(Regime) %>%
mutate(points = n()) %>%
distinct(Regime, .keep_all = TRUE) %>%
ungroup %>%
mutate(cumpoints = cumsum(points))

part_breaks = temp$cumpoints
part_labels = temp$Regime

plot <- qic(x = Subgroup,
y = metric_value,
data = data.df,
chart = 'xbar',
part = part_breaks,
part.labels = part_labels
)
plot

plot$data

Error with X-axis and Dates

Hello,

Using the following code:

library(qicharts2)
Test <- read.csv('/home/jdtanner/Documents/Test.csv',head=TRUE,sep=",",stringsAsFactors = FALSE)
Test$Date <- as.Date(Test$Date,"%d/%m/%y")
qic(Date, Incidents, chart='run',data=Test, title='Incident QIC', ylab='Incident Count', xlab='Date',decimals=0,x.format="%d/%m/%y",x.angle=45)

With the following data in Test.csv:

Date,Incidents
27/11/17,241
26/11/17,228
25/11/17,286
24/11/17,285
23/11/17,267
22/11/17,293
21/11/17,298
20/11/17,217
19/11/17,313
18/11/17,327
17/11/17,262
16/11/17,294
15/11/17,289
14/11/17,274
13/11/17,205
12/11/17,290
11/11/17,303
10/11/17,262
09/11/17,288
08/11/17,245
07/11/17,246
06/11/17,233
05/11/17,288
04/11/17,309
03/11/17,279
02/11/17,265
01/11/17,
31/10/17,273
30/10/17,249
29/10/17,310
28/10/17,306
27/10/17,295
26/10/17,271
25/10/17,299

Yields a graph (as attached) with an incorrect x-axis. The final date value on the x-axis should be the latest date, but it is one day out; this is the same for all of the data.

Any ideas?
John
rplot

Theoretically question about integration with infer and bootstrapping to draw Confidence Intervals.

This is ... I suspect ... more my lack of total statistical understanding.
-if so, apologies in advance.

It is my understanding that the qic() function (particularly with specification chart = '') generates 3 sigma limits by the the associate distribution with the chart as you've detailed. (beautifully written vignette. I've referred to it so many times).

I was also reading about Bootstrapping here (https://moderndive.com/8-confidence-intervals.html#bootstrap-process), with interesting comment about pro/cons of theory based vs. simulation based (section 8.7).

so, in the vignette, you generated a 24 values using rnorm(24) with seed of 19 + added a moderate variation with y[13:24] <- rnorm(12, mean = 2).

summary(o), gives the CL (aLCL, aUCL, to be -2.11, and 4.23) when using I chart (Gaussian distribution).

So, what I attempted to do was the bootstrap (sampling with distribution) to generate confidence limits.

So, I did this:

y2 <- as.data.frame(y)

Then,

y2 %>%
specify( response = y) %>%
generate(reps = 1000, type = "bootstrap") %>%
calculate(stat = "mean")

I think this generates 1000 repetition of sampling with replacement, and resulting df gives their means.

Now, what I think I want is the CL to identify the Shewhart 3 sigma lines. Which, I used percentile level for 99.7.

y2 %>%
specify( response = y) %>%
generate(reps = 1000, type = "bootstrap") %>%
calculate(stat = "mean") %>%
get_confidence_interval(level = 0.997, type = "percentile")

which results (0.25, 1.86).

I guess my understanding is this
*summary(o) function gives the CI of the 24 points based on the Gaussian distribution specified by "I" chart
CL (-2.11 to 4.23)

*bootstrap method gives the standard error of the distribution of mean of the 24 points.
-It was understanding that the standard errors should be similar.
CL (0.25 to 1.86).

But they clearly are not.
Would you have insight into what I'm missing?

Thanks.

Missing data points

Apologies if I've missed something...
If this is real, it might be something you look at sometime:

When the X axis is time there can be missing datapoints, but we need to keep that placeholder for plots.
The 'i' chart copes with some points being NA, but 'c' treats NA as 0.

with thanks, Nathan

Allow user to get data prior to plotting function

We're making great use of qicharts2 on our team and we would benefit from being able to get the prepared data prior to the plot.
Right now we frequently call qic(...)$data but it takes longer as it goes the the step of creating the plot. If you're open to it, I'm happy to submit a PR.

qicharts2/R/qic.R

Lines 267 to 268 in b938510

d <- qic.agg(d, got.n, part, agg.fun, freeze, exclude,
chart.fun, multiply, dots.only, chart, method, y.neg)

In line 269 we could have:

if (return_data = TRUE) {
  return(d)
}

Suggestion - enable ggplot2 to format the plots in qicharts2

Hi anhoej,

My name is Aaron, I really like the package you have created. If this is the wrong place to put a suggestion, please let me know. My suggestion, may indeed be unnecessary as it may already be possible. But I am too new to advanced R that I have yet to figure it out. I have posted a question about how to use the two packages together on stack overlow just in case it is already possible.

Ideally, I would like to be able to do something like:

ggplot(dataset) + qic(x = Date, y = Approved_Output, chart = "i", x.format = "%d-%m-%Y", xlab="Date",ylab="Individual Value",title="Approved Output")

the main purpose of why I want to do this, is so that I can use the ggplot formatting to improve the look of the qicharts2"s plots.

Regards,

Aaron

UCL formula for MR chart in vignette

In your vignette, appendix 1, I believe the 3 sigma limit for the MR chart should be 3.267MR, not MR + 3.267MR. The R code in the package looks correct.

t-chart (via qic.i) chart calculation question

In the helper functions file, I was wondering whether this was a typo or purposeful to calculate the moving range for the t/i charts:

qic.i <- function(x) {
  base <- x$baseline & x$include
  if (anyNA(x$cl))
    x$cl <- mean(x$y[base], na.rm = TRUE)
  
  # Average moving range
  mr  <- abs(diff(x$y[base] - x$cl[base]))

Typically, the MR is based on the difference between x and x-1, rather than the center line (cl), which is what it looks like this code is doing? Or am I missing how this code worked?

Thanks!

Strange limit change on s chart after initialising

'Dear Jacob,
find below code and attached data
SPCDataFile.TXT

for a problem with the s chart limits as identified by Marinel Wegman in my QA class. In short, when I do a qic(25 samples, s chart) with my first 25 samples only, the limits are different to the limits I get when I do the full data qic(all Samples, schart, freeze=25). Sample size is 17.

The correct limits are calculated in the initial qic(25 samples, s chart). It seems to be wrong in the second qic(all Samples, schart, freeze=25).
The qic(all Samples, Xbarchart, freeze=25) does not give the same problem. Any suggestions regarding this?

Kind regards,
Theuns'

path <- "~/Documents/" #change to your directory where you save SPCDataFile.csv
file <- "SPCDataFile.TXT" # csv file but changed name extention due to github requirement
SPCData <- read.csv(paste(path,file,sep="",collapse = NULL))
numberS <- length(SPCData[,1])/17
#look at an initial schart of the first 425 values or 25 samples
plotInitials <- qic(sample, Delivery_Time,
data = SPCData[1:425,],
chart = 's',
title = 'Average Delivery Ranges(s) SPC',
ylab = 'Days',
xlab = 'Sample',
freeze = 25)
plotAlls <- qic(sample, Delivery_Time,
data = SPCData[1:2567,],
chart = 's',
title = 'Average Delivery Ranges(s) SPC',
ylab = 'Days',
xlab = 'Sample',
freeze = 25)

summary(plotInitials)
summary(plotAlls)

plotInitialX <- qic(sample, Delivery_Time,
data = SPCData[1:425,],
chart = 'x',
title = 'Average Delivery Ranges(s) SPC',
ylab = 'Days',
xlab = 'Sample',
freeze = 25)
plotAllX <- qic(sample, Delivery_Time,
data = SPCData[1:2567,],
chart = 'x',
title = 'Average Delivery Ranges(s) SPC',
ylab = 'Days',
xlab = 'Sample',
freeze = 25)

summary(plotInitialX)
summary(plotAllX)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.