Type: | Package |
Title: | Dynamic Screening Systems |
Version: | 1.0 |
Date: | 2022-07-04 |
Maintainer: | Lu You <Lu.You@epi.usf.edu> |
Description: | In practice, we will encounter problems where the longitudinal performance of processes needs to be monitored over time. Dynamic screening systems (DySS) are methods that aim to identify and give signals to processes with poor performance as early as possible. This package is designed to implement dynamic screening systems and the related methods. References: Qiu, P. and Xiang, D. (2014) <doi:10.1080/00401706.2013.822423>; Qiu, P. and Xiang, D. (2015) <doi:10.1002/sim.6477>; Li, J. and Qiu, P. (2016) <doi:10.1080/0740817X.2016.1146423>; Li, J. and Qiu, P. (2017) <doi:10.1002/qre.2160>; You, L. and Qiu, P. (2019) <doi:10.1080/00949655.2018.1552273>; Qiu, P., Xia, Z., and You, L. (2020) <doi:10.1080/00401706.2019.1604434>; You, L., Qiu, A., Huang, B., and Qiu, P. (2020) <doi:10.1002/bimj.201900127>; You, L. and Qiu, P. (2021) <doi:10.1080/00224065.2020.1767006>. |
License: | GPL-2 | GPL-3 |
Imports: | Rcpp (≥ 1.0.0), utils, stats, graphics, ggplot2, gridExtra |
LinkingTo: | Rcpp, RcppArmadillo |
RoxygenNote: | 7.1.2 |
Encoding: | UTF-8 |
Suggests: | knitr, rmarkdown |
VignetteBuilder: | knitr |
Depends: | R (≥ 2.10) |
LazyData: | true |
NeedsCompilation: | yes |
Packaged: | 2022-07-15 23:39:41 UTC; luyou |
Author: | Lu You [aut, cre], Peihua Qiu [aut] |
Repository: | CRAN |
Date/Publication: | 2022-07-16 09:50:05 UTC |
Calculate ATS
Description
The function calculate_ATS
calculates the average time to signals (ATS) given
a control chart matrix and a specified control limit (CL). ATS is defined as the average time from
the start of process monitoring to signal times.
Usage
calculate_ATS(
chart_matrix,
time_matrix,
nobs,
starttime,
endtime,
design_interval,
n_time_units,
time_unit,
CL,
no_signal_action = "omit"
)
Arguments
chart_matrix |
charting statistic values arranged as a numeric matrix. |
time_matrix |
observation times arranged as a numeric matrix. |
nobs |
number of observations arranged as an integer vector. |
starttime |
a numeric vector that gives the start times. |
endtime |
a numeric vector that gives the end times. |
design_interval |
a numeric vector of length two that
gives the left- and right- limits of the design interval.
By default, |
n_time_units |
an integer value that gives the number of basic time units
in the design time interval. |
time_unit |
an optional numeric value of basic time unit. Only used when |
CL |
a numeric value specifying the control limit. |
no_signal_action |
a character specifying the method to use when a signal is not given to a process.
If |
Details
Calculate ATS
Value
a numeric value, the ATS given the charting statistics and the control limit.
References
Qiu, P. and Xiang, D. (2014). Univariate dynamic screening system: an approach for identifying individuals with irregular longitudinal behavior. Technometrics, 56:248-260.
Qiu, P., Xia, Z., and You, L. (2020). Process monitoring roc curve for evaluating dynamic screening methods. Technometrics, 62(2).
Examples
data("data_example_long_1d")
result_pattern<-estimate_pattern_long_1d(
data_matrix=data_example_long_1d$data_matrix_IC,
time_matrix=data_example_long_1d$time_matrix_IC,
nobs=data_example_long_1d$nobs_IC,
design_interval=data_example_long_1d$design_interval,
n_time_units=data_example_long_1d$n_time_units,
estimation_method="meanvar",
smoothing_method="local linear",
bw_mean=0.1,
bw_var=0.1)
result_monitoring<-monitor_long_1d(
data_matrix_new=data_example_long_1d$data_matrix_OC,
time_matrix_new=data_example_long_1d$time_matrix_OC,
nobs_new=data_example_long_1d$nobs_OC,
pattern=result_pattern,
side="upward",
chart="CUSUM",
method="standard",
parameter=0.5)
result_ATS<-calculate_ATS(
chart_matrix=result_monitoring$chart,
time_matrix=data_example_long_1d$time_matrix_OC,
nobs=data_example_long_1d$nobs_OC,
starttime=rep(0,nrow(data_example_long_1d$time_matrix_OC)),
endtime=rep(1,nrow(data_example_long_1d$time_matrix_OC)),
design_interval=data_example_long_1d$design_interval,
n_time_units=data_example_long_1d$n_time_units,
CL=2.0)
Calculate Signal Times
Description
The function calculate_signal_times
calculates the time to signals given
a control chart matrix and a specified control limit (CL).
Usage
calculate_signal_times(
chart_matrix,
time_matrix,
nobs,
starttime,
endtime,
design_interval,
n_time_units,
time_unit,
CL
)
Arguments
chart_matrix |
a matrix of charting statistic values. |
time_matrix |
a matrix of observation times. |
nobs |
number of observations arranged as an integer vector. |
starttime |
a vector of times from the start of monitoring. |
endtime |
a vector of times from the start of monitoring. |
design_interval |
a numeric vector of length two that
gives the left- and right- limits of the design interval.
By default, |
n_time_units |
an integer value that gives the number of basic time units
in the design time interval. |
time_unit |
an optional numeric value of basic time unit. Only used when |
CL |
a numeric value specifying the control limit. |
Details
Calculate Signal Times
Value
A list of two vectors:
$signal_times |
times to signals, a numeric vector. |
$signals |
whether the subject received signals, a logical vector. |
References
Qiu, P. and Xiang, D. (2014). Univariate dynamic screening system: an approach for identifying individuals with irregular longitudinal behavior. Technometrics, 56:248-260.
Qiu, P., Xia, Z., and You, L. (2020). Process monitoring roc curve for evaluating dynamic screening methods. Technometrics, 62(2).
Examples
data("data_example_long_1d")
result_pattern<-estimate_pattern_long_1d(
data_matrix=data_example_long_1d$data_matrix_IC,
time_matrix=data_example_long_1d$time_matrix_IC,
nobs=data_example_long_1d$nobs_IC,
design_interval=data_example_long_1d$design_interval,
n_time_units=data_example_long_1d$n_time_units,
estimation_method="meanvar",
smoothing_method="local linear",
bw_mean=0.1,
bw_var=0.1)
result_monitoring<-monitor_long_1d(
data_matrix_new=data_example_long_1d$data_matrix_OC,
time_matrix_new=data_example_long_1d$time_matrix_OC,
nobs_new=data_example_long_1d$nobs_OC,
pattern=result_pattern,
side="upward",
chart="CUSUM",
method="standard",
parameter=0.5)
result_signal_times<-calculate_signal_times(
chart_matrix=result_monitoring$chart,
time_matrix=data_example_long_1d$time_matrix_OC,
nobs=data_example_long_1d$nobs_OC,
starttime=rep(0,nrow(data_example_long_1d$time_matrix_OC)),
endtime=rep(1,nrow(data_example_long_1d$time_matrix_OC)),
design_interval=data_example_long_1d$design_interval,
n_time_units=data_example_long_1d$n_time_units,
CL=2.0)
A simulated dataset with univariate data
Description
A simulated univariate longitudinal dataset for demonstration.
Usage
data(data_example_long_1d)
Format
An object of class list
of length 9.
Details
Data Example: Univariate Longitudinal Data
Value
A list of the following components
$data_matrix_IC |
The data matrix for IC data. |
$time_matrix_IC |
The time matrix for IC data. |
$nobs_IC |
Number of observations for each IC process. |
$data_matrix_OC |
The data matrix for OC data. |
$time_matrix_OC |
The time matrix for OC data. |
$nobs_OC |
Number of observations for each OC process. |
$design_interval |
The design interval. |
$n_time_units |
Number of time units in the design interval. |
$time_unit |
The time unit. |
Examples
data(data_example_long_1d)
A simulated dataset with multivariate longitudinal data
Description
A simulated univariate longitudinal dataset for demonstration.
Usage
data(data_example_long_md)
Format
An object of class list
of length 9.
Details
Data Example: Multivariate Longitudinal Data
Value
A list of the following components
$data_array_IC |
The data array for IC data. |
$time_matrix_IC |
The time matrix for IC data. |
$nobs_IC |
Number of observations for each IC process. |
$data_array_OC |
The data array for OC data. |
$time_matrix_OC |
The time matrix for OC data. |
$nobs_OC |
Number of observations for each OC process. |
$design_interval |
The design interval. |
$n_time_units |
Number of time units in the design interval. |
$time_unit |
The time unit. |
Examples
data(data_example_long_md)
A simulated dataset with longitudinal and survival data
Description
A simulated univariate longitudinal dataset for demonstration.
Usage
data(data_example_long_surv)
Format
An object of class list
of length 15.
Details
Data Example: Longitudinal and Survival Data
Value
A list of the following components
$data_array_IC |
The data array for IC data. |
$time_matrix_IC |
The time matrix for IC data. |
$nobs_IC |
Number of observations for each IC process. |
$starttime_IC |
Start time of monitoring for IC processes. |
$survtime_IC |
End time of monitoring for IC processes. |
$survevent_IC |
Survival events of IC processes. |
$data_array_OC |
The data array for OC data. |
$time_matrix_OC |
The time matrix for OC data. |
$nobs_OC |
Number of observations for each OC process. |
$starttime_OC |
Start time of monitoring for OC processes. |
$survtime_OC |
End time of monitoring for OC processes. |
$survevent_OC |
Survival events of OC processes. |
$design_interval |
The design interval. |
$n_time_units |
Number of time units in the design interval. |
$time_unit |
The time unit. |
Examples
data(data_example_long_surv)
A real data example on stroke
Description
In this dataset, there are 27 subjects with stroke and 1028 subjects without stroke. Three risk factors, systolic blood pressures, diastolic blood pressures, cholesterol levels, are collected over time at different ages.
Usage
data(data_stroke)
Format
An object of class list
of length 8.
Details
Real Data Example: Stroke Data
Value
A list of the following components
$systolic_ctrl |
A matrix of systolic blood pressures for controls. The [i,j] element is the jth observation of the ith control. |
$diastolic_ctrl |
A matrix of diastolic blood pressures for controls. The [i,j] element is the jth observation of the ith control. |
$cholesterol_ctrl |
A matrix of cholesterol levels for controls. The [i,j] element is the jth observation of the ith control. |
$age_ctrl |
A matrix of the age of observations for controls. The [i,j] element is the age of jth observation for the ith control. |
$systolic_case |
A matrix of systolic blood pressures for cases. The [i,j] element is the jth observation of the ith case. |
$diastolic_case |
A matrix of diastolic blood pressures for cases. The [i,j] element is the jth observation of the ith case. |
$cholesterol_case |
A matrix of cholesterol levels for cases. The [i,j] element is the jth observation of the ith case. |
$age_case |
A matrix of the age of observations for cases. The [i,j] element is the age of jth observation for the ith case. |
Examples
data(data_stroke)
Estimate the Regular Longitudinal Pattern of Univariate Data
Description
Function estimate_pattern_long_1d
estimate the regular longitudinal pattern
of a univariate variable from a dataset of n subjects. This is usually the first step of dynamic screening.
The pattern can be described by mean, variance, covariance, and distribution depending on the estimation method.
When the estimated pattern is used for monitoring new subjects, the collected data from new subjects are
compared to the estimated pattern for monitoring abnormality.
Usage
estimate_pattern_long_1d(
data_matrix,
time_matrix,
nobs,
design_interval,
n_time_units,
time_unit,
estimation_method,
smoothing_method = "local linear",
bw_mean,
bw_var,
bw_cov,
bw_t,
bw_y
)
Arguments
data_matrix |
observed data arranged in a numeric matrix format. |
time_matrix |
observation times arranged in a numeric matrix format. |
nobs |
number of observations arranged as an integer vector. |
design_interval |
a numeric vector of length two that
gives the left- and right- limits of the design interval.
By default, |
n_time_units |
an integer value that gives the number of basic time units
in the design time interval. |
time_unit |
an optional numeric value of basic time unit. Only used when |
estimation_method |
a character specifying the estimation method. |
smoothing_method |
a character value specifying the smoothing method. |
bw_mean |
a numeric value. |
bw_var |
a numeric value. |
bw_cov |
a numeric value. |
bw_t |
a numeric value. |
bw_y |
a numeric value. |
Details
Estimate the Regular Longitudinal Pattern of Univariate Data
Value
a list that stores the estimated longitudinal pattern and model parameters.
If estimation_method="meanvar"
, returns a list of class pattern_long_1d_meanvar
If estimation_method="meanvarcov"
or "meanvarcovmean"
, returns a list of class pattern_long_1d_meanvarcov
If estimation_method="distribution"
, returns a list of class pattern_long_1d_distribution
If estimation_method="distributionvarcov"
, returns a list of class pattern_long_1d_distributionvarcov
$grid |
Discretized design interval. |
$mean_est |
Estimated mean function. |
$var_est |
Estimated variance function. |
$cov_est |
Estimated covariance function. |
References
Qiu, P. and Xiang, D. (2014). Univariate dynamic screening system: an approach for identifying individuals with irregular longitudinal behavior. Technometrics, 56:248-260.
Li, J. and Qiu, P. (2016). Nonparametric dynamic screening system for monitoring correlated longitudinal data. IIE Transactions, 48(8):772-786.
You, L. and Qiu, P. (2019). Fast computing for dynamic screening systems when analyzing correlated data. Journal of Statistical Computation and Simulation, 89(3):379-394.
You, L., Qiu, A., Huang, B., and Qiu, P. (2020). Early detection of severe juvenile idiopathic arthritis by sequential monitoring of patients' health-related quality of life scores. Biometrical Journal, 62(5).
You, L. and Qiu, P. (2021). A robust dynamic screening system by estimation of the longitudinal data distribution. Journal of Quality Technology, 53(4).
Examples
data("data_example_long_1d")
result_pattern<-estimate_pattern_long_1d(
data_matrix=data_example_long_1d$data_matrix_IC,
time_matrix=data_example_long_1d$time_matrix_IC,
nobs=data_example_long_1d$nobs_IC,
design_interval=data_example_long_1d$design_interval,
n_time_units=data_example_long_1d$n_time_units,
estimation_method="meanvar",
smoothing_method="local linear",
bw_mean=0.1,
bw_var=0.1)
Estimate the Regular Longitudinal Pattern of Multivariate Data
Description
Function estimate_pattern_long_md
estimate the regular longitudinal pattern
of multivariate processes from a dataset of n subjects. This is usually the first step of dynamic screening.
The pattern can be described by mean, variance, covariance, and distribution depending on the estimation method.
When the estimated pattern is used for monitoring new subjects, the collected data from new subjects are
compared to the estimated pattern for monitoring abnormality.
Usage
estimate_pattern_long_md(
data_array,
time_matrix,
nobs,
design_interval,
n_time_units,
time_unit,
estimation_method,
bw_mean,
bw_var,
bw_cov
)
Arguments
data_array |
observed data arranged in a 3d array format. |
time_matrix |
observation times arranged in a numeric matrix format. |
nobs |
number of observations arranged as an integer vector. |
design_interval |
a numeric vector of length two that
gives the left- and right- limits of the design interval.
By default, |
n_time_units |
an integer value that gives the number of basic time units
in the design time interval. |
time_unit |
an optional numeric value of basic time unit. Only used when |
estimation_method |
a string. |
bw_mean |
a numeric value. |
bw_var |
a numeric value. |
bw_cov |
a numeric value. |
Details
Estimate the Regular Longitudinal Pattern of Multivariate Data
Value
an object that stores the estimated longitudinal pattern and model parameters.
If estimation_method="meanvar"
, returns an object of class pattern_long_md_meanvar
.
If estimation_method="meanvarcov"
, returns an object of class pattern_long_md_meanvarcov
.
$grid |
Discretized design interval. |
$mean_est |
Estimated mean function. |
$var_est |
Estimated variance function. |
$cov_est |
Estimated covariance function. |
References
Qiu, P. and Xiang, D. (2015). Surveillance of cardiovascular diseases using a multivariate dynamic screening system. Statistics in Medicine, 34:2204-2221.
Li, J. and Qiu, P. (2017). Construction of an efficient multivariate dynamic screening system. Quality and Reliability Engineering International, 33(8):1969-1981.
You, L., Qiu, A., Huang, B., and Qiu, P. (2020). Early detection of severe juvenile idiopathic arthritis by sequential monitoring of patients' health-related quality of life scores. Biometrical Journal, 62(5).
Examples
data("data_example_long_md")
result_pattern<-estimate_pattern_long_md(
data_array=data_example_long_md$data_array_IC,
time_matrix=data_example_long_md$time_matrix_IC,
nobs=data_example_long_md$nobs_IC,
design_interval=data_example_long_md$design_interval,
n_time_units=data_example_long_md$n_time_units,
estimation_method="meanvar",
bw_mean=0.1,
bw_var=0.1)
Estimate the Pattern of Longitudinal and Survival Data
Description
Function estimate_pattern_long_surv
estimate the pattern of longitudinal and survival
data from a dataset of n subjects. This is usually the first step of dynamic screening.
The risk of a subject to event is quantified by a linear combination of longitudinal data by a Cox model.
The risk pattern can be described by mean and variance depending on the estimation method.
When the estimated pattern is used for monitoring new subjects, the collected data from new subjects are
compared to the estimated pattern for monitoring abnormality.
Usage
estimate_pattern_long_surv(
data_array,
time_matrix,
nobs,
starttime,
survtime,
survevent,
design_interval,
n_time_units,
time_unit,
estimation_method = "risk",
smoothing_method = "local linear",
bw_beta,
bw_mean,
bw_var
)
Arguments
data_array |
observed data arranged in a 3d array format. |
time_matrix |
observation times arranged in a numeric matrix format. |
nobs |
number of observations arranged as an integer vector. |
starttime |
a vector of entry times |
survtime |
a vector of survival times |
survevent |
a logical vector of survival events |
design_interval |
a numeric vector of length two that
gives the left- and right- limits of the design interval.
By default, |
n_time_units |
an integer value that gives the number of basic time units
in the design time interval. |
time_unit |
an optional numeric value of basic time unit. Only used when |
estimation_method |
a string. |
smoothing_method |
a string. |
bw_beta |
an integer value. |
bw_mean |
an integer value. |
bw_var |
an integer value. |
Details
Estimate the Pattern of Longitudinal and Survival Data
Value
an object that stores the estimated longitudinal pattern and model parameters.
If estimation_method="risk"
, returns an object of class pattern_long_surv_risk
.
$grid |
discretized design interval. |
$beta_est |
Estimated regression coefficients. |
$mean_risk_est |
Estimated mean function. |
$var_risk_est |
Estimated variance function. |
References
You, L. and Qiu, P. (2020). An effective method for online disease risk monitoring. Technometrics, 62(2):249-264.
Examples
data("data_example_long_surv")
result_pattern<-estimate_pattern_long_surv(
data_array=data_example_long_surv$data_array_IC,
time_matrix=data_example_long_surv$time_matrix_IC,
nobs=data_example_long_surv$nobs_IC,
starttime=data_example_long_surv$starttime_IC,
survtime=data_example_long_surv$survtime_IC,
survevent=data_example_long_surv$survevent_IC,
design_interval=data_example_long_surv$design_interval,
n_time_units=data_example_long_surv$n_time_units,
estimation_method="risk",
smoothing_method="local linear",
bw_beta=0.05,
bw_mean=0.1,
bw_var=0.1)
Evaluate Control Charts (in a single dataset)
Description
The function evaluate_control_chart_one_group
evaluates a control chart when
the in-control (IC) and out-of-control (OC) charting statistics are supplied together in one matrix chart_matrix
.
The logical vector status
indicates if the ith subject is IC or OC.
Usage
evaluate_control_chart_one_group(
chart_matrix,
time_matrix,
nobs,
starttime,
endtime,
status,
design_interval,
n_time_units,
time_unit,
no_signal_action = "omit"
)
Arguments
chart_matrix |
charting statistics arranged as a numeric matrix. |
time_matrix |
observation times arranged as a numeric matrix. |
nobs |
number of observations arranged as an integer vector. |
starttime |
a numeric vector.
|
endtime |
a numeric vector, times when monitoring end.
|
status |
a logical vector.
|
design_interval |
a numeric vector of length two that
gives the left- and right- limits of the design interval.
By default, |
n_time_units |
an integer value that gives the number of basic time units
in the design time interval. |
time_unit |
an optional numeric value of basic time unit. Only used when |
no_signal_action |
a character value specifying how to set signal times when processes with no signals. |
Details
Evaluate Control Charts
Value
an list that stores the evaluation measures.
$thres |
A numeric vector. Threshold values for control limits. |
$FPR |
A numeric vector. False positive rates. |
$TPR |
A numeric vector. True positive rates. |
$ATS0 |
A numeric vector. In-control ATS. |
$ATS1 |
A numeric vector. Out-of-control ATS. |
References
Qiu, P. and Xiang, D. (2014). Univariate dynamic screening system: an approach for identifying individuals with irregular longitudinal behavior. Technometrics, 56:248-260.
Qiu, P., Xia, Z., and You, L. (2020). Process monitoring ROC curve for evaluating dynamic screening methods. Technometrics, 62(2).
Examples
result_pattern<-estimate_pattern_long_surv(
data_array=data_example_long_surv$data_array_IC,
time_matrix=data_example_long_surv$time_matrix_IC,
nobs=data_example_long_surv$nobs_IC,
starttime=data_example_long_surv$starttime_IC,
survtime=data_example_long_surv$survtime_IC,
survevent=data_example_long_surv$survevent_IC,
design_interval=data_example_long_surv$design_interval,
n_time_units=data_example_long_surv$n_time_units,
estimation_method="risk",
smoothing_method="local linear",
bw_beta=0.05,
bw_mean=0.1,
bw_var=0.1)
result_monitoring<-monitor_long_surv(
data_array_new=data_example_long_surv$data_array_IC,
time_matrix_new=data_example_long_surv$time_matrix_IC,
nobs_new=data_example_long_surv$nobs_IC,
pattern=result_pattern,
method="risk",
parameter=0.5)
output_evaluate<-evaluate_control_chart_one_group(
chart_matrix=result_monitoring$chart[1:200,],
time_matrix=data_example_long_surv$time_matrix_IC[1:200,],
nobs=data_example_long_surv$nobs_IC[1:200],
starttime=rep(0,200),
endtime=rep(1,200),
status=data_example_long_surv$survevent_IC[1:200],
design_interval=data_example_long_surv$design_interval,
n_time_units=data_example_long_surv$n_time_units,
no_signal_action="maxtime")
Evaluate Control Charts
Description
The function evaluate_control_chart_two_groups
evaluates control charts when
the in-control (IC) and out-of-control (OC) charting statistics are supplied separately in two matrices
chart_matrix_IC
and chart_matrix_OC
.
Usage
evaluate_control_chart_two_groups(
chart_matrix_IC,
time_matrix_IC,
nobs_IC,
starttime_IC,
endtime_IC,
chart_matrix_OC,
time_matrix_OC,
nobs_OC,
starttime_OC,
endtime_OC,
design_interval,
n_time_units,
time_unit,
no_signal_action = "omit"
)
Arguments
chart_matrix_IC , chart_matrix_OC |
charting statistics arranged as a numeric matrix. |
time_matrix_IC , time_matrix_OC |
observation times arranged as a numeric matrix. |
nobs_IC , nobs_OC |
number of observations arranged as an integer vector. |
starttime_IC , starttime_OC |
a numeric vector that gives the start times. |
endtime_IC , endtime_OC |
a numeric vector that gives the end times. |
design_interval |
a numeric vector of length two that
gives the left- and right- limits of the design interval.
By default, |
n_time_units |
an integer value that gives the number of basic time units
in the design time interval. |
time_unit |
an optional numeric value of basic time unit. Only used when |
no_signal_action |
a character value specifying how to set signal times when processes with no signals. |
Details
Evaluate Control Charts
Value
an list that stores the evaluation measures.
$thres |
A numeric vector. Threshold values for control limits. |
$FPR |
A numeric vector. False positive rates. |
$TPR |
A numeric vector. True positive rates. |
$ATS0 |
A numeric vector. In-control ATS. |
$ATS1 |
A numeric vector. Out-of-control ATS. |
References
Qiu, P. and Xiang, D. (2014). Univariate dynamic screening system: an approach for identifying individuals with irregular longitudinal behavior. Technometrics, 56:248-260.
Qiu, P., Xia, Z., and You, L. (2020). Process monitoring ROC curve for evaluating dynamic screening methods. Technometrics, 62(2).
Examples
pattern<-estimate_pattern_long_1d(
data_matrix=data_example_long_1d$data_matrix_IC,
time_matrix=data_example_long_1d$time_matrix_IC,
nobs=data_example_long_1d$nobs_IC,
design_interval=data_example_long_1d$design_interval,
n_time_units=data_example_long_1d$n_time_units,
estimation_method="meanvar",
smoothing_method="local linear",
bw_mean=0.1,
bw_var=0.1)
chart_IC_output<-monitor_long_1d(
data_example_long_1d$data_matrix_IC,
data_example_long_1d$time_matrix_IC,
data_example_long_1d$nobs_IC,
pattern=pattern,side="upward",chart="CUSUM",
method="standard",parameter=0.2)
chart_OC_output<-monitor_long_1d(
data_example_long_1d$data_matrix_OC,
data_example_long_1d$time_matrix_OC,
data_example_long_1d$nobs_OC,
pattern=pattern,side="upward",chart="CUSUM",
method="standard",parameter=0.2)
output_evaluate<-evaluate_control_chart_two_groups(
chart_matrix_IC=chart_IC_output$chart[1:50,],
time_matrix_IC=data_example_long_1d$time_matrix_IC[1:50,],
nobs_IC=data_example_long_1d$nobs_IC[1:50],
starttime_IC=rep(0,50),
endtime_IC=rep(1,50),
chart_matrix_OC=chart_OC_output$chart[1:50,],
time_matrix_OC=data_example_long_1d$time_matrix_OC[1:50,],
nobs_OC=data_example_long_1d$nobs_OC[1:50],
starttime_OC=rep(0,50),
endtime_OC=rep(1,50),
design_interval=data_example_long_1d$design_interval,
n_time_units=data_example_long_1d$n_time_units,
no_signal_action="maxtime")
Monitor Univariate Longitudinal Data
Description
Monitor Univariate Longitudinal Data
Usage
monitor_long_1d(
data_matrix_new,
time_matrix_new,
nobs_new,
pattern,
side = "upward",
chart = "CUSUM",
method = "standard",
parameter = 0.5,
CL = Inf
)
Arguments
data_matrix_new |
observed data arranged in a numeric matrix format. |
time_matrix_new |
observation times arranged in a numeric matrix format. |
nobs_new |
number of observations arranged as an integer vector. |
pattern |
the estimated regular longitudinal pattern |
side |
a character value specifying the sideness/direction of process monitoring |
chart |
a string specifying the control charts to use.
If |
method |
a string |
parameter |
a numeric value |
CL |
a numeric value speficying the control limit. |
Value
a list that stores the result.
$chart |
a numeric matrix, |
$standardized_values |
a numeric matrix, |
References
Qiu, P. and Xiang, D. (2014). Univariate dynamic screening system: an approach for identifying individuals with irregular longitudinal behavior. Technometrics, 56:248-260.
Li, J. and Qiu, P. (2016). Nonparametric dynamic screening system for monitoring correlated longitudinal data. IIE Transactions, 48(8):772-786.
You, L. and Qiu, P. (2019). Fast computing for dynamic screening systems when analyzing correlated data. Journal of Statistical Computation and Simulation, 89(3):379-394.
You, L., Qiu, A., Huang, B., and Qiu, P. (2020). Early detection of severe juvenile idiopathic arthritis by sequential monitoring of patients' health-related quality of life scores. Biometrical Journal, 62(5).
You, L. and Qiu, P. (2021). A robust dynamic screening system by estimation of the longitudinal data distribution. Journal of Quality Technology, 53(4).
Examples
data("data_example_long_1d")
result_pattern<-estimate_pattern_long_1d(
data_matrix=data_example_long_1d$data_matrix_IC,
time_matrix=data_example_long_1d$time_matrix_IC,
nobs=data_example_long_1d$nobs_IC,
design_interval=data_example_long_1d$design_interval,
n_time_units=data_example_long_1d$n_time_units,
estimation_method="meanvar",
smoothing_method="local linear",
bw_mean=0.1,
bw_var=0.1)
result_monitoring<-monitor_long_1d(
data_matrix_new=data_example_long_1d$data_matrix_OC,
time_matrix_new=data_example_long_1d$time_matrix_OC,
nobs_new=data_example_long_1d$nobs_OC,
pattern=result_pattern,
side="upward",
chart="CUSUM",
method="standard",
parameter=0.5)
Monitor Multivariate Longitudinal Data
Description
Monitor Multivariate Longitudinal Data
Usage
monitor_long_md(
data_array_new,
time_matrix_new,
nobs_new,
pattern,
side = "both",
method = "multivariate EWMA",
parameter = 0.5,
CL = Inf
)
Arguments
data_array_new |
an array of longitudinal observations. |
time_matrix_new |
a matrix of observation times. |
nobs_new |
an integer vector for number of observations. |
pattern |
the estimated regular longitudinal pattern |
side |
a string |
method |
a string |
parameter |
a numeric value. |
CL |
a numeric value |
Value
a list that stores the result.
$chart |
a numeric matrix, |
$SSijk |
a numeric array, the multivariate statistics used in the calculation of control charts.
|
$standardized_values |
a numeric array.
|
References
Qiu, P. and Xiang, D. (2015). Surveillance of cardiovascular diseases using a multivariate dynamic screening system. Statistics in Medicine, 34:2204-2221.
Li, J. and Qiu, P. (2017). Construction of an efficient multivariate dynamic screening system. Quality and Reliability Engineering International, 33(8):1969-1981.
You, L., Qiu, A., Huang, B., and Qiu, P. (2020). Early detection of severe juvenile idiopathic arthritis by sequential monitoring of patients' health-related quality of life scores. Biometrical Journal, 62(5).
Examples
data("data_example_long_md")
result_pattern<-estimate_pattern_long_md(
data_array=data_example_long_md$data_array_IC,
time_matrix=data_example_long_md$time_matrix_IC,
nobs=data_example_long_md$nobs_IC,
design_interval=data_example_long_md$design_interval,
n_time_units=data_example_long_md$n_time_units,
estimation_method="meanvar",
bw_mean=0.1,
bw_var=0.1)
result_monitoring<-monitor_long_md(
data_array_new=data_example_long_md$data_array_OC,
time_matrix_new=data_example_long_md$time_matrix_OC,
nobs_new=data_example_long_md$nobs_OC,
pattern=result_pattern,
side="both",
method="multivariate EWMA",
parameter=0.5)
result_ATS<-calculate_ATS(
chart_matrix=result_monitoring$chart_matrix,
time_matrix=data_example_long_md$time_matrix_OC,
nobs=data_example_long_md$nobs_OC,
starttime=rep(0,nrow(data_example_long_md$time_matrix_OC)),
endtime=rep(1,nrow(data_example_long_md$time_matrix_OC)),
design_interval=data_example_long_md$design_interval,
n_time_units=data_example_long_md$n_time_units,
CL=16.0)
Monitor Longitudinal Data for Survival Outcomes
Description
Monitor Longitudinal Data for Survival Outcomes
Usage
monitor_long_surv(
data_array_new,
time_matrix_new,
nobs_new,
pattern,
method,
parameter = 0.5,
CL = Inf
)
Arguments
data_array_new |
observed data arranged in a numeric array format. |
time_matrix_new |
observation times arranged in a numeric matrix format. |
nobs_new |
number of observations arranged as an integer vector. |
pattern |
the estimated longitudinal and survival pattern from |
method |
a character value specifying the smoothing method |
parameter |
a numeric value. |
CL |
a numeric value specifying the control limit |
Value
a list that stores the result.
$chart |
charting statistics arranged in a matrix. |
$standardized_values |
standardized values arranged in a matrix. |
References
You, L. and Qiu, P. (2020). An effective method for online disease risk monitoring. Technometrics, 62(2):249-264.
Examples
data("data_example_long_surv")
result_pattern<-estimate_pattern_long_surv(
data_array=data_example_long_surv$data_array_IC,
time_matrix=data_example_long_surv$time_matrix_IC,
nobs=data_example_long_surv$nobs_IC,
starttime=data_example_long_surv$starttime_IC,
survtime=data_example_long_surv$survtime_IC,
survevent=data_example_long_surv$survevent_IC,
design_interval=data_example_long_surv$design_interval,
n_time_units=data_example_long_surv$n_time_units,
estimation_method="risk",
smoothing_method="local linear",
bw_beta=0.05,
bw_mean=0.1,
bw_var=0.1)
result_monitoring<-monitor_long_surv(
data_array_new=data_example_long_surv$data_array_OC,
time_matrix_new=data_example_long_surv$time_matrix_OC,
nobs_new=data_example_long_surv$nobs_OC,
pattern=result_pattern,
method="risk",
parameter=0.5)
Evaluate and Visualize Control Charts by PM-ROC curves
Description
Evaluate and Visualize Control Charts by PM-ROC curves
Usage
plot_PMROC(evaluate_control_chart)
Arguments
evaluate_control_chart |
an object of class evaluate_control_chart. |
Value
No return value, called for drawing one PM-ROC plot.
Examples
pattern<-estimate_pattern_long_1d(
data_matrix=data_example_long_1d$data_matrix_IC,
time_matrix=data_example_long_1d$time_matrix_IC,
nobs=data_example_long_1d$nobs_IC,
design_interval=data_example_long_1d$design_interval,
n_time_units=data_example_long_1d$n_time_units,
estimation_method="meanvar",
smoothing_method="local linear",
bw_mean=0.1,
bw_var=0.1)
chart_IC_output<-monitor_long_1d(
data_example_long_1d$data_matrix_IC,
data_example_long_1d$time_matrix_IC,
data_example_long_1d$nobs_IC,
pattern=pattern,side="upward",chart="CUSUM",
method="standard",parameter=0.2)
chart_OC_output<-monitor_long_1d(
data_example_long_1d$data_matrix_OC,
data_example_long_1d$time_matrix_OC,
data_example_long_1d$nobs_OC,
pattern=pattern,side="upward",chart="CUSUM",
method="standard",parameter=0.2)
output_evaluate<-evaluate_control_chart_two_groups(
chart_matrix_IC=chart_IC_output$chart[1:50,],
time_matrix_IC=data_example_long_1d$time_matrix_IC[1:50,],
nobs_IC=data_example_long_1d$nobs_IC[1:50],
starttime_IC=rep(0,50),
endtime_IC=rep(1,50),
chart_matrix_OC=chart_OC_output$chart[1:50,],
time_matrix_OC=data_example_long_1d$time_matrix_OC[1:50,],
nobs_OC=data_example_long_1d$nobs_OC[1:50],
starttime_OC=rep(0,50),
endtime_OC=rep(1,50),
design_interval=data_example_long_1d$design_interval,
n_time_units=data_example_long_1d$n_time_units,
no_signal_action="maxtime")
plot_evaluation(output_evaluate)
plot_PMROC(output_evaluate)
Evaluate and Visualize Control Charts by ROC curves
Description
Evaluate and Visualize Control Charts by ROC curves
Usage
plot_evaluation(evaluate_control_chart)
Arguments
evaluate_control_chart |
an object of class evaluate_control_chart. |
Value
No return value, called for drawing two ROC plots.
Examples
result_pattern<-estimate_pattern_long_surv(
data_array=data_example_long_surv$data_array_IC,
time_matrix=data_example_long_surv$time_matrix_IC,
nobs=data_example_long_surv$nobs_IC,
starttime=data_example_long_surv$starttime_IC,
survtime=data_example_long_surv$survtime_IC,
survevent=data_example_long_surv$survevent_IC,
design_interval=data_example_long_surv$design_interval,
n_time_units=data_example_long_surv$n_time_units,
estimation_method="risk",
smoothing_method="local linear",
bw_beta=0.05,
bw_mean=0.1,
bw_var=0.1)
result_monitoring<-monitor_long_surv(
data_array_new=data_example_long_surv$data_array_IC,
time_matrix_new=data_example_long_surv$time_matrix_IC,
nobs_new=data_example_long_surv$nobs_IC,
pattern=result_pattern,
method="risk",
parameter=0.5)
output_evaluate<-evaluate_control_chart_one_group(
chart_matrix=result_monitoring$chart,
time_matrix=data_example_long_surv$time_matrix_IC,
nobs=data_example_long_surv$nobs_IC,
starttime=rep(0,nrow(data_example_long_surv$time_matrix_IC)),
endtime=rep(1,nrow(data_example_long_surv$time_matrix_IC)),
status=data_example_long_surv$survevent_IC,
design_interval=data_example_long_surv$design_interval,
n_time_units=data_example_long_surv$n_time_units,
no_signal_action="maxtime")
plot_evaluation(output_evaluate)
plot_PMROC(output_evaluate)
Search Control Limit
Description
Given a chart matrix, the function search_CL
searches the control limit (CL)
so that the specified average time to signals (ATS) can be attained.
Usage
search_CL(
chart_matrix,
time_matrix,
nobs,
starttime,
endtime,
design_interval,
n_time_units,
time_unit,
ATS_nominal,
CL_lower,
CL_step,
CL_upper,
no_signal_action = "omit",
ATS_tol,
CL_tol
)
Arguments
chart_matrix |
charting statistics arranged as a numeric matrix. |
time_matrix |
observation times arranged as a numeric matrix. |
nobs |
number of observations arranged as an integer vector. |
starttime |
a vector of times from the start of monitoring. |
endtime |
a vector of times from the start of monitoring. |
design_interval |
a numeric vector of length two that
gives the left- and right- limits of the design interval.
By default, |
n_time_units |
an integer value that gives the number of basic time units
in the design time interval. |
time_unit |
an optional numeric value of basic time unit. Only used when |
ATS_nominal |
a numeric value. |
CL_lower , CL_step , CL_upper |
three numeric values. |
no_signal_action |
a character specifying the method to use when a signal is not given to a process.
If |
ATS_tol |
a numeric value. |
CL_tol |
a numeric value. |
Details
Search Control Limit
Value
a numeric value, the control limit that gives the desired ATS.
Examples
result_pattern<-estimate_pattern_long_1d(
data_matrix=data_example_long_1d$data_matrix_IC,
time_matrix=data_example_long_1d$time_matrix_IC,
nobs=data_example_long_1d$nobs_IC,
design_interval=data_example_long_1d$design_interval,
n_time_units=data_example_long_1d$n_time_units,
estimation_method="meanvar",
smoothing_method="local linear",
bw_mean=0.1,
bw_var=0.1)
result_monitoring<-monitor_long_1d(
data_matrix_new=data_example_long_1d$data_matrix_IC,
time_matrix_new=data_example_long_1d$time_matrix_IC,
nobs_new=data_example_long_1d$nobs_IC,
pattern=result_pattern,
side="upward",
chart="CUSUM",
method="standard",
parameter=0.5)
CL<-search_CL(
chart_matrix=result_monitoring$chart,
time_matrix=data_example_long_1d$time_matrix_IC,
nobs=data_example_long_1d$nobs_IC,
starttime=rep(0,nrow(data_example_long_1d$time_matrix_IC)),
endtime=rep(1,nrow(data_example_long_1d$time_matrix_IC)),
design_interval=data_example_long_1d$design_interval,
n_time_units=data_example_long_1d$n_time_units,
ATS_nominal=200,CL_lower=0,CL_upper=5)