Bootstrap a phylopred logistic regression model
Source:R/bootstrap_phylopred_model.R
bootstrap_phylopred_model.RdRuns the phylopred logistic regression n times using random focal host
sampling, returning a distribution of coefficient estimates.
Value
An S3 object of class "phylopred_bootstrap", a list with:
- call
The matched call.
- n
Number of bootstrap iterations.
- seed
The seed used.
- coefficients
A matrix of
nrows x 12 columns (coefficient info from each iteration).- summary
A data.frame with the column-wise means (same 12 columns).
- metadata
List with
n_parasitesandn_hosts.
Examples
incidence <- prepare_incidence_matrix(beetleTreeInteractions)
aligned <- align_phylopred_inputs(incidence, phy_dist)
bootstrap_phylopred_model(aligned$incidence, aligned$phydist, n = 5, seed = 42)
#> Phylopred bootstrap (5 iterations)
#> Intercept (mean): -1.6305
#> Slope (mean): -0.0016