Package 'double.truncation'

Title: Analysis of Doubly-Truncated Data
Description: Likelihood-based inference methods with doubly-truncated data are developed under various models. Nonparametric models are based on Efron and Petrosian (1999) <doi:10.1080/01621459.1999.10474187> and Emura, Konno, and Michimae (2015) <doi:10.1007/s10985-014-9297-5>. Parametric models from the special exponential family (SEF) are based on Hu and Emura (2015) <doi:10.1007/s00180-015-0564-z> and Emura, Hu and Konno (2017) <doi:10.1007/s00362-015-0730-y>. The parametric location-scale models are based on Dorre et al. (2020) <doi:10.1007/s00180-020-01027-6>.
Authors: Takeshi Emura, Ya-Hsuan Hu, Chung-Yan Huang
Maintainer: Takeshi Emura <[email protected]>
License: GPL-2
Version: 1.7
Built: 2024-11-16 06:44:40 UTC
Source: CRAN

Help Index


Analysis of Doubly-Truncated Data

Description

Likelihood-based inference methods with doubly-truncated data are developed under various models. Nonparametric models are based on Efron and Petrosian (1999) <doi:10.1080/01621459.1999.10474187> and Emura, Konno, and Michimae (2015) <doi:10.1007/s10985-014-9297-5>. Parametric models from the special exponential family (SEF) are based on Hu and Emura (2015) <doi:10.1007/s00180-015-0564-z> and Emura, Hu and Konno (2017) <doi:10.1007/s00362-015-0730-y>. The parametric location-scale models are based on Dorre et al. (2020) <doi:10.1007/s00180-020-01027-6>.

Details

Details are seen from the references.

Author(s)

Takeshi Emura, Ya-Hsuan Hu, Chung-Yan Huang Maintainer: Takeshi Emura <[email protected]>

References

Dorre A, Emura T (2019) Analysis of Doubly Truncated Data, An Introduction, JSS Research Series in Statistics, Springer

Dorre A, Huang CY, Tseng YK, Emura T (2020) Likelihood-based analysis of doubly-truncated data under the location-scale and AFT model, Computation Stat, DOI:10.1007/s00180-020-01027-6

Efron B, Petrosian V (1999). Nonparametric methods for doubly truncated data. J Am Stat Assoc 94: 824-834

Emura T, Konno Y, Michimae H (2015). Statistical inference based on the nonparametric maximum likelihood estimator under double-truncation. Lifetime Data Analysis 21: 397-418

Emura T, Hu YH, Konno Y (2017) Asymptotic inference for maximum likelihood estimators under the special exponential family with double-truncation, Stat Pap 58 (3): 877-909

Hu YH, Emura T (2015) Maximum likelihood estimation for a special exponential family under random double-truncation, Computation Stat 30 (4): 1199-229


Nonparametric inference based on the self-consistency method

Description

Nonparametric maximum likelihood estimates are computed based on the self-consistency method (Efron and Petrosian 1999). The SE is computed from the asymptotic variance derived in Emura et al. (2015).

Usage

NPMLE(u.trunc, y.trunc, v.trunc,epsilon=1e-08)

Arguments

u.trunc

lower truncation limit

y.trunc

variable of interest

v.trunc

upper truncation limit

epsilon

error tolerance for the self-consistency algorithm

Details

Details are seen from the references.

Value

f

density

F

cumulative distribution

SE

standard error

convergence

Log-likelihood, and the number of iterations

Author(s)

Takeshi Emura

References

Efron B, Petrosian V (1999). Nonparametric methods for doubly truncated data. J Am Stat Assoc 94: 824-834

Emura T, Konno Y, Michimae H (2015). Statistical inference based on the nonparametric maximum likelihood estimator under double-truncation. Lifetime Data Analysis 21: 397-418

Dorre A, Emura T (2019) Analysis of Doubly Truncated Data, An Introduction, JSS Research Series in Statistics, Springer

Examples

## A data example from Efron and Petrosian (1999) ## 
y.trunc=c(0.75, 1.25, 1.50, 1.05, 2.40, 2.50, 2.25)
u.trunc=c(0.4, 0.8, 0.0, 0.3, 1.1, 2.3, 1.3)
v.trunc=c(2.0, 1.8, 2.3, 1.4, 3.0, 3.4, 2.6)
NPMLE(u.trunc,y.trunc,v.trunc)

