Learn R Programming

serosv (version 1.1.0)

find_best_fp_powers: Returns the powers of the GLM fitted model which has the lowest deviance score.

Description

Refers to section 6.2.

Usage

find_best_fp_powers(data, p, mc, degree, link = "logit")

Value

list of 3 elements:

p

The best power for fp model.

deviance

Deviance of the best fitted model.

model

The best model fitted

Arguments

data

the input data frame, must either have `age`, `pos`, `tot` columns (for aggregated data) OR `age`, `status` for (linelisting data)

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".

Examples

Run this code
df <- hav_be_1993_1994
best_p <- find_best_fp_powers(
df,
p=seq(-2,3,0.1), mc=FALSE, degree=2, link="cloglog"
)
best_p

Run the code above in your browser using DataLab