Fits a beta interval-censored mixed model with Gaussian random
intercepts using marginal maximum likelihood. The current implementation
supports random = ~ 1 | group and uses a Laplace approximation for
group-specific integrals.
Usage
brsmm(
formula,
random = ~1 | id,
data,
link = "logit",
link_phi = "logit",
repar = 2L,
ncuts = 100L,
lim = 0.5,
int_method = c("laplace", "aghq", "qmc"),
n_points = 11L,
qmc_points = 1024L,
start = NULL,
method = c("BFGS", "L-BFGS-B"),
hessian_method = c("numDeriv", "optim"),
control = list(maxit = 2000L),
seed = NULL
)Arguments
- formula
Model formula. Supports one- or two-part formulas:
y ~ x1 + x2ory ~ x1 + x2 | z1 + z2.- random
Random-effects specification. The supported format is
~ 1 | group.- data
Data frame.
- link
Mean link function.
- link_phi
Precision link function.
- repar
Beta reparameterization code (0, 1, 2).
- ncuts
Number of categories on the original scale.
- lim
Half-width used to construct interval endpoints.
- int_method
Integration method. Currently, only
"laplace"is implemented.- n_points
Reserved for future AGHQ support.
- qmc_points
Reserved for future QMC support.
- start
Optional numeric vector of starting values (
beta,gamma,log_sigma_b).- method
Optimizer passed to
optim.- hessian_method
"numDeriv"(default) or"optim".- control
Control list for
optim.- seed
Optional seed used by integration methods that depend on randomized points (reserved for future use).
Details
The conditional contribution for each observation follows the same mixed
censoring likelihood used by brs:
\(\delta=0\): exact contribution via beta density,
\(\delta=1\): left-censored contribution via beta CDF,
\(\delta=2\): right-censored contribution via survival CDF,
\(\delta=3\): interval contribution via CDF difference.
For group \(i\), the random intercept \(b_i \sim N(0, \sigma_b^2)\) is integrated out numerically via Laplace approximation.
References
Lopes, J. E. (2024). Beta Regression for Interval-Censored Scale-Derived Outcomes. MSc Dissertation, PPGMNE/UFPR.
Ferrari, S. and Cribari-Neto, F. (2004). Beta regression for modelling rates and proportions. Journal of Applied Statistics, 31(7), 799–815.
Examples
# \donttest{
set.seed(123)
g <- 15
ni <- 8
id <- factor(rep(seq_len(g), each = ni))
n <- length(id)
x1 <- rnorm(n)
b <- rnorm(g, sd = 0.5)
eta_mu <- 0.2 + 0.6 * x1 + b[as.integer(id)]
mu <- plogis(eta_mu)
phi <- plogis(-0.2 + 0.2 * x1)
shp <- brs_repar(mu = mu, phi = phi, repar = 2)
y <- round(stats::rbeta(n, shp$shape1, shp$shape2) * 100)
d <- data.frame(y = y, x1 = x1, id = id)
fit_mm <- brsmm(y ~ x1, random = ~ 1 | id, data = d, repar = 2)
fit_mm
#>
#> Call:
#> brsmm(formula = y ~ x1, random = ~1 | id, data = d, repar = 2)
#>
#> Mixed beta interval model (Laplace)
#> Observations: 120 | Groups: 15
#> Log-likelihood: -499.3888
#> Random SD: 0.2206
#> Convergence code: 0
# }
