observed: observed

Description Usage Arguments Details Value See Also Examples

View source: R/vpcstats.R

Description

Specify observed dataset and variables for VPC

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
observed(o, ...)

## S3 method for class '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

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.

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.

See Also

simulated censoring stratify predcorrect binning binless vpcstats

Examples

1
2
3
4
5
6
7
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) 

tidyvpc documentation built on Jan. 13, 2021, 6:31 a.m.