-
Notifications
You must be signed in to change notification settings - Fork 1
Feature vignette plots 176 #200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
f264834
Add initial improvements to SSA vignettes, including example figures …
HorridTom 08c618f
Add further example time series as package data, and use this to illu…
HorridTom e7c7ede
Improve formatting, references, and data description
HorridTom f44162c
Code review changes
53b43e3
Add explanation of choice for default value of periodMin
HorridTom f82e90f
renv snapshot.
HorridTom a1bf1e2
Revert to master lockfile
HorridTom File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -33,7 +33,10 @@ library(DiagrammeR) | |
| The *autospc* package implements the *Stable Shift Algorithm* for | ||
| re-establishing control limits in statistical process control (SPC) analysis. | ||
| This vignette describes the problem the algorithm addresses, sets out some | ||
| useful terminology, and describes the algorithm. | ||
| useful terminology, describes the algorithm, and explains how to use the | ||
| algorithm log. | ||
| \ | ||
| \ | ||
|
|
||
| # The problem | ||
|
|
||
|
|
@@ -46,7 +49,9 @@ A standard approach in SPC analysis for quality improvement goes as follows: | |
| 2. Extend the baseline limits into the future | ||
| 3. Add data to the chart as time progresses, without updating the control limits | ||
|
|
||
| An example is shown in Figure \@ref(fig:extending-limits) . | ||
| An example is shown in Figure \@ref(fig:extending-limits). This uses the | ||
| `ed_attendances_monthly` dataset included with `autospc`. For more information | ||
| on this dataset see `?ed_attendances_monthly`. | ||
|
|
||
| ```{r extending-limits, fig.width=7, fig.height=9, fig.cap="Extending baseline control limits"} | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider reducing fig.height to make faceted plots more readable. |
||
| facet_stages( | ||
|
|
@@ -74,6 +79,8 @@ the new process. Whilst various textbooks and online resources offer opinions on | |
| this issue, there is no universally accepted approach. The Stable Shift | ||
| Algorithm (SSA) offers an automated, consistent and rigorous approach to | ||
| re-establishing control limits. | ||
| \ | ||
| \ | ||
|
|
||
| # The Stable Shift Algorithm | ||
|
|
||
|
|
@@ -82,6 +89,7 @@ re-establishing control limits. | |
| The main idea of the SSA is to only re-establish limits where: | ||
|
|
||
| A. There is evidence that the process has shifted to a new level | ||
|
|
||
| B. This shift persists for long enough to compute new control limits | ||
|
|
||
| In other words, the SSA re-establishes limits at shift rule breaks, provided | ||
|
|
@@ -93,7 +101,10 @@ and describe how it is operationalised in the SSA. | |
| ## Some terminology | ||
|
|
||
| First, it is useful to introduce some terminology. We will refer to Figure | ||
| \@ref(fig:example-1) to iluustrate the concepts introduced in this section. | ||
| \@ref(fig:example-1) to iluustrate the concepts introduced in this section. This | ||
|
derrynlovett marked this conversation as resolved.
Outdated
|
||
| figure shows a C-chart for the first 35 data points of the simulated | ||
| `example_series_2a` data included with `autospc`, which for the purpose of this | ||
| section we shall interpret as daily values of a count measure of interest. | ||
|
|
||
| ```{r example-1, fig.width=7, fig.height=5, fig.cap="Example 1"} | ||
| plot_auto_SPC(example_series_2a %>% | ||
|
derrynlovett marked this conversation as resolved.
|
||
|
|
@@ -151,15 +162,16 @@ rejected or accepted. Candidate limits are formed from the first `periodMin` | |
| points starting at the first point of the triggering rule break, and this | ||
| period is referred to as the *candidate calculation period*. | ||
|
|
||
| In Figure \@ref(fig:example-1), there are fewer than `periodMin` (here 21) points on or | ||
| after the start of the triggering rule break (day 22), so it is not possible to | ||
| re-establish limits at day 22, and there are no candidate limits to consider. | ||
| In Figure \@ref(fig:example-1), there are fewer than `periodMin` (here 21) | ||
| points on or after the start of the triggering rule break (day 22), so it is not | ||
| possible to re-establish limits at day 22, and there are no candidate limits to | ||
| consider. | ||
|
|
||
| In Figure \@ref(fig:example-2) we imagine rolling time forward, so that we have more | ||
| data to add to the chart in \@ref(fig:example-1). Figure \@ref(fig:example-2) | ||
| shows the data against the (baseline) calculation limits. Figure | ||
| \@ref(fig:example-3) shows candidate limits established at the start of the | ||
| triggering rule break, i.e. day 22. | ||
| In Figure \@ref(fig:example-2) we imagine rolling time forward, so that we have | ||
| more data to add to the chart in \@ref(fig:example-1). Figure | ||
| \@ref(fig:example-2) shows the data against the (baseline) calculation limits. | ||
| Figure \@ref(fig:example-3) shows candidate limits established at the start of | ||
| the triggering rule break, i.e. day 22. | ||
|
|
||
| ```{r example-2, fig.width=7, fig.height=5, fig.cap="Example 2"} | ||
| plot_auto_SPC(example_series_2a, | ||
|
|
@@ -288,7 +300,7 @@ The algorithm is visualised in the flow chart below. | |
| ```{r 5.1, fig.width=7, fig.height=7} | ||
| grViz(autospc:::algorithm_flow_chart_string) | ||
| ``` | ||
|
|
||
| \ | ||
|
|
||
| # Using the algorithm log | ||
|
|
||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couldn't add comment to unchanged code.
Line 281, suggest add "is" to read:
i. If there is at least...There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible, and valid, to change the y-axis lower limit to remove whitespace, rather than starting at 0?
Particularly in Figure 2.1 where 0 to ~8,000 is just whitespace in each of the facet plots.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At present the
override_y_limargument ofplot_auto_SPC()for some reason only controls the upper limit of the y-axis. This should be changed though - are you ok to add an issue for this? I suggest leaving as is until this new feature is implemented. May not have time before publication of the paper but let's see.