cnorm.betabinomial1: Fit a beta binomial regression model (mode 1, mu/sigma...

View source: R/betaBinomial.R

cnorm.betabinomial1R Documentation

Fit a beta binomial regression model (mode 1, mu/sigma parameterization)

Description

This function fits a beta binomial regression model where both the mean and standard deviation of the response variable are modeled as polynomial functions of the predictor variable. While 'cnorm.betabinomial2' fits a beta-binomial model directly on the basis of \alpha and \beta, this function fits \mu and \sigma, which are then used to estimate the beta binomial distribution parameters. Kept for backwards compatibility; 'cnorm.betabinomial2' is the recommended default.

Usage

cnorm.betabinomial1(
  age,
  score,
  n = NULL,
  weights = NULL,
  mu = 3,
  sigma = 3,
  control = NULL,
  scale = "T",
  plot = TRUE
)

Arguments

age

A numeric vector of predictor values (e.g., age).

score

A numeric vector of response values.

n

Number of items in the test, resp. maximum score to be achieved.

weights

A numeric vector of weights for each observation. Default is NULL (equal weights).

mu

Integer specifying the degree of the polynomial for the mean model. Default is 3.

sigma

Integer specifying the degree of the polynomial for the standard deviation model. Default is 3.

control

A list of control parameters to be passed to the optim function. If NULL, default values are used.

scale

Type of norm scale, either T (default), IQ, z or percentile (= no transformation); a double vector with the mean and standard deviation can be provided as well, e.g. c(10, 3) for Wechsler scale index points.

plot

Logical indicating whether to plot the model. Default is TRUE.

Details

The function standardizes the input variables, fits polynomial models for both the mean and standard deviation, and uses maximum likelihood estimation to find the optimal parameters. The optimization is performed using the BFGS method.

Value

A list of class "cnormBetaBinomial" containing:

beta_est

Estimated coefficients for the mean model

gamma_est

Estimated coefficients for the log-standard deviation model

se

Standard errors of the estimated coefficients

mu

Degree of the polynomial for the mean model

sigma

Degree of the polynomial for the standard deviation model

result

Full result from the optimization procedure


cNORM documentation built on July 13, 2026, 5:08 p.m.