Fits a logistic regression model relating host susceptibility to phylogenetic distance.
Value
An S3 object of class "phylopred_model", a list with:
- call
The matched call.
- coefficients
Named numeric vector
c(intercept, slope).- standard_errors
Named numeric vector
c(intercept, slope).- confidence_intervals
Matrix with rows
c("intercept","slope")and colsc("2.5%","97.5%").- fitted_model
The underlying
glmobject.- training_data
The data.frame used for model fitting.
- convergence
Logical; whether the GLM converged.
- metadata
List with
n_parasites,n_hosts, andseed.
Examples
incidence <- prepare_incidence_matrix(beetleTreeInteractions)
aligned <- align_phylopred_inputs(incidence, phy_dist)
fit_phylopred_model(aligned$incidence, aligned$phydist, seed = 42)
#> Phylopred model
#> Intercept: -1.2397 (SE: 0.1791)
#> Slope: -0.0025 (SE: 0.0004)
#> Convergence: TRUE