window_by_id: Restrict longitudinal data to a range, interpolating at...

Description Usage Arguments Value Author(s) References Examples

View source: R/window_by_id.R

Description

Filter out only the values in the interval given for each subject_ID, but also interpolate the response endpoint value at the interval end points based on the method that will be used to find the AUC (trapezoid/linear, step, spline).

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
window_by_id(
  study_data_frame,
  method = c("trapezoid", "step", "spline", "linear"),
  xmin = -Inf,
  xmax = Inf,
  VST = TRUE,
  check_data = TRUE,
  return_all_columns = FALSE,
  print_warnings = TRUE,
  unwindowed_to_NA = TRUE,
  group_name = maeve_options("group_name"),
  subject_ID = maeve_options("subject_ID"),
  x_name = maeve_options("x_name"),
  endpoint_name = maeve_options("endpoint_name"),
  add_to_endpoint = maeve_options("add_to_endpoint"),
  trans_func_char = maeve_options("trans_func_char"),
  inv_func_char = maeve_options("inv_func_char"),
  test_func_x = maeve_options("test_func_x")
)

Arguments

study_data_frame

data.frame a "well-prepared" data.frame (e.g., processed through maeve::check_study_data_frame() is recommended but not required) with the study data and appropriate columns.

method

character name method for computing AUC. Passed directly to DescTools::AUC( ..., method = ... ).

xmin

numeric left / lower end of the interval.

xmax

numeric right / uppper end of the interval.

VST

logical whether to apply a variance stabilizing transform to endpoint_name values.

check_data

logical whether to pass "study_data_frame" through maeve::check_study_data_frame() to check for problems.

return_all_columns

logical whether to return all the columns in the original data frame, or only the four for group_name, subject_ID, x_name, and endpoint_name.

print_warnings

logical whether to print warnings in odd circumstances.

unwindowed_to_NA

logical whether to set the values for "bystander" numeric vector entries (which are not being interpolated) to NA at the newly added endpoints. Recommended.

group_name

character column name for the group name factor

subject_ID

character column name for the subject name factor

x_name

character column name for the x-axis / time field

endpoint_name

character column name for the x-axis / time field

add_to_endpoint

numeric offset value added to the endpoint before transformation

trans_func_char

character function name for transformation of (endpoint_name + add_to_endpoint)

inv_func_char

character inverse function for transformation of (endpoint_name + add_to_endpoint)

test_func_x

numeric values with which to test that trans_func and inv_func are inverse functions.

Value

An R data.frame with one row per ID.

Author(s)

Bill Forrest <forrest@gene.com>

Bill Forrest forrest@gene.com

References

www.r-project.org

Examples

1
2
 vismo21 <- dplyr::filter( vismodegib, DAY_OF_STUDY <= 21 )
 vismo_interval_by_id <- window_by_id( vismo21, xmin = 4.5, xmax = 15.5 )

wfforrest/maeve documentation built on Jan. 1, 2021, 12:47 p.m.