Parametric Inference for the log-logistic model

Description

Maximum likelihood estimates and their standard errors (SEs) are computed. Also computed are the likelihood value, AIC, and other qnantities.

Usage

PMLE.loglogistic(u.trunc, y.trunc, v.trunc,epsilon = 1e-5,D1=2,D2=2,d1=2,d2=2)

Arguments

u.trunc

lower truncation limit

y.trunc

variable of interest

v.trunc

upper truncation limit

epsilon

error tolerance for Newton-Raphson

D1

Randomize the intial value if |mu_h-mu_h+1|>D1

D2

Randomize the intial value if |sigma_h-sigma_h+1|>D2

d1

U(-d1,d1) is added to the intial value of mu

d2

U(-d2,d2) is added to the intial value of sigma

Details

Details are seen from the references.

Value

eta

estimates

SE

standard errors

convergence

Log-likelihood, degree of freedom, AIC, the number of iterations

Score

score vector at the converged value

Hessian

Hessian matrix at the converged value

Author(s)

Takeshi Emura

References

Dorre A, Huang CY, Tseng YK, Emura T (2020-) Likelihood-based analysis of doubly-truncated data under the location-scale and AFT model, Computation Stat, DOI:10.1007/s00180-020-01027-6

Examples

## A data example from Efron and Petrosian (1999) ## 
y.trunc=c(0.75, 1.25, 1.50, 1.05, 2.40, 2.50, 2.25)
u.trunc=c(0.4, 0.8, 0.0, 0.3, 1.1, 2.3, 1.3)
v.trunc=c(2.0, 1.8, 2.3, 1.4, 3.0, 3.4, 2.6)
PMLE.loglogistic(u.trunc,y.trunc,v.trunc)

Parametric Inference for the lognormal model

Description

Maximum likelihood estimates and their standard errors (SEs) are computed. Also computed are the likelihood value, AIC, and other qnantities.

Usage

PMLE.lognormal(u.trunc, y.trunc, v.trunc,epsilon = 1e-5,D1=2,D2=2,d1=2,d2=2)

Arguments

u.trunc

lower truncation limit

y.trunc

variable of interest

v.trunc

upper truncation limit

epsilon

error tolerance for Newton-Raphson

D1

Randomize the intial value if |mu_h-mu_h+1|>D1

D2

Randomize the intial value if |sigma_h-sigma_h+1|>D2

d1

U(-d1,d1) is added to the intial value of mu

d2

U(-d2,d2) is added to the intial value of sigma

Details

Details are seen from the references.

Value

eta

estimates

SE

standard errors

convergence

Log-likelihood, degree of freedom, AIC, the number of iterations

Score

score vector at the converged value

Hessian

Hessian matrix at the converged value

Author(s)

Takeshi Emura

References

Dorre A, Huang CY, Tseng YK, Emura T (2020-) Likelihood-based analysis of doubly-truncated data under the location-scale and AFT model, Computation Stat, DOI:10.1007/s00180-020-01027-6

Examples

## A data example from Efron and Petrosian (1999) ## 
y.trunc=c(0.75, 1.25, 1.50, 1.05, 2.40, 2.50, 2.25)
u.trunc=c(0.4, 0.8, 0.0, 0.3, 1.1, 2.3, 1.3)
v.trunc=c(2.0, 1.8, 2.3, 1.4, 3.0, 3.4, 2.6)
PMLE.lognormal(u.trunc,y.trunc,v.trunc)

Parametric inference for the one-parameter SEF model (free parameter space)

Description

Maximum likelihood estimates and their standard errors (SEs) are computed. Also computed are the likelihood value, AIC, and other qnantities.

Usage

PMLE.SEF1.free(u.trunc, y.trunc, v.trunc,
 tau1 = min(y.trunc), tau2 = max(y.trunc), epsilon = 1e-04)

Arguments

u.trunc

lower truncation limit

y.trunc

variable of interest

v.trunc

upper truncation limit

tau1

lower support

tau2

upper support

epsilon

error tolerance for Newton-Raphson

Details

Details are seen from the references.

Value

eta

estimates

SE

standard errors

convergence

