Function designed to change the type, label or unit associated with variables.
set_var_types(xpdb, .problem = NULL, ..., auto_factor = TRUE, quiet)
set_var_labels(xpdb, .problem = NULL, ..., quiet)
set_var_units(xpdb, .problem = NULL, ..., quiet)
An xpose_data
object.
The problem number to which the edits will be applied.
Specifications of the edits to be made to the xpdb index. Edits are made as type and variable pairs e.g. idv = 'TAD' will assign TAD to the type idv (independent variable).
With set_var_types
only. If TRUE
new columns assigned to the type 'catcov' will be converted to
factor.
Logical, if FALSE
messages are printed to the console.
An xpose_data object
a: Compartments' amount
amt: Dose amount
catcov: Categorical covariate
contcov: Continuous covariate
dv: Dependent variable
dvid: DV identifier
eta: Eta
evid: Event identifier
id: Subject identifier
idv: Independent variable
ipred: Individual model predictions
mdv: Missing dependent variable
na: Not attributed
occ: Occasion flag
param: Model parameter
pred: Typical model predictions
res: Residuals
# Change variable type
xpdb_2 <- set_var_types(xpdb_ex_pk, .problem = 1, idv = 'TAD')
# Change labels
xpdb_2 <- set_var_labels(xpdb_2, .problem = 1, ALAG1 = 'Lag time', CL = 'Clearance', V = 'Volume')
# Change units
xpdb_2 <- set_var_units(xpdb_2, .problem = 1, ALAG1 = 'h', CL = 'L/h', V = 'L')