Skip to contents

Stepwise Beta regression by BIC

Usage

betareg_step_bic(
  X,
  Y,
  direction = "both",
  link = "logit",
  link.phi = "log",
  type = "ML",
  trace = FALSE,
  max_steps = NULL,
  epsilon = 1e-08,
  X_phi = NULL,
  direction_phi = c("none", "both", "forward", "backward"),
  weights = NULL
)

Arguments

X

Numeric matrix (n × p) of mean-submodel predictors.

Y

Numeric response in (0,1). Values are squeezed to (0,1) internally.

direction

Stepwise direction for the mean submodel: "both", "forward", or "backward".

Link for the mean submodel (passed to betareg). Default "logit".

Link for precision parameter. Default "log".

type

Likelihood type for betareg, e.g. "ML".

trace

Logical; print stepwise trace.

max_steps

Integer; maximum number of greedy steps (default p).

epsilon

Numeric; minimum improvement required to accept a move (default 1e-8).

X_phi

Optional matrix of candidate predictors for the precision (phi) submodel. When direction_phi enables precision updates and X_phi is NULL, the function reuses X.

direction_phi

Stepwise direction for the precision submodel. Defaults to "none" (no phi selection). Supported values mirror direction.

weights

Optional non-negative observation weights passed to betareg().

Value

See betareg_step_aic().

Examples

set.seed(1); X <- matrix(rnorm(300), 100, 3);
Y <- plogis(X[,1]);
betareg_step_bic(X, Y)
#>     (Intercept)              X1              X2              X3 phi|(Intercept) 
#>    9.240039e-05    9.864092e-01    0.000000e+00    0.000000e+00    1.357490e+01 
Y <- rbeta(100, Y*30, (1-Y)*30)
betareg_step_bic(X, Y)
#>     (Intercept)              X1              X2              X3 phi|(Intercept) 
#>    -0.001531718     0.932506105     0.000000000     0.000000000     3.533825847