MyNixOS website logo
Description

Power Logit Regression for Modeling Bounded Data.

Power logit regression models for bounded continuous data, in which the density generator may be normal, Student-t, power exponential, slash, hyperbolic, sinh-normal, or type II logistic. Diagnostic tools associated with the fitted model, such as the residuals, local influence measures, leverage measures, and goodness-of-fit statistics, are implemented. The estimation process follows the maximum likelihood approach and, currently, the package supports two types of estimators: the usual maximum likelihood estimator and the penalized maximum likelihood estimator. More details about power logit regression models are described in Queiroz and Ferrari (2022) <arXiv:2202.01697>.

PLreg

The PLreg package allows fitting power logit regression models. Diagnostic tools associated with the fitted model, such as the residuals, local influence measures, leverage measures, and goodness-of- fit statistics, are implemented.

Installation

You can install the development version of PLreg from GitHub with:

# install.packages("devtools")
devtools::install_github("ffqueiroz/PLreg")

Main functions

dP/tt, pP/tt, qP/tt, and rP/tt

Currently, the \textbf{PLreg} package includes 7 members of the power logit class of distributions: the power logit normal, power logit Student-t, power logit type II logistic, power logit power exponential, power logit sinh-normal, power logit hyperbolic and power logit slash distributions. The package provides the dP/tt, pP/tt, and qP/tt functions to compute the probability density function, cumulative distribution function and quantile function of the power logit distribution. Also, the rP/tt function may be used to generate random samples from power logit distributions. The basic usages of these functions are:

dPL(x, mu, sigma, lambda, zeta = 2, family, log = FALSE)

pPL(q, mu, sigma, lambda, zeta = 2, family, lower.tail = TRUE, log.p = FALSE)

qPL(p, mu, sigma, lambda, zeta = 2, family, lower.tail = TRUE, log.p = FALSE)

rPL(n, mu, sigma, lambda, zeta = 2, family)

PLreg

The main function of the \textbf{PLreg} package is PLreg(), which allows to fitting power logit regression model to proportional data; this explains the name. The arguments of PLreg() are:

PLreg(formula, data, subset, na.action, family = c("NO", "LO", "TF", "PE", "SN", "SLASH", "Hyp"), 
      zeta = NULL, link = c("logit", "probit", "cloglog", "cauchit", "log", "loglog"), 
      link.sigma = NULL, type = c("pML", "ML"), control = PLreg.control(...), 
      model = TRUE, y = TRUE, x = FALSE, ...)

The PLreg() function returns an object of class “PLreg”, similar to “betareg” and “glm” objects, for which some methods available. The summary() method returns a standard output, with coefficient estimates, standard errors, partial Wald tests and p values for the regression coefficients, the overall goodness-of-fit measure, the pseudo R^2, etc.. The type argument in summary() specifies the type of residuals included in the output; currently three residuals are supported: “standardized”, “quantile” and “deviance”. The plot() method draws graphs for diagnostic and influence analyses.

extra.parameter

An important function in the \textbf{PLreg} package is extra.parameter(). It can be used to estimate the extra parameter of some power logit models. The basic usage is:

extra.parameter(object, lower, upper, grid = 10)

Example

library(PLreg)
#> 
#> Attaching package: 'PLreg'
#> The following object is masked from 'package:stats':
#> 
#>     influence
## basic example code

In the following, an example is presented to illustrate the capacities of \textbf{PLreg} package. We use the bodyfat_Aeolus data set, available in the package.

help(bodyfat_Aeolus, package = "PLreg")

The response variable is percentfat and the covariates are the sex of the sampled bat (sex), the hibernation time (days) and the year that the bat was sampled (year). We start by fitting a power logit power exponential regression model with constant dispersion and \zeta = 2. To select a suitable value for \zeta, use the extra.parameter() function as follows.

fitPL_PE_start <- PLreg(percentfat ~ days + sex + year, data = bodyfat_Aeolus,
              family = "PE", zeta = 2)
extra.parameter(fitPL_PE_start, lower = 1, upper = 2.5)

Then, fit the model with the chosen value for \zeta.

fitPL_PE <- PLreg(percentfat ~ days + sex + year, data = bodyfat_Aeolus,
              family = "PE", zeta = 1.7)
summary(fitPL_PE)
#> 
#> Call:
#> PLreg(formula = percentfat ~ days + sex + year, data = bodyfat_Aeolus, 
#>     family = "PE", zeta = 1.7)
#> 
#> Standardized residuals:
#>     Min      1Q  Median      3Q     Max 
#> -3.0006 -0.6000  0.0224  0.6353  2.5352 
#> 
#> Coefficients (median model with logit link):
#>               Estimate Std. Error z value Pr(>|z|)    
#> (Intercept) -1.1615018  0.0647074 -17.950   <2e-16 ***
#> days        -0.0092638  0.0005363 -17.273   <2e-16 ***
#> sexM        -0.0499217  0.0570871  -0.874    0.382    
#> year2016     0.5176694  0.0607028   8.528   <2e-16 ***
#> 
#> Sigma coefficients (dispersion model with log link):
#>         Estimate Std. Error z value Pr(>|z|)    
#> (sigma) -1.94446    0.07869  -24.71   <2e-16 ***
#> 
#> Lambda coefficient:
#>           Estimate Std. Error
#> (lambda) 0.0004124      0.067
#> ---
#> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 
#> 
#> Family: PL - PE ( 1.7 ) (Power logit power exponential)
#> Estimation method: pML (penalized maximum likelihood)
#> Log-likelihood:   320 on 6 Df
#> Pseudo R-squared: 0.6756
#> Upsilon statistic: 0.04852
#> AIC:  -628
#> Number of iterations in BFGS optimization: 20

The goodness of fit is assessed using diagnostic graphs through the plot method.

plot(fitPL_PE, which = 1:4)

Further details and examples on the R package \textbf{PLreg} can be found using the help on R by typing:

help("PLreg")

Reference

Queiroz, F. F. and Ferrari, S. L. P. (2022). Power logit regression for modeling bounded data. \textit{arXiv}:2202.01697.

Metadata

Version

0.4.1

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows