OutcomeModel | R Documentation |
This function creates a generative model of the outcome given a matrix of predictors.
OutcomeModel(f, family = "gaussian", sigma = 1, f_args = list())
f |
A string that describes the relationships between the predictors and outcome or a function that takes an input matrix and returns a vector of outcome: E(y|x) = g(f(x)) where g is a link function that depends on the family argument. |
family |
A string, 'gaussian', 'binomial', or 'poisson' for continuous, binary, or count outcomes. |
sigma |
A number, Gaussian noise standard deviation if applicable. |
f_args |
A named list of additional arguments to f |
An OutcomeModel object. Attributes:
f |
mean function. |
sigma |
a number for the Gaussian observation noise. |
family |
a string 'gaussian' or 'binomial'. |
# Define BMI as a ratio of weight and height plus random Gaussian error with standard deviation 1. bmi_model <- mpower::OutcomeModel(f = 'weight/(height^2)', sigma = 1, family = 'gaussian')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.