This function can be used to determine some of the vital parameters used to construct control charts in this package.
parameter_assist(baseline_data, data, formula, followup, theta = log(2),
time, alpha = 0.05, maxtheta = log(6))
A list of parameters to feed to quality control charts in this package:
call: The call used to obtain output.
data: The data used in the call to the function.
baseline_data: The baseline_data used in the call to the function
glmmod: A glm()
model which can be fed to
the funnel_plot()
and bernoulli_cusum()
functions.
coxphmod: A coxph()
model which can be
fed to the cgr_cusum()
and
cgr_cusum()
functions.
theta: Expected increase in the odds/hazard ratio.
psi: Estimated Poisson arrival rate in data
.
time: Time frame over which to restrict type I error.
alpha: Desired level of type I error for control limit determination.
maxtheta: Maximum expected increase/decrease in the odds/hazard ratio.
A data.frame
for determining a baseline performance
metric. Rows should represent subjects and the
following named columns should be present:
entrytime
:time of entry into study (numeric);
survtime
:time from entry until event (numeric);
censorid
:censoring indicator (0 = right censored, 1 = observed), (integer).
and optionally additional covariates used for risk-adjustment.
A data.frame
with data on which the user wants to construct
quality control charts.
Rows should represent subjects and the
following named columns should be present:
entrytime
:time of entry into study (numeric);
survtime
:time from entry until event (numeric);
censorid
:censoring indicator (0 = right censored, 1 = observed), (integer).
and optionally additional covariates used for risk-adjustment.
A formula with right-hand side (RHS) indicating the form in which the covariates should be used for the Cox and GLM regression models. LHS of the formula will be ignored, and can be left empty.
(optional): The value of the follow-up time to be used to determine event time.
Event time will be equal to entrytime + followup
for each subject.
The value of the expected log-hazard/odds ratio. In other words: the logarithm of the expected increase in the odds/hazard ratio. Default is log(2) (detecting a doubling of the odds/failure rate).
Timeframe over which the type I error of the control chart should be
limited. Should be in the same unit as survtime
in data
. If left
unspecified, the maximum entrytime in baseline_data
is taken. (numeric)
Required maximal type I error (between 0 and 1) of the procedure
over the timeframe specified in time
. Default is 0.05. (numeric)
Maximum value the maximum likelihood estimate for
parameter \(\theta\) can take. If detection = "lower"
, -abs(theta)
will be the minimum value the maximum likelihood estimate for
parameter \(\theta\) can take. Default is log(6)
, meaning that
at most a 6 times increase/decrease in the odds/hazard ratio is expected.
Daniel Gomon
Depending on the specified arguments, the function will return
parameters. If covariate_names
is not specified, the returned
risk-adjustment models will be trivial. If formula
is not specified
but covariate_names
are,
the function assumes the simplest form for the regression model
(cov1 + cov2 + ...). If followup
is not specified, no glmmod
will be determined
require(survival)
#Minimal example - no risk-adjustment
pars_min <- parameter_assist(baseline_data = surgerydat,
data = subset(surgerydat, unit == 1))
#Specifying all parameters
pars <- parameter_assist(baseline_data = surgerydat,
data = subset(surgerydat, unit == 1),
formula = formula("survtime ~ age + sex + BMI"), followup = 100)
Run the code above in your browser using DataLab