Learn R Programming

doseSens (version 1.0.0)

extract_stochastic_intervention: Compute weighted sum of outcomes.

Description

Compute weighted sum of outcomes.

Usage

extract_stochastic_intervention(z, r, s)

Value

the inner product of s and r

Arguments

z

a vector of doses

r

a vector of outcomes

s

a set of weights, summing to 1

Examples

Run this code
# dose vector
dose <- c(0, 0.1, 0.4)
# outcome vector
outcome <- c(1, 1.1, 1.5)
# weight vector
weight = c(0.3, 0.4, 0.3)
theta <- extract_stochastic_intervention(z = dose, r = outcome, s = weight)

Run the code above in your browser using DataLab