Learn R Programming

doseSens (version 1.0.0)

extract_OLS: A function that returns the coefficient from regressing an outcome vector on a dose vector.

Description

A function that returns the coefficient from regressing an outcome vector on a dose vector.

Usage

extract_OLS(z, r)

Value

the OLS regression coefficient from regressing r on z.

Arguments

z

a vector of doses

r

a vector of outcomes

Examples

Run this code
# dose vector
dose <- c(0, 0.1, 0.4)
# outcome vector
outcome <- c(1, 1.1, 1.5)
beta <- extract_OLS(z = dose, r = outcome)

Run the code above in your browser using DataLab