CalculPx | R Documentation |
Calculate the probability for a repsonse to be 1 in the logistic regression model.
CalculPx(X, beta, intercept = 0)
X |
Design matrix of the logistic model considered. |
beta |
Vector of coefficients of the logistic model considered. |
intercept |
Whether there is the intercept |
prob |
the probability for a repsonse to be 1 |
Wencan Zhu, Celine Levy-Leduc, Nils Ternes
Please read https://hastie.su.domains/Papers/glmnet.pdf for more details
data(X)
data(beta)
CalculPx(X=X, beta=beta)
##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function (X, beta, intercept = 0)
{
prob <- 1/(1 + exp(-(X %*% beta + intercept)))
return(prob)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.