ipw_data {TrialEmulation} | R Documentation |
IPW Data Accessor and Setter
Description
Usage
ipw_data(object)
ipw_data(object) <- value
## S4 method for signature 'trial_sequence'
ipw_data(object)
## S4 replacement method for signature 'trial_sequence'
ipw_data(object) <- value
Arguments
object |
|
value |
|
Details
Generic function to access and update the data used for inverse probability weighting.
The setter method ipw_data(object) <- value
does not perform the same checks and manipulations
as set_data()
. To completely replace the data please use set_data()
. This ipw_data<-
method allows
small changes such as adding a new column.
Value
The data from the @data
slot of object
used for inverse probability weighting.
Examples
ts <- trial_sequence("ITT")
ts <- set_data(ts, data_censored)
ipw_data(ts)
data.table::set(ipw_data(ts), j = "dummy", value = TRUE)
# or with the setter method:
new_data <- ipw_data(ts)
new_data$x2sq <- new_data$x2^2
ipw_data(ts) <- new_data
[Package TrialEmulation version 0.0.4.0 Index]