Log-likelihood, degree of freedom, AIC, the number of iterations

Score

score at the converged value

Hessian

Hessian at the converged value

Author(s)

Takeshi Emura

References

Hu YH, Emura T (2015) Maximum likelihood estimation for a special exponential family under random double-truncation, Computation Stat 30 (4): 1199-229

Emura T, Hu YH, Konno Y (2017) Asymptotic inference for maximum likelihood estimators under the special exponential family with double-truncation, Stat Pap 58 (3): 877-909

Dorre A, Emura T (2019) Analysis of Doubly Truncated Data, An Introduction, JSS Research Series in Statistics, Springer

Examples

### Data generation: see Appendix of Hu and Emura (2015) ###
eta_true=-3
eta_u=-9
eta_v=-1
tau=10
n=300

a=u=v=y=c()

j=1
repeat{
  u1=runif(1,0,1)
  u[j]=tau+(1/eta_u)*log(1-u1)
  u2=runif(1,0,1)
  v[j]=tau+(1/eta_v)*log(1-u2)
  u3=runif(1,0,1)
  y[j]=tau+(1/eta_true)*log(1-u3)
  if(u[j]<=y[j]&&y[j]<=v[j]) a[j]=1 else a[j]=0
  if(sum(a)==n) break
  j=j+1
}
mean(a) ## inclusion probability around 0.5
  
v.trunc=v[a==1]
u.trunc=u[a==1]
y.trunc=y[a==1]

PMLE.SEF1.free(u.trunc,y.trunc,v.trunc)

Parametric inference for the one-parameter SEF model (negative parameter space)

Description

Maximum likelihood estimates and their standard errors (SEs) are computed. Also computed are the likelihood value, AIC, and other qnantities.

Usage

PMLE.SEF1.negative(u.trunc, y.trunc, v.trunc, tau1 = min(y.trunc), epsilon = 1e-04)

Arguments

u.trunc

lower truncation limit

y.trunc

variable of interest

v.trunc

upper truncation limit

tau1

lower support

epsilon

error tolerance for Newton-Raphson

Details

Details are seen from the references.

Value

eta

estimates

SE

standard errors

convergence

Log-likelihood, degree of freedom, AIC, the number of iterations

Score

score at the converged value

Hessian

Hessian at the converged value

Author(s)

Takeshi Emura, Ya-Hsuan Hu

References

Hu YH, Emura T (2015) Maximum likelihood estimation for a special exponential family under random double-truncation, Computation Stat 30 (4): 1199-229

Emura T, Hu YH, Konno Y (2017) Asymptotic inference for maximum likelihood estimators under the special exponential family with double-truncation, Stat Pap 58 (3): 877-909

Dorre A, Emura T (2019) Analysis of Doubly Truncated Data, An Introduction, JSS Research Series in Statistics, Springer

Examples

### Data generation: see Appendix of Hu and Emura (2015) ###
eta_true=-3
eta_u=-9
eta_v=-1
tau=10
n=300

a=u=v=y=c()

j=1
repeat{
  u1=runif(1,0,1)
  u[j]=tau+(1/eta_u)*log(1-u1)
  u2=runif(1,0,1)
  v[j]=tau+(1/eta_v)*log(1-u2)
  u3=runif(1,0,1)
  y[j]=tau+(1/eta_true)*log(1-u3)
  if(u[j]<=y[j]&&y[j]<=v[j]) a[j]=1 else a[j]=0
  if(sum(a)==n) break
  j=j+1
}
mean(a) ## inclusion probability around 0.5
  
v.trunc=v[a==1]
u.trunc=u[a==1]
y.trunc=y[a==1]

PMLE.SEF1.negative(u.trunc,y.trunc,v.trunc)

Parametric Inference for the one-parameter SEF model (positive parameter space)

Description

Maximum likelihood estimates and their standard errors (SEs) are computed. Also computed are the likelihood value, AIC, and other qnantities.

Usage

PMLE.SEF1.positive(u.trunc, y.trunc, v.trunc, tau2 = max(y.trunc), epsilon = 1e-04)

Arguments

u.trunc

lower truncation limit

y.trunc

variable of interest

v.trunc

upper truncation limit

tau2

upper support

epsilon

error tolerance for Newton-Raphson

