elrEffects | R Documentation |
This function can be used to estimate average and conditional effects of a treatment variable on an outcome variable, taking into account any number of continuous and categorical covariates. It takes a user defined generalized linear model (or another statistical model with a suitable predict method) as input and computes the corresponding effects.
elrEffects(object, x, from = 0, to = 1, type = "difference", subset. = NULL)
object |
User defined generalized linear model (or another statistical model with a suitable predict method) |
x |
Treatment variable (character string) |
from |
from and to (values of treatment variable) specify the considered change in the treatment variable for the effect computation |
to |
from and to (values of treatment variable) specify the considered change in the treatment variable for the effect computation |
type |
character. Indicates the type of effect considered. Can be one of |
subset. |
Logical vector for computing effects in a subset of the data (conditional effects). |
Object of class elreffects
## Example with a logistic regression
m1logreg <- glm(y ~ x+z1+z2+k1+k2, data=elrdata_logreg, family=binomial)
elrEffects(m1logreg, "x", from="0", to="1", type="difference", subset.=NULL)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.