Learn R Programming

tidyvpc (version 1.1.0)

observed: observed

Description

Specify observed dataset and variables for VPC

Usage

observed(o, ...)

# S3 method for data.frame observed( o, x, yobs, pred = NULL, blq = NULL, lloq = -Inf, alq = NULL, uloq = Inf, ... )

Arguments

o

data.frame or data.table of observation data

...

other arguments

x

numeric x-variable, typically named TIME

yobs

numeric y-variable, typically named DV

pred

population prediction variable, typically named PRED

blq

logical variable indicating below limit of quantification

lloq

number or numeric variable in data indicating the lower limit of quantification

alq

logical variable indicating above limit of quantification

uloq

number or numeric variable in data indicating the upper limit of quantification

Value

A tidyvpcobj containing both original data and observed data formatted with x & y variables as specified in function. Resulting data is of class data.frame and data.table.

Details

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 subsetting MDV == 0 before generating VPC.

See Also

simulated censoring stratify predcorrect binning binless vpcstats

Examples

Run this code
# NOT RUN {
obs_data <- as.data.table(tidyvpc::obs_data)
sim_data <- as.data.table(tidyvpc::sim_data)

obs_data <- obs_data[MDV == 0]
sim_data <- sim_data[MDV == 0]

vpc <- observed(obs_data, x=TIME, y=DV) 

# }

Run the code above in your browser using DataLab