gamlss.cens-package {gamlss.cens} | R Documentation |
Fitting an Interval Response Variable Using ‘gamlss.family’ Distributions
Description
This is an add-on package to GAMLSS. The purpose of this package is to allow users to fit interval response variables in GAMLSS models. The main function gen.cens() generates a censored version of an existing GAMLSS family distribution.
Details
The DESCRIPTION file:
Package: | gamlss.cens |
Type: | Package |
Title: | Fitting an Interval Response Variable Using `gamlss.family' Distributions |
Version: | 5.0-7 |
Date: | 2023-10-08 |
Depends: | R (>= 2.2.1), gamlss.dist, gamlss, survival, methods |
Author: | Mikis Stasinopoulos <d.stasinopoulos@gre.ac.uk>, Bob Rigby, Nicoleta Mortan, Alexander Seipp |
Maintainer: | Mikis Stasinopoulos <d.stasinopoulos@gre.ac.uk> |
Description: | This is an add-on package to GAMLSS. The purpose of this package is to allow users to fit interval response variables in GAMLSS models. The main function gen.cens() generates a censored version of an existing GAMLSS family distribution. |
License: | GPL-2 | GPL-3 |
URL: | https://www.gamlss.com/ |
Index of help topics:
cens Function to Fit Censored Data Using a gamlss.family Distribution cens.d Censored Probability Density Function of a gamlss.family Distribution cens.p Censored Cumulative Probability Density Function of a gamlss.family Distribution cens.q Censored Inverse Cumulative Probability Density Function of a gamlss.family Distribution gamlss.cens-package Fitting an Interval Response Variable Using 'gamlss.family' Distributions gen.cens A Function to Generate Appropriate Functions to Be Used to Fit a Censored Response variable in GAMLSS lip Data for lip
Author(s)
Mikis Stasinopoulos <d.stasinopoulos@gre.ac.uk>, Bob Rigby, Nicoleta Mortan, Alexander Seipp
Maintainer: Mikis Stasinopoulos <d.stasinopoulos@gre.ac.uk>
References
Rigby, R. A. and Stasinopoulos D. M. (2005). Generalized additive models for location, scale and shape,(with discussion), Appl. Statist., 54, part 3, pp 507-554.
Rigby, R. A., Stasinopoulos, D. M., Heller, G. Z., and De Bastiani, F. (2019) Distributions for modeling location, scale, and shape: Using GAMLSS in R, Chapman and Hall/CRC. An older version can be found in https://www.gamlss.com/.
Stasinopoulos D. M. Rigby R.A. (2007) Generalized additive models for location scale and shape (GAMLSS) in R. Journal of Statistical Software, Vol. 23, Issue 7, Dec 2007, https://www.jstatsoft.org/v23/i07/.
Stasinopoulos D. M., Rigby R.A., Heller G., Voudouris V., and De Bastiani F., (2017) Flexible Regression and Smoothing: Using GAMLSS in R, Chapman and Hall/CRC.
(see also https://www.gamlss.com/).
See Also
Examples
library(survival)
library(gamlss)
library(gamlss.dist)
# comparing results with package survival
# fitting the exponential distribution
ms1<-survreg(Surv(futime, fustat) ~ ecog.ps + rx, ovarian,
dist='exponential')
mg1<-gamlss(Surv(futime, fustat) ~ ecog.ps + rx, data=ovarian,
family=cens(EXP),c.crit=0.00001)
if(abs(-2*ms1$loglik[2]-deviance(mg1))>0.001) stop(paste("descrepancies in exp"))
if(sum(coef(ms1)-coef(mg1))>0.001) warning(paste("descrepancies in coef in exp"))
summary(ms1)
summary(mg1)
# fitting the Weibull distribution
ms2 <-survreg(Surv(futime, fustat) ~ ecog.ps + rx, ovarian, dist='weibull')
mg2 <-gamlss(Surv(futime, fustat) ~ ecog.ps + rx, data=ovarian,
family=cens(WEI, delta=c(0.001,0.001)), c.crit=0.00001)
if(abs(-2*ms2$loglik[2]-deviance(mg2))>0.005)
stop(paste("descrepancies in deviance in WEI"))
summary(ms2);summary(mg2)
# compare the scale parameter
1/exp(coef(mg2,"sigma"))
# now fit the Weibull in different parameterrazions
mg21<-gamlss(Surv(futime, fustat) ~ ecog.ps + rx, data=ovarian,
family=cens(WEI2), method=mixed(2,30))
mg21<-gamlss(Surv(futime, fustat) ~ ecog.ps + rx, data=ovarian,
family=cens(WEI3))