This function fits a beta-binomial regression model where both the alpha and beta parameters of the beta-binomial distribution are modeled as polynomial functions of the predictor variable (typically age). While 'cnorm-betabinomial' fits a beta-binomial model on the basis of \(\mu\) and \(\sigma\), this function fits a beta-binomial model directly on the basis of \(\gamma\) and \(\beta\).
cnorm.betabinomial2(
age,
score,
n = NULL,
weights = NULL,
alpha_degree = 3,
beta_degree = 3,
control = NULL,
scale = "T",
plot = T
)
A list of class "cnormBetaBinomial2" containing:
Estimated coefficients for the alpha model
Estimated coefficients for the beta model
Standard errors of the estimated coefficients
Degree of the polynomial for the alpha model
Degree of the polynomial for the beta model
Full result from the optimization procedure
A numeric vector of predictor values (e.g., age).
A numeric vector of response values.
The maximum score (number of trials in the beta-binomial distribution). If NULL, max(score) is used.
A numeric vector of weights for each observation. Default is NULL (equal weights).
Integer specifying the degree of the polynomial for the alpha model. Default is 3.
Integer specifying the degree of the polynomial for the beta model. Default is 3.
A list of control parameters to be passed to the `optim` function. If NULL, default values are used.
Type of norm scale, either "T" (default), "IQ", "z" or a double vector with the mean and standard deviation.
Logical indicating whether to plot the model. Default is TRUE.
The function standardizes the input variables, fits polynomial models for both the alpha and beta parameters, and uses maximum likelihood estimation to find the optimal parameters. The optimization is performed using the L-BFGS-B method.