Description Usage Arguments Value Examples
View source: R/lago_aux_functions.R View source: R/expit_func.R
This function calculates the success probabilities for the logistic regression model for a given vector of covariates and a vector of parameter values. The success probability for a given vector of covariates x and parameter vector beta is calculated as 1/(1 + exp(-beta' X))
1 |
beta |
a vector of true/estimated values of the parameters for a logistic regression model. If intercept = TRUE is specified, the first component should include the value of the intercept term |
x |
a vector of covariates under the logistic regression model |
intercept |
a logical argument to specify if the intercept term is included in the model or not. If TRUE, then beta should include the intercept term (default = TRUE) |
This function returns the calculated probability of success under the logistic regression model for the given covariate vector and vector of parameters.
1 2 3 4 5 6 7 8 | x = c(2.5, 12.5, 7)
beta.true = c(log(0.05), log(1.2), log(1.1), log(1.3))
# Default intercept = TRUE
prob <- expit(beta.true, x) # Calculating the probabilities
beta.true = c(log(1.2), log(1.1), log(1.3))
# intercept = FALSE
prob <- expit(beta.true, x, intercept = FALSE) # Calculating the probabilities
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.