Note that this computes quantiles using the quantile() function in R. In order to align with SAS, the type 2 definition is used Refer to https://blogs.sas.com/content/iml/2017/05/24/definitions-sample-quantiles.html

compute_thresholds_v2(
  dat = NULL,
  anchor.group = NULL,
  time.var = NULL,
  timepoint = NULL,
  change.score = NULL,
  subject.id = "USUBJID"
)

Arguments

dat

pass the dataframe

anchor.group

variable of the anchor group you want used here

time.var

variable of the Time in the dataframe - PLEASE CHECK THAT THIS IS CORRECTLY ORDERED, default is Time

timepoint

default here is to just use the final timepoint, e.g., "Time_4". Please be sure to have ordered your time variable correctly.

change.score

the PRO change score you want the threshold computed on

Value

returns a dataframe with two additional variables, PRO score at baseline and PRO change score