R/Basetreat_function.R

Defines functions Basetreat

##############################################################################
#  LOAD DATA MANIPULATING FUNCTIONS -
#  PREPARATION  FOR DIAS NODE-SPLITTING APPROACH #
#  Author: Dias et al., 2010 [doi: 10.1002/sim.3767]
##############################################################################
#
Basetreat <- function(treat, b) {
  # Builds vector with baseline treatments
  N <- nrow(treat)
  out <- rep(0, N)
  for (i in 1:N) {
    out[i] <- treat[i, b[i]]
  }
  out
}

Try the rnmamod package in your browser

Any scripts or data that you put into this service are public.

rnmamod documentation built on May 29, 2024, 2:44 a.m.