prob_logit | R Documentation |
After a logistic model fit a logit function with the coefficients of the regression to get the probabilities given a distance vector. Usually the distance vector is used to plot the logistic model as a curve from 0 to the maximum value of a distribution matrix used to perform de logistic regression model.
prob_logit(coef, dist)
coef |
A vector of two elements of coefficients (Intercept and slope) in a logistic regression.#' |
dist |
A vector of distance to perform de regression |
A vector of probabilities given the vector of regression
phy_dist <- ape::cophenetic.phylo(host_tree)
phy_dist <- log10(phy_dist + 1)
incidence_matrix <- get_incidence_matrix(beetleTreeInteractions)
incidence_matrix <- incidence_matrix[ ,colnames(phy_dist)]
coefficients <- log_reg_boostrap(incidence_matrix, phy_dist, 10)
coefficientsValues <- c(coefficients[["intercept"]], coefficients[["slope"]] )
distVector <- seq(0, max(phy_dist), 1)
prob_logit(coefficientsValues, distVector)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.