Details

Details are seen from the references.

Value

eta

estimates

SE

standard errors

convergence

Log-likelihood, degree of freedom, AIC, the number of iterations

Score

score at the converged value

Hessian

Hessian at the converged value

Author(s)

Takeshi Emura, Ya-Hsuan Hu

References

Hu YH, Emura T (2015) Maximum likelihood estimation for a special exponential family under random double-truncation, Computation Stat 30 (4): 1199-229

Emura T, Hu YH, Konno Y (2017) Asymptotic inference for maximum likelihood estimators under the special exponential family with double-truncation, Stat Pap 58 (3): 877-909

Dorre A, Emura T (2019) Analysis of Doubly Truncated Data, An Introduction, JSS Research Series in Statistics, Springer

Examples

#### Data generation: Appendix of Hu and Emura (2015)
eta_true=3
eta_u=1
eta_v=9
tau=10
n=300

a=u=v=y=c()

j=1
repeat{
  u1=runif(1,0,1)
  u[j]=tau+(1/eta_u)*log(u1)
  u2=runif(1,0,1)
  v[j]=tau+(1/eta_v)*log(u2)
  u3=runif(1,0,1)
  y[j]=tau+(1/eta_true)*log(u3)
  if(u[j]<=y[j]&&y[j]<=v[j]) a[j]=1 else a[j]=0
  if(sum(a)==n) break
  j=j+1
}
mean(a) ## inclusion probability around 0.5

v.trunc=v[a==1]
u.trunc=u[a==1]
y.trunc=y[a==1]

PMLE.SEF1.positive(u.trunc,y.trunc,v.trunc)

Parametric Inference for the two-parameter SEF model (negative parameter space for eta_2)

Description

Maximum likelihood estimates and their standard errors (SEs) are computed. Also computed are the likelihood value, AIC, and other qnantities. Since this is the model, estimates for the mean and SD are also computed.

Usage

PMLE.SEF2.negative(u.trunc, y.trunc, v.trunc, epsilon = 1e-04)

Arguments

u.trunc

lower truncation limit

y.trunc

variable of interest

v.trunc

upper truncation limit

epsilon

error tolerance for Newton-Raphson

Details

Details are seen from the references.

Value

eta

estimates

SE

standard errors

convergence

Log-likelihood, degree of freedom, AIC, the number of iterations

Score

score vector at the converged value

Hessian

Hessian matrix at the converged value

Author(s)

Takeshi Emura, Ya-Hsuan Hu

References

Hu YH, Emura T (2015) Maximum likelihood estimation for a special exponential family under random double-truncation, Computation Stat 30 (4): 1199-229

Emura T, Hu YH, Konno Y (2017) Asymptotic inference for maximum likelihood estimators under the special exponential family with double-truncation, Stat Pap 58 (3): 877-909

Dorre A, Emura T (2019) Analysis of Doubly Truncated Data, An Introduction, JSS Research Series in Statistics, Springer

Examples

### Data generation: see Appendix of Hu and Emura (2015)
n=300
eta1_true=30
eta2_true=-0.5
mu_true=30
mu_u=29.09
mu_v=30.91

a=u=v=y=c()

###generate n samples of (ui,yi,vi) subject to ui<=yi<=vi###
j=1
repeat{  
  u[j]=rnorm(1,mu_u,1)
  v[j]=rnorm(1,mu_v,1)
  y[j]=rnorm(1,mu_true,1)
  if(u[j]<=y[j]&&y[j]<=v[j]) a[j]=1 else a[j]=0
  if(sum(a)==n) break ###we need n data set###
  j=j+1
}
mean(a) ### inclusion probability around 0.5 ###

v.trunc=v[a==1]
y.trunc=y[a==1]
u.trunc=u[a==1]
  
PMLE.SEF2.negative(u.trunc,y.trunc,v.trunc)

Parametric Inference for the three-parameter SEF model (free parameter space for eta_3)

Description

Maximum likelihood estimates and their standard errors (SEs) are computed. Also computed are the likelihood value, AIC, and other qnantities.

Usage

PMLE.SEF3.free(u.trunc, y.trunc, v.trunc,
 tau1 = min(y.trunc), tau2 = max(y.trunc),
 epsilon = 1e-04, D1=20, D2=10, D3=1, d1=6, d2=0.5)

