The observed function is the first function in the vpc piping chain and is used for specifying observed data and variables for VPC. Note: Observed
data must not contain missing DV and may require filtering MDV == 0
before generating VPC.
observed(o, ...)
# S3 method for data.frame
observed(
o,
x,
yobs,
pred = NULL,
blq = NULL,
lloq = -Inf,
alq = NULL,
uloq = Inf,
...
)
A data.frame
of observation data.
Other arguments.
Numeric x-variable, typically named TIME.
Numeric y-variable, typically named DV.
Population prediction variable, typically named PRED.
Logical variable indicating below limit of quantification.
Number or numeric variable in data indicating the lower limit of quantification.
Logical variable indicating above limit of quantification .
Number or numeric variable in data indicating the upper limit of quantification.
A tidyvpcobj
containing both original data and observed data formatted with x
and y
variables as specified in function.
Resulting data is of class data.frame
and data.table
.
obs_data <- obs_data[MDV == 0]
sim_data <- sim_data[MDV == 0]
vpc <- observed(obs_data, x=TIME, y=DV)