Beta Regression for Interval-Censored Scale-Derived Outcomes

Maximum-likelihood estimation of beta regression models for responses derived from bounded rating scales. Observations are treated as interval-censored on (0, 1) after a scale-to-unit transformation, and the likelihood is built from the difference of the beta CDF at the interval endpoints. The complete likelihood supports mixed censoring types: uncensored, left-censored, right-censored, and interval-censored observations. Both fixed- and variable-dispersion submodels are supported, with flexible link functions for the mean and precision components. A compiled C++ backend (via 'Rcpp' and 'RcppArmadillo') provides numerically stable, high-performance log-likelihood evaluation. Standard S3 methods (print(), summary(), coef(), fitted(), residuals(), predict(), plot(), confint(), vcov(), logLik(), AIC(), BIC(), simulate()) are available for fitted objects.


betaregscale

R-CMD-check CRAN status License: MIT

betaregscale fits regression models for scores on a bounded rating scale $0, 1, \ldots, K$ (pain NRS-11 or NRS-101, Likert items, quality ratings). Each score is the coarsened reading of a latent beta variable on $(0, 1)$, written in mean–dispersion form: mean $\mu$, dispersion $\sigma = 1/(1 + \phi) \in (0, 1)$ with $\phi$ the beta precision, and $\mathrm{Var}(Y) = \mu(1 - \mu)\sigma$. Both can depend on covariates through link functions. The latent scale is cut at cutpoints anchored on the score labels, so each score is an interval-censored observation and the likelihood is a probability mass function over the scores $0, \ldots, K$. The scale borders need no ad hoc squeezing: score 0 is left-censored and score $K$ right-censored. Fixed-effects models are fitted with brs() and mixed models with Gaussian random effects with brsmm(); the log-likelihood and its derivatives are compiled C++.

Installation

# Released version from CRAN
install.packages("betaregscale")

# Development version from GitHub
# install.packages("remotes")
remotes::install_github("evandeilton/betaregscale")

Example

Simulated NRS-11 scores (0 to 10) for 200 patients, with a continuous covariate and a treatment indicator:

library(betaregscale)

set.seed(1)
d <- data.frame(x1 = rnorm(200), trt = rbinom(200, 1, 0.5))
nrs <- brs_sim(~ x1 + trt, data = d, beta = c(-0.4, 0.5, -0.6),
               phi = qlogis(0.15), ncuts = 10)

# Mean with logit link, constant dispersion with logit link
fit <- brs(y ~ x1 + trt, data = nrs)
summary(fit)

# The fitted model is a pmf over the scores 0..10
round(head(brs_predict_scoreprob(fit), 3), 3)

# Expected score by arm at x1 = 0, and the difference between arms,
# with delta-method standard errors
nd <- data.frame(x1 = 0, trt = c(0, 1))
brs_marginal(fit, nd, type = "expected_score")
brs_marginal(fit, nd, type = "expected_score", contrast = c(2, 1))

# Diagnostic plots of randomized quantile residuals
plot(fit)

Features

  • Interval maps interval = "mid", "right" or "left", and estimable boundary cutpoints (cutpoints = "boundary") for scores that pile up at the ends of the scale, with a likelihood-ratio test against the fixed map.
  • Variable dispersion with a two-part formula y ~ x | z, and three parameterizations of the beta law (repar).
  • Mixed models (brsmm()) with random intercepts and slopes, fitted by Laplace approximation, adaptive Gauss–Hermite quadrature or quasi-Monte Carlo, with chi-bar-square likelihood-ratio tests for variance components.
  • Score-scale predictions: score probabilities (brs_predict_scoreprob()), and score probabilities, expected scores, exceedance probabilities and contrasts with standard errors (brs_marginal()), population-averaged for mixed models.
  • Diagnostics and validation: randomized quantile and cell deviance residuals, parametric bootstrap, k-fold and group-level cross-validation, and simulation (brs_sim(), brsmm_sim(), simulate()).

Documentation

  • Introduction: the model, interval maps, the likelihood and a first fit.
  • Mixed models: brsmm(), integration methods, random effects and marginal predictions.
  • Analyst tools: predictions, contrasts, residuals, bootstrap, cross-validation, tables and plots.
  • Advanced workflows: variable dispersion, boundary cutpoints and model comparison.

Function reference and changelog: https://evandeilton.github.io/betaregscale/. Bug reports and questions: https://github.com/evandeilton/betaregscale/issues.

Citation

citation("betaregscale") gives the reference for the package. The model is described in

Other references:

  • Bayer, F. M. (2011). Modelagem e inferência em regressão beta. PhD thesis, Universidade Federal de Pernambuco.
  • Ferrari, S. L. P., and Cribari-Neto, F. (2004). Beta regression for modelling rates and proportions. Journal of Applied Statistics, 31(7), 799–815. https://doi.org/10.1080/0266476042000214501

License

MIT © José Evandeilton Lopes and Wagner Hugo Bonat

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("betaregscale")

3.1.1 by José Evandeilton Lopes, 9 days ago


https://evandeilton.github.io/betaregscale/, https://github.com/evandeilton/betaregscale


Report a bug at https://github.com/evandeilton/betaregscale/issues


Browse source code at https://github.com/cran/betaregscale


Authors: José Evandeilton Lopes [aut, cre] (ORCID: , Wagner Hugo Bonat [aut] (ORCID:


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports Formula, ggplot2, numDeriv, Rcpp, rlang, stats

Suggests gridExtra, knitr, rmarkdown, testthat

Linking to Rcpp, RcppArmadillo


See at CRAN