Arguments

u.trunc

lower truncation limit

y.trunc

variable of interest

v.trunc

upper truncation limit

tau1

lower support

tau2

upper support

epsilon

error tolerance for Newton-Raphson

D1

Divergence condition for eta_1

D2

Divergence condition of eta_2

D3

Divergence condition of eta_3

d1

Range of randomization for eta_1

d2

Range of randomization for eta_2

Details

Details are seen from the references.

Value

eta

estimates

SE

standard errors

convergence

Log-likelihood, degree of freedom, AIC, the number of iterations

Score

score vector at the converged value

Hessian

Hessian matrix at the converged value

Author(s)

Takeshi Emura, Ya-Hsuan Hu

References

Hu YH, Emura T (2015) Maximum likelihood estimation for a special exponential family under random double-truncation, Computation Stat 30 (4): 1199-229

Emura T, Hu YH, Konno Y (2017) Asymptotic inference for maximum likelihood estimators under the special exponential family with double-truncation, Stat Pap 58 (3): 877-909

Dorre A, Emura T (2019) Analysis of Doubly Truncated Data, An Introduction, JSS Research Series in Statistics, Springer

Examples

## The first 10 samples of the childhood cancer data ##
y.trunc=c(6,7,15,43,85,92,96,104,108,123)
u.trunc=c(-1643,-24,-532,-1508,-691,-1235,-786,-261,-108,-120)
v.trunc=u.trunc+1825
PMLE.SEF3.free(u.trunc,y.trunc,v.trunc)

Parametric Inference for the three-parameter SEF model (negative parameter space for eta_3)

Description

Maximum likelihood estimates and their standard errors (SEs) are computed. Also computed are the likelihood value, AIC, and other qnantities.

Usage

PMLE.SEF3.negative(u.trunc, y.trunc, v.trunc, tau1 = min(y.trunc),
 epsilon = 1e-04, D1=20, D2=10, D3=1, d1=6, d2=0.5)

Arguments

u.trunc

lower truncation limit

y.trunc

variable of interest

v.trunc

upper truncation limit

tau1

lower support

epsilon

error tolerance for Newton-Raphson

D1

Divergence condition for eta_1

D2

Divergence condition of eta_2

D3

Divergence condition of eta_3

d1

Range of randomization for eta_1

d2

Range of randomization for eta_2

Details

Details are seen from the references.

Value

eta

estimates

SE

standard errors

convergence

Log-likelihood, degree of freedom, AIC, the number of iterations

Score

score vector at the converged value

Hessian

Hessian matrix at the converged value

Author(s)

Takeshi Emura, Ya-Hsuan Hu

References

Hu YH, Emura T (2015) Maximum likelihood estimation for a special exponential family under random double-truncation, Computation Stat 30 (4): 1199-229

Emura T, Hu YH, Konno Y (2017) Asymptotic inference for maximum likelihood estimators under the special exponential family with double-truncation, Stat Pap 58 (3): 877-909

Dorre A, Emura T (2019) Analysis of Doubly Truncated Data, An Introduction, JSS Research Series in Statistics, Springer

Examples

## The first 10 samples of the childhood cancer data ##
y.trunc=c(6,7,15,43,85,92,96,104,108,123)
u.trunc=c(-1643,-24,-532,-1508,-691,-1235,-786,-261,-108,-120)
v.trunc=u.trunc+1825
PMLE.SEF3.negative(u.trunc,y.trunc,v.trunc)

Parametric Inference for the three-parameter SEF model (positive parameter space for eta_3)

Description

Maximum likelihood estimates and their standard errors (SEs) are computed. Also computed are the likelihood value, AIC, and other qnantities.

Usage

PMLE.SEF3.positive(u.trunc, y.trunc, v.trunc, tau2 = max(y.trunc),
 epsilon = 1e-04, D1=20, D2=10, D3=1, d1=6, d2=0.5)

Arguments

u.trunc

lower truncation limit

y.trunc

variable of interest

v.trunc

upper truncation limit

tau2

upper support

epsilon

error tolerance for Newton-Raphson

D1

Divergence condition for eta_1

D2

Divergence condition of eta_2

D3

Divergence condition of eta_3

