View source: R/fractional_polynomial_models.R
find_best_fp_powers | R Documentation |
Refers to section 6.2.
find_best_fp_powers(age, pos, tot, p, mc, degree, link = "logit")
age |
the age vector. |
pos |
the pos vector. |
tot |
the tot vector. |
p |
a powers sequence. |
mc |
indicates if the returned model should be monotonic. |
degree |
the degree of the model. Recommended to be <= 2. |
link |
the link function. Defaulted to "logit". |
list of 3 elements:
p |
The best power for fp model. |
deviance |
Deviance of the best fitted model. |
model |
The best model fitted |
df <- hav_be_1993_1994
best_p <- find_best_fp_powers(
df$age, df$pos, df$tot,
p=seq(-2,3,0.1), mc=FALSE, degree=2, link="cloglog"
)
best_p
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.