| create_STAT {sdtmval} | R Documentation | 
Assign STAT 'NOT DONE' status
Description
Creates a –STAT variable and, if all measurements for a visit were not done, also changes all –TESTCD values as "–ALL"
Usage
create_STAT(
  df,
  domain,
  nd_ind,
  nd_ind_cd = "Yes",
  USUBJID = "USUBJID",
  VISIT = "VISIT"
)
Arguments
df | 
 a data frame to modify  | 
domain | 
 a string, the domain abbreviation in all caps  | 
nd_ind | 
 a string, the variable name in   | 
nd_ind_cd | 
 a string, the code from the   | 
USUBJID | 
 a string, the variable name in   | 
VISIT | 
 a string, the variable name in   | 
Value
a modified copy of df
Examples
df <- dplyr::tibble(
  USUBJID = paste("Subject", c(rep("A", 2), rep("B", 4), rep("C", 2))),
  VISIT = paste("Visit", c(1  , 2  , 1  , 1  , 2  , 2  , 2  , 2)),
  XXTESTCD = paste("Test", c(1  , 2  , 1  , 2  , 1  , 2  , 1  , 2)),
  ND = c("N", "N", "Y", "Y", "N", "N", "Y", "Y")
)
create_STAT(df = df, domain = "XX", nd_ind = "ND", nd_ind_cd = "Y")
[Package sdtmval version 0.4.1 Index]