d1

Range of randomization for eta_1

d2

Range of randomization for eta_2

Details

Details are seen from the references.

Value

eta

estimates

SE

standard errors

convergence

Log-likelihood, degree of freedom, AIC, the number of iterations

Score

score vector at the converged value

Hessian

Hessian matrix at the converged value

Author(s)

Takeshi Emura, Ya-Hsuan Hu

References

Hu YH, Emura T (2015) Maximum likelihood estimation for a special exponential family under random double-truncation, Computation Stat 30 (4): 1199-229

Emura T, Hu YH, Konno Y (2017) Asymptotic inference for maximum likelihood estimators under the special exponential family with double-truncation, Stat Pap 58 (3): 877-909

Dorre A, Emura T (2019) Analysis of Doubly Truncated Data, An Introduction, JSS Research Series in Statistics, Springer

Examples

## The first 10 samples of the childhood cancer data ##
y.trunc=c(6,7,15,43,85,92,96,104,108,123)
u.trunc=c(-1643,-24,-532,-1508,-691,-1235,-786,-261,-108,-120)
v.trunc=u.trunc+1825
PMLE.SEF3.positive(u.trunc,y.trunc,v.trunc)

Parametric Inference for the Weibull model

Description

Maximum likelihood estimates and their standard errors (SEs) are computed. Also computed are the likelihood value, AIC, and other qnantities.

Usage

PMLE.Weibull(u.trunc, y.trunc, v.trunc,epsilon = 1e-5,D1=2,D2=2,d1=2,d2=2)

Arguments

u.trunc

lower truncation limit

y.trunc

variable of interest

v.trunc

upper truncation limit

epsilon

error tolerance for Newton-Raphson

D1

Randomize the intial value if |mu_h-mu_h+1|>D1

D2

Randomize the intial value if |sigma_h-sigma_h+1|>D2

d1

U(-d1,d1) is added to the intial value of mu

d2

U(-d2,d2) is added to the intial value of sigma

Details

Details are seen from the references.

Value

eta

estimates

SE

standard errors

convergence

Log-likelihood, degree of freedom, AIC, the number of iterations

Score

score vector at the converged value

Hessian

Hessian matrix at the converged value

Author(s)

Takeshi Emura

References

Dorre A, Huang CY, Tseng YK, Emura T (2020) Likelihood-based analysis of doubly-truncated data under the location-scale and AFT model, Computation Stat, DOI:10.1007/s00180-020-01027-6

Examples

## A data example from Efron and Petrosian (1999) ## 
y.trunc=c(0.75, 1.25, 1.50, 1.05, 2.40, 2.50, 2.25)
u.trunc=c(0.4, 0.8, 0.0, 0.3, 1.1, 2.3, 1.3)
v.trunc=c(2.0, 1.8, 2.3, 1.4, 3.0, 3.4, 2.6)
PMLE.Weibull(u.trunc,y.trunc,v.trunc)

Simulating doubly-truncated data from the Weibull model

Description

A data frame is generated by simulated data from the Weibull model.

Usage

simu.Weibull(n,mu,sigma,delta)

Arguments

n

sample size

mu

location parameter

sigma

scale parameter

delta

a positive parameter controlling the inclusion probability

Details

The data are generated from the random vector (U,Y,V) subject to the inclusion criterion U<=Y<=V. The random vector are defined as U=mu-delta+sigma*W, Y=mu+sigma*W, and U=mu+delta+sigma*W, where P(W>w)=exp(-exp(w)). See Section 5.1 of Dorre et al. (2020-) for details. The inclusion probability is P(U<=Y<=V).

Value

u

lower truncation limits

y

log-transformed lifetimes

v

upper truncation limits

Author(s)

Takeshi Emura

References

Dorre A, Huang CY, Tseng YK, Emura T (2020-) Likelihood-based analysis of doubly-truncated data under the location-scale and AFT model, Computation Stat, DOI:10.1007/s00180-020-01027-6

Examples

## A simulation from Dorre et al.(2020) ##
simu.Weibull(n=100,mu=5,sigma=2,delta=2.08)

Dat=simu.Weibull(n=100,mu=5,sigma=2,delta=2.08)
PMLE.Weibull(Dat$u,Dat$y,Dat$v)