Title: | Statistical Methods for the Analysis of Dependently Truncated Data |
---|---|
Description: | Estimation and testing methods for dependently truncated data. Semi-parametric methods are based on Emura et al. (2011)<Stat Sinica 21:349-67>, Emura & Wang (2012)<doi:10.1016/j.jmva.2012.03.012>, and Emura & Murotani (2015)<doi:10.1007/s11749-015-0432-8>. Parametric approaches are based on Emura & Konno (2012)<doi:10.1007/s00362-014-0626-2> and Emura & Pan (2017)<doi:10.1007/s00362-017-0947-z>. A regression approach is based on Emura & Wang (2016)<doi:10.1007/s10463-015-0526-9>. Quasi-independence tests are based on Emura & Wang (2010)<doi:10.1016/j.jmva.2009.07.006>. Right-truncated data for Japanese male centenarians are given by Emura & Murotani (2015)<doi:10.1007/s11749-015-0432-8>. |
Authors: | Takeshi Emura |
Maintainer: | Takeshi Emura <[email protected]> |
License: | GPL-2 |
Version: | 3.0 |
Built: | 2024-12-10 06:52:06 UTC |
Source: | CRAN |
Estimation and testing methods for dependently truncated data. Semi-parametric methods are based on Emura et al. (2011), Emura & Wang (2012), and Emura & Murotani (2015). Parametric approaches are based on Emura & Konno (2012) and Emura & Pan (2017). A regression approach is based on Emura & Wang (2016). Quasi-independence tests are based on Emura & Wang (2010). Right-truncated data for Japanese male centenarians are given by Emura & Murotani (2015).
Package: | depend.truncation |
Type: | Package |
Version: | 3.0 |
Date: | 2018-02-27 |
License: | GPL-2 |
Takeshi Emura <[email protected]>
Emura T, Wang W (2010), Testing quasi-independence for truncation data. Journal of Multivariate Analysis 101, 223-239.
Emura T, Wang W, Hung HN (2011), Semiparametric Inference for Copula Models for Truncated Data, Stat Sinica 21: 349-367.
Emura T, Konno Y (2012), Multivariate Normal Distribution Approaches for Dependently Truncated Data. Statistical Papers 53 (No.1), 133-149.
Emura T, Wang W (2012), Nonparametric Maximum Likelihood Estimation for Dependent Truncation Data Based on Copulas, Journal of Multivariate Analysis 110: 171-88
Emura T, Murotani K (2015), An Algorithm for Estimating Survival Under a Copula-based Dependent Truncation Model, TEST 24 (No.4): 734-751.
Emura T, Wang W (2016), Semiparametric Inference for an Accelerated Failure Time Model with Dependent Truncation, Ann Inst Stat Math 68 (5): 1073-94.
Emura T, Pan CH (2017), Parametric likelihood inference and goodness-of-fit for dependently left-truncated data, a copula-based approach, Statistical Papers, doi:10.1007/s00362-017-0947-z.
The number of deaths at each year (1963-1980) for Japanese male centenarians (Table 2 of Emura and Murotani (2015)). See also the original reference Sibuya & Hanayama (2004).
data("centenarian")
data("centenarian")
A data frame with 21 observations on the following 19 variables.
X
:the age at death
X1963
:the number of deaths between 1963 and 1964
X1964
:the number of deaths between 1964 and 1965
X1965
:the number of deaths between 1965 and 1966
X1966
:the number of deaths between 1966 and 1967
X1967
:the number of deaths between 1967 and 1968
X1968
:the number of deaths between 1968 and 1969
X1969
:the number of deaths between 1969 and 1970
X1970
:the number of deaths between 1970 and 1971
X1971
:the number of deaths between 1971 and 1972
X1972
:the number of deaths between 1972 and 1973
X1973
:the number of deaths between 1973 and 1974
X1974
:the number of deaths between 1974 and 1975
X1975
:the number of deaths between 1975 and 1976
X1976
:the number of deaths between 1976 and 1977
X1977
:the number of deaths between 1977 and 1978
X1978
:the number of deaths between 1978 and 1979
X1979
:the number of deaths between 1979 and 1980
X1980
:the number of deaths between 1980 and 1981
Sibuya M, Hanayama N (2004), Estimation of Human Longevity Distribution Based on Tabulated Statistics. Proceeding of ISM 52: 117-34
Emura T, Murotani K (2015), An Algorithm for Estimating Survival Under a Copula-based Dependent Truncation Model, TEST 24 (No.4): 734-751.
## Below is the centenarians data analysis of Emura & Murotani (2015) ## data(centenarian) Death=centenarian[,1] Year=1963:1980 data.mat=centenarian[,-1] X=T=NULL for(i in 1:length(Death)){ for(j in 1:length(Year)){ X=c( X,rep(Death[i],data.mat[i,j]) ) T=c( T,rep(Year[j]-i+1,data.mat[i,j]) ) ### T= Year at age 100.5 ### } } x.trunc=X z.trunc=max(Year)+0.5-T+100 m=length(x.trunc) d=rep(1,m) set.seed(1) x.trunc=x.trunc+runif(length(x.trunc),min=-0.01,max=0) z.trunc=z.trunc+runif(length(z.trunc),min=0,max=0.01) ### Copula-based estimator #### ## CHAIEB.Frank(x.trunc, z.trunc, d, a = 1/10)
## Below is the centenarians data analysis of Emura & Murotani (2015) ## data(centenarian) Death=centenarian[,1] Year=1963:1980 data.mat=centenarian[,-1] X=T=NULL for(i in 1:length(Death)){ for(j in 1:length(Year)){ X=c( X,rep(Death[i],data.mat[i,j]) ) T=c( T,rep(Year[j]-i+1,data.mat[i,j]) ) ### T= Year at age 100.5 ### } } x.trunc=X z.trunc=max(Year)+0.5-T+100 m=length(x.trunc) d=rep(1,m) set.seed(1) x.trunc=x.trunc+runif(length(x.trunc),min=-0.01,max=0) z.trunc=z.trunc+runif(length(z.trunc),min=0,max=0.01) ### Copula-based estimator #### ## CHAIEB.Frank(x.trunc, z.trunc, d, a = 1/10)
A copula-based estimation based on dependent truncation data under the Clayton copula model(Lakhal-Chaieb, Rivest & Abdous 2006; Emura & Murotani 2015). The forms of the marginal distributions for X and Y are completely unspecified, but the parametric form of copula is specified as the Clayton copula.
CHAIEB.Clayton(x.trunc, z.trunc, d, a = 1/10, plotX = TRUE, plotY = TRUE)
CHAIEB.Clayton(x.trunc, z.trunc, d, a = 1/10, plotX = TRUE, plotY = TRUE)
x.trunc |
vector of variables satisfying x.trunc<=z.trunc |
z.trunc |
vector of variables satisfying x.trunc<=z.trunc |
d |
censoring indicator(0=censoring,1=failure) for z.trunc |
a |
tuning parameter adjusting for small the risk sets (pp.360-361: Emura, Wang & Hung 2011 Sinica) |
plotX |
if TRUE, plot the distribution function of X |
plotY |
if TRUE, plot the survival function of Y |
The function produces the moment-based estimate for the marginal distributions and the estimate of the association parameter under the Clayton copula model. The method can handle right-censoring for Y in which Z=min(Y, C) and I(Y<=C) are observed with censoring variable C.
alpha |
association parameter |
tau |
Kendall's tau between X and Y |
c |
inclusion probability, defined by c=Pr(X<=Z) |
Fx |
marginal distribution function of X at at (ordered) observed points of X |
Sy |
margianl survival function of Y at (ordered) observed points of Y |
Takeshi EMURA
Chaieb L, Rivest LP, Abdous B (2006), Estimating Survival Under a Dependent Truncation, Biometrika 93: 655-669.
Emura T, Murotani K (2015), An Algorithm for Estimating Survival Under a Copula-based Dependent Truncation Model, TEST 24 (No.4): 734-751.
########### AIDS data of Kalbfleisch & Lawless (1989, JASA) ############# inf1=c(23,38,38,36,27,45,23,48,25,42,33,45,33,39,34,48,50,35,26,43,3,53,40,53, 28,34,42,66,19,21,37,33,31,48,32,43,17,64,58,67,49,67,35,12,19,60,53,56,65,53) inf2=c(36,12,50,45,33,55,37,46,62,57,34,56,57,64,57,42,54,28,36,66,19,45,53,67, 68,54,40,60,54,42,74,71,43,61,68,52,75,46,62,67,48,68,58,55,70,33,56,47,64,15) inf3=c(41,35,67,35,71,67,36,69,45,76,66,22,74,49,42,15,29,62,65,75,65,69,62,56, 52,82,46,75,27,56,70,49,66,73,76,43,50,41,49,68,39,67,61,82,69,65,56,59,57,57) inf4=c(46,68,76,64,50,59,80,46,78,26,62,19,22,26,76,27,62,75,76,57,58,59,8,41, 70,57,58,63,37,75,58,39,38,73,72,41,56,50,79,83,76,29,17,69,86,29,65,75,74,42) inf5=c(65,61,84,41,83,58,45,83,80,84,59,85,59,65,47,64,73,81,79,36,67,87,85,29, 72,77,72,67,53,54,17,61,65,48,57,29,36,30,45,40,75,43,76,66,86,57,75,71,51) inf6=c(60,41,53,48,36,72,60,36,48,55,58,60,89,37,82,41,68,71,63,49,37,60,78,52, 60,85,68,37,39,22,12,63,80,45,47,85,29,60,84,70,61,69,77,63) x1=c(27,14,15,18,28,10,34,17,34,17,29,17,29,23,29,15,13,29,38,21,61,12,25,12,38, 32,24,0,48,46,30,34,37,21,37,26,53,6,13,4,22,4,37,60,53,13,20,17,8,20) x2=c(38,62,24,29,41,19,37,28,13,18,41,19,18,11,18,33,21,48,40,10,58,32,24,11,10, 25,39,19,25,37,5,8,37,20,13,29,6,35,19,14,33,13,23,27,12,49,26,35,18,68) x3=c(42,48,16,48,12,16,47,14,38,8,18,62,10,35,42,69,55,22,20,10,20,16,23,30,34,4, 40,11,59,30,16,37,20,13,10,43,36,46,38,19,48,20,26,5,18,23,32,29,31,31) x4=c(42,20,12,24,38,29,8,43,11,63,27,70,67,63,13,62,27,15,14,33,32,32,83,50,21, 34,33,29,55,17,34,53,54,19,20,52,37,43,14,10,17,64,76,25,8,65,29,19,20,52) x5=c(29,33,10,53,11,36,49,12,15,11,36,10,36,31,49,32,23,15,17,60,29,9,11,67,24, 19,24,29,43,43,80,36,32,49,40,68,61,68,53,58,23,55,22,32,12,41,23,27,47) x6=c(38,57,46,51,63,27,39,63,51,44,41,39,10,63,18,59,32,29,37,51,63,40,22,48,40, 15,33,64,62,79,89,38,21,56,54,16,72,41,17,31,40,32,24,38) t=c(inf1,inf2,inf3,inf4,inf5,inf6) #### the month of infection with 1=January 1978 #### x=c(x1,x2,x3,x4,x5,x6) #### the duration of the incubation period (month) #### y=102-t #### 102 is the study period (month) #### ######### Breaking ties by adding small noise to the data ########## set.seed(1) x=x+runif(293,min=-0.4,max=0.4) y=y+runif(293,min=-0.4,max=0.4) x[x<=0]=runif(1,0,0.4) x.trunc=x z.trunc=y d=rep(1,length(x.trunc)) ### all data is not censored ### CHAIEB.Clayton(x.trunc,z.trunc,d)[c(1,2,3)] ######### The same numerical results as Table 3 of Emura et al. (2011) ########### ### Below is the small data analysis in Section 3.2 of Emura and Murotani (2015)### x.trunc=c(1,2,4) z.trunc=c(3,5,6) d=c(1,1,1) CHAIEB.Clayton(x.trunc, z.trunc, d, a = 1/10)
########### AIDS data of Kalbfleisch & Lawless (1989, JASA) ############# inf1=c(23,38,38,36,27,45,23,48,25,42,33,45,33,39,34,48,50,35,26,43,3,53,40,53, 28,34,42,66,19,21,37,33,31,48,32,43,17,64,58,67,49,67,35,12,19,60,53,56,65,53) inf2=c(36,12,50,45,33,55,37,46,62,57,34,56,57,64,57,42,54,28,36,66,19,45,53,67, 68,54,40,60,54,42,74,71,43,61,68,52,75,46,62,67,48,68,58,55,70,33,56,47,64,15) inf3=c(41,35,67,35,71,67,36,69,45,76,66,22,74,49,42,15,29,62,65,75,65,69,62,56, 52,82,46,75,27,56,70,49,66,73,76,43,50,41,49,68,39,67,61,82,69,65,56,59,57,57) inf4=c(46,68,76,64,50,59,80,46,78,26,62,19,22,26,76,27,62,75,76,57,58,59,8,41, 70,57,58,63,37,75,58,39,38,73,72,41,56,50,79,83,76,29,17,69,86,29,65,75,74,42) inf5=c(65,61,84,41,83,58,45,83,80,84,59,85,59,65,47,64,73,81,79,36,67,87,85,29, 72,77,72,67,53,54,17,61,65,48,57,29,36,30,45,40,75,43,76,66,86,57,75,71,51) inf6=c(60,41,53,48,36,72,60,36,48,55,58,60,89,37,82,41,68,71,63,49,37,60,78,52, 60,85,68,37,39,22,12,63,80,45,47,85,29,60,84,70,61,69,77,63) x1=c(27,14,15,18,28,10,34,17,34,17,29,17,29,23,29,15,13,29,38,21,61,12,25,12,38, 32,24,0,48,46,30,34,37,21,37,26,53,6,13,4,22,4,37,60,53,13,20,17,8,20) x2=c(38,62,24,29,41,19,37,28,13,18,41,19,18,11,18,33,21,48,40,10,58,32,24,11,10, 25,39,19,25,37,5,8,37,20,13,29,6,35,19,14,33,13,23,27,12,49,26,35,18,68) x3=c(42,48,16,48,12,16,47,14,38,8,18,62,10,35,42,69,55,22,20,10,20,16,23,30,34,4, 40,11,59,30,16,37,20,13,10,43,36,46,38,19,48,20,26,5,18,23,32,29,31,31) x4=c(42,20,12,24,38,29,8,43,11,63,27,70,67,63,13,62,27,15,14,33,32,32,83,50,21, 34,33,29,55,17,34,53,54,19,20,52,37,43,14,10,17,64,76,25,8,65,29,19,20,52) x5=c(29,33,10,53,11,36,49,12,15,11,36,10,36,31,49,32,23,15,17,60,29,9,11,67,24, 19,24,29,43,43,80,36,32,49,40,68,61,68,53,58,23,55,22,32,12,41,23,27,47) x6=c(38,57,46,51,63,27,39,63,51,44,41,39,10,63,18,59,32,29,37,51,63,40,22,48,40, 15,33,64,62,79,89,38,21,56,54,16,72,41,17,31,40,32,24,38) t=c(inf1,inf2,inf3,inf4,inf5,inf6) #### the month of infection with 1=January 1978 #### x=c(x1,x2,x3,x4,x5,x6) #### the duration of the incubation period (month) #### y=102-t #### 102 is the study period (month) #### ######### Breaking ties by adding small noise to the data ########## set.seed(1) x=x+runif(293,min=-0.4,max=0.4) y=y+runif(293,min=-0.4,max=0.4) x[x<=0]=runif(1,0,0.4) x.trunc=x z.trunc=y d=rep(1,length(x.trunc)) ### all data is not censored ### CHAIEB.Clayton(x.trunc,z.trunc,d)[c(1,2,3)] ######### The same numerical results as Table 3 of Emura et al. (2011) ########### ### Below is the small data analysis in Section 3.2 of Emura and Murotani (2015)### x.trunc=c(1,2,4) z.trunc=c(3,5,6) d=c(1,1,1) CHAIEB.Clayton(x.trunc, z.trunc, d, a = 1/10)
A copula-based estimation based on dependent truncation data under the Frank copula model(Lakhal-Chaieb, Rivest & Abdous 2006; Emura & Murotani 2015). The forms of the marginal distributions for X and Y are completely unspecified, but the parametric form of copula is specified as the Frank copula.
CHAIEB.Frank(x.trunc, z.trunc, d, a = 1/10, plotX = TRUE, plotY = TRUE)
CHAIEB.Frank(x.trunc, z.trunc, d, a = 1/10, plotX = TRUE, plotY = TRUE)
x.trunc |
vector of variables satisfying x.trunc<=z.trunc |
z.trunc |
vector of variables satisfying x.trunc<=z.trunc |
d |
censoring indicator(0=censoring,1=failure) for z.trunc |
a |
tuning parameter adjusting for small the risk sets (pp.360-361: Emura, Wang & Hung 2011 Sinica) |
plotX |
if TRUE, plot the distribution function of X |
plotY |
if TRUE, plot the survival function of Y |
The function produces the moment-based estimate for the marginal distributions and the estimate of the association parameter under the Frank copula model. The method can handle right-censoring for Y in which Z=min(Y, C) and I(Y<=C) are observed with censoring variable C.
alpha |
association parameter |
tau |
Kendall's tau between X and Y |
c |
inclusion probability, defined by c=Pr(X<=Z) |
Fx |
marginal distribution function of X at at (ordered) observed points of X |
Sy |
margianl survival function of Y at (ordered) observed points of Y |
Takeshi EMURA
Chaieb L, Rivest LP, Abdous B (2006), Estimating Survival Under a Dependent Truncation, Biometrika 93: 655-669.
Emura T, Murotani K (2015), An Algorithm for Estimating Survival Under a Copula-based Dependent Truncation Model, TEST 24 (No.4): 734-751.
########### AIDS data of Kalbfleisch & Lawless (1989, JASA) ############# inf1=c(23,38,38,36,27,45,23,48,25,42,33,45,33,39,34,48,50,35,26,43,3,53,40,53, 28,34,42,66,19,21,37,33,31,48,32,43,17,64,58,67,49,67,35,12,19,60,53,56,65,53) inf2=c(36,12,50,45,33,55,37,46,62,57,34,56,57,64,57,42,54,28,36,66,19,45,53,67, 68,54,40,60,54,42,74,71,43,61,68,52,75,46,62,67,48,68,58,55,70,33,56,47,64,15) inf3=c(41,35,67,35,71,67,36,69,45,76,66,22,74,49,42,15,29,62,65,75,65,69,62,56, 52,82,46,75,27,56,70,49,66,73,76,43,50,41,49,68,39,67,61,82,69,65,56,59,57,57) inf4=c(46,68,76,64,50,59,80,46,78,26,62,19,22,26,76,27,62,75,76,57,58,59,8,41, 70,57,58,63,37,75,58,39,38,73,72,41,56,50,79,83,76,29,17,69,86,29,65,75,74,42) inf5=c(65,61,84,41,83,58,45,83,80,84,59,85,59,65,47,64,73,81,79,36,67,87,85,29, 72,77,72,67,53,54,17,61,65,48,57,29,36,30,45,40,75,43,76,66,86,57,75,71,51) inf6=c(60,41,53,48,36,72,60,36,48,55,58,60,89,37,82,41,68,71,63,49,37,60,78,52, 60,85,68,37,39,22,12,63,80,45,47,85,29,60,84,70,61,69,77,63) x1=c(27,14,15,18,28,10,34,17,34,17,29,17,29,23,29,15,13,29,38,21,61,12,25,12,38, 32,24,0,48,46,30,34,37,21,37,26,53,6,13,4,22,4,37,60,53,13,20,17,8,20) x2=c(38,62,24,29,41,19,37,28,13,18,41,19,18,11,18,33,21,48,40,10,58,32,24,11,10, 25,39,19,25,37,5,8,37,20,13,29,6,35,19,14,33,13,23,27,12,49,26,35,18,68) x3=c(42,48,16,48,12,16,47,14,38,8,18,62,10,35,42,69,55,22,20,10,20,16,23,30,34,4, 40,11,59,30,16,37,20,13,10,43,36,46,38,19,48,20,26,5,18,23,32,29,31,31) x4=c(42,20,12,24,38,29,8,43,11,63,27,70,67,63,13,62,27,15,14,33,32,32,83,50,21, 34,33,29,55,17,34,53,54,19,20,52,37,43,14,10,17,64,76,25,8,65,29,19,20,52) x5=c(29,33,10,53,11,36,49,12,15,11,36,10,36,31,49,32,23,15,17,60,29,9,11,67,24, 19,24,29,43,43,80,36,32,49,40,68,61,68,53,58,23,55,22,32,12,41,23,27,47) x6=c(38,57,46,51,63,27,39,63,51,44,41,39,10,63,18,59,32,29,37,51,63,40,22,48,40, 15,33,64,62,79,89,38,21,56,54,16,72,41,17,31,40,32,24,38) t=c(inf1,inf2,inf3,inf4,inf5,inf6) #### the month of infection with 1=January 1978 #### x=c(x1,x2,x3,x4,x5,x6) #### the duration of the incubation period (month) #### y=102-t #### 102 is the study period (month) #### ######### Breaking ties by adding small noise to the data ########## set.seed(1) x=x+runif(293,min=-0.4,max=0.4) y=y+runif(293,min=-0.4,max=0.4) x[x<=0]=runif(1,0,0.4) x.trunc=x z.trunc=y d=rep(1,length(x.trunc)) ### all data is not censored ### CHAIEB.Frank(x.trunc,z.trunc,d)[c(1,2,3)] ######### The same numerical results as Table 3 of Emura et al. (2011) ###########
########### AIDS data of Kalbfleisch & Lawless (1989, JASA) ############# inf1=c(23,38,38,36,27,45,23,48,25,42,33,45,33,39,34,48,50,35,26,43,3,53,40,53, 28,34,42,66,19,21,37,33,31,48,32,43,17,64,58,67,49,67,35,12,19,60,53,56,65,53) inf2=c(36,12,50,45,33,55,37,46,62,57,34,56,57,64,57,42,54,28,36,66,19,45,53,67, 68,54,40,60,54,42,74,71,43,61,68,52,75,46,62,67,48,68,58,55,70,33,56,47,64,15) inf3=c(41,35,67,35,71,67,36,69,45,76,66,22,74,49,42,15,29,62,65,75,65,69,62,56, 52,82,46,75,27,56,70,49,66,73,76,43,50,41,49,68,39,67,61,82,69,65,56,59,57,57) inf4=c(46,68,76,64,50,59,80,46,78,26,62,19,22,26,76,27,62,75,76,57,58,59,8,41, 70,57,58,63,37,75,58,39,38,73,72,41,56,50,79,83,76,29,17,69,86,29,65,75,74,42) inf5=c(65,61,84,41,83,58,45,83,80,84,59,85,59,65,47,64,73,81,79,36,67,87,85,29, 72,77,72,67,53,54,17,61,65,48,57,29,36,30,45,40,75,43,76,66,86,57,75,71,51) inf6=c(60,41,53,48,36,72,60,36,48,55,58,60,89,37,82,41,68,71,63,49,37,60,78,52, 60,85,68,37,39,22,12,63,80,45,47,85,29,60,84,70,61,69,77,63) x1=c(27,14,15,18,28,10,34,17,34,17,29,17,29,23,29,15,13,29,38,21,61,12,25,12,38, 32,24,0,48,46,30,34,37,21,37,26,53,6,13,4,22,4,37,60,53,13,20,17,8,20) x2=c(38,62,24,29,41,19,37,28,13,18,41,19,18,11,18,33,21,48,40,10,58,32,24,11,10, 25,39,19,25,37,5,8,37,20,13,29,6,35,19,14,33,13,23,27,12,49,26,35,18,68) x3=c(42,48,16,48,12,16,47,14,38,8,18,62,10,35,42,69,55,22,20,10,20,16,23,30,34,4, 40,11,59,30,16,37,20,13,10,43,36,46,38,19,48,20,26,5,18,23,32,29,31,31) x4=c(42,20,12,24,38,29,8,43,11,63,27,70,67,63,13,62,27,15,14,33,32,32,83,50,21, 34,33,29,55,17,34,53,54,19,20,52,37,43,14,10,17,64,76,25,8,65,29,19,20,52) x5=c(29,33,10,53,11,36,49,12,15,11,36,10,36,31,49,32,23,15,17,60,29,9,11,67,24, 19,24,29,43,43,80,36,32,49,40,68,61,68,53,58,23,55,22,32,12,41,23,27,47) x6=c(38,57,46,51,63,27,39,63,51,44,41,39,10,63,18,59,32,29,37,51,63,40,22,48,40, 15,33,64,62,79,89,38,21,56,54,16,72,41,17,31,40,32,24,38) t=c(inf1,inf2,inf3,inf4,inf5,inf6) #### the month of infection with 1=January 1978 #### x=c(x1,x2,x3,x4,x5,x6) #### the duration of the incubation period (month) #### y=102-t #### 102 is the study period (month) #### ######### Breaking ties by adding small noise to the data ########## set.seed(1) x=x+runif(293,min=-0.4,max=0.4) y=y+runif(293,min=-0.4,max=0.4) x[x<=0]=runif(1,0,0.4) x.trunc=x z.trunc=y d=rep(1,length(x.trunc)) ### all data is not censored ### CHAIEB.Frank(x.trunc,z.trunc,d)[c(1,2,3)] ######### The same numerical results as Table 3 of Emura et al. (2011) ###########
Regression estimation for the AFT regression model based on left-truncated and right-censored data (Emura & Wang 2016). The dependency of truncation on lifetime is modeled through the AFT regression form.
dependAFT.reg(t.trunc, y.trunc, d, x1.trunc, initial = c(0, 0), LY = FALSE, beta1_low = -0.2, beta1_up = 0.2, alpha = 1, epsilon = 1/50)
dependAFT.reg(t.trunc, y.trunc, d, x1.trunc, initial = c(0, 0), LY = FALSE, beta1_low = -0.2, beta1_up = 0.2, alpha = 1, epsilon = 1/50)
t.trunc |
vector of left-truncation variables satisfying t.trunc<=y.trunc |
y.trunc |
vector of lifetime variables satisfying t.trunc<=y.trunc |
d |
vector of censoring indicators |
x1.trunc |
vector of 1-dimensional covariates |
initial |
a pair of initial values for (beta, gamma) |
LY |
Lai and Ying's estimator for initial values |
beta1_low |
lower bound for beta |
beta1_up |
upper bound for beta |
alpha |
some tuning parameter for optimization, alpha=1 is default |
epsilon |
some tuning parameter for kernel methods |
Only the univariate regression (only one covariate) is allowed.
beta |
inference results for beta |
gamma |
inference results for gamma |
beta_LY |
the estimator of Lai & Ying (1991) |
S2_Minimum |
minimum of the objective function |
detail |
detailed results for minimizing the estimating objective function "optim" |
Takeshi Emura
Emura T, Wang W (2016), Semiparametric Inference for an Accelerated Failure Time Model with Dependent Truncation, Ann Inst Stat Math 68 (5): 1073-94.
Lai TL, Ying Z (1991), Rank Regression Methods for Left-Truncated and Right-Censored Data. Annals of Statistics 19: 531-556.
y.trunc=c( -0.52, 0.22, -1.42, 0.05, 0.32, -1.02, -0.47, 0.10, -0.38, -0.18, 0.97, 0.04, -0.10, 0.50, 0.57, -0.80, -0.24, 0.07, -0.04, 0.88, -0.52, -0.28, -0.55, 0.53, 0.99, -0.52, -0.59, -0.48, -0.07, 0.20, -0.34, 1.00, -0.52) t.trunc=c( -2.05, -0.25, -2.43, -0.32, -0.27, -1.06, -0.95, -0.82, -0.66, -0.28, -1.14, -0.32, -1.19, -2.18, -0.45, -1.71, -0.84, -1.93, -1.04, -2.58, -1.97, -2.15, -0.59, -0.74, -1.26, -2.57, -2.40, -2.22, -1.52, -0.21, -1.50, -1.99, -1.79) d=c(1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1,1) x1.trunc=c( 0.27, 0.66, 0.77, 0.21, 0.48, 0.11, 0.69, 0.32, 0.33, 0.43, 0.12, 0.60, 0.13, 0.43, 0.99, 0.21, 0.93, 0.60, 0.45, 0.41, 0.86, 0.90, 0.76, 0.93, 0.27, 0.13, 0.82, 0.17, 0.63, 0.31, 0.13, 0.48, 0.32) ### Data analysis in Emura & Wang (2016) ### # dependAFT.reg(t.trunc,y.trunc,d,x1.trunc,alpha=2,LY=TRUE,beta1_low=-5,beta1_up=5) dependAFT.reg(t.trunc,y.trunc,d,x1.trunc,LY=FALSE,beta1_low=-5,beta1_up=5) #### Channing hourse data analysis; Section 5 of Emura & Wang (2016) ##### # library(KMsurv) # data(channing) # y.trunc=log(channing$age) # t.trunc=log(channing$ageentry) # d=channing$death # x1.trunc=as.numeric(channing$gender==1) # dependAFT.reg(t.trunc,y.trunc,d,x1.trunc,beta1_low=-0.2,beta1_up=0.2) # dependAFT.reg(t.trunc,y.trunc,d,x1.trunc,LY=TRUE,alpha=2,beta1_low=-0.2,beta1_up=0.2)
y.trunc=c( -0.52, 0.22, -1.42, 0.05, 0.32, -1.02, -0.47, 0.10, -0.38, -0.18, 0.97, 0.04, -0.10, 0.50, 0.57, -0.80, -0.24, 0.07, -0.04, 0.88, -0.52, -0.28, -0.55, 0.53, 0.99, -0.52, -0.59, -0.48, -0.07, 0.20, -0.34, 1.00, -0.52) t.trunc=c( -2.05, -0.25, -2.43, -0.32, -0.27, -1.06, -0.95, -0.82, -0.66, -0.28, -1.14, -0.32, -1.19, -2.18, -0.45, -1.71, -0.84, -1.93, -1.04, -2.58, -1.97, -2.15, -0.59, -0.74, -1.26, -2.57, -2.40, -2.22, -1.52, -0.21, -1.50, -1.99, -1.79) d=c(1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1,1) x1.trunc=c( 0.27, 0.66, 0.77, 0.21, 0.48, 0.11, 0.69, 0.32, 0.33, 0.43, 0.12, 0.60, 0.13, 0.43, 0.99, 0.21, 0.93, 0.60, 0.45, 0.41, 0.86, 0.90, 0.76, 0.93, 0.27, 0.13, 0.82, 0.17, 0.63, 0.31, 0.13, 0.48, 0.32) ### Data analysis in Emura & Wang (2016) ### # dependAFT.reg(t.trunc,y.trunc,d,x1.trunc,alpha=2,LY=TRUE,beta1_low=-5,beta1_up=5) dependAFT.reg(t.trunc,y.trunc,d,x1.trunc,LY=FALSE,beta1_low=-5,beta1_up=5) #### Channing hourse data analysis; Section 5 of Emura & Wang (2016) ##### # library(KMsurv) # data(channing) # y.trunc=log(channing$age) # t.trunc=log(channing$ageentry) # d=channing$death # x1.trunc=as.numeric(channing$gender==1) # dependAFT.reg(t.trunc,y.trunc,d,x1.trunc,beta1_low=-0.2,beta1_up=0.2) # dependAFT.reg(t.trunc,y.trunc,d,x1.trunc,LY=TRUE,alpha=2,beta1_low=-0.2,beta1_up=0.2)
A copula-based estimation based on dependent truncation data under the Clayton copula model (Emura, Wang & Hung 2011; Emura & Murotani 2015). The forms of the marginal distributions for X and Y are completely unspecified, but the parametric form of copula is specified as the Clayton copula.
EMURA.Clayton(x.trunc, z.trunc, d, a = 1/10, plotX = TRUE, plotY = TRUE)
EMURA.Clayton(x.trunc, z.trunc, d, a = 1/10, plotX = TRUE, plotY = TRUE)
x.trunc |
vector of variables satisfying x.trunc<=z.trunc |
z.trunc |
vector of variables satisfying x.trunc<=z.trunc |
d |
censoring indicator(0=censoring,1=failure) for z.trunc |
a |
tuning parameter adjusting for small the risk sets (pp.360-361: Emura, Wang & Hung 2011 Sinica) |
plotX |
if TRUE, plot the distribution function of X |
plotY |
if TRUE, plot the survival function of Y |
The function produces the moment-based estimate for the marginal distributions and the estimate of the association parameter under the Clayton copula model. The method can handle right-censoring for Y in which Z=min(Y, C) and I(Y<=C) are observed with censoring variable C.
alpha |
association parameter |
tau |
Kendall's tau between X and Y |
alpha |
association parameter |
c |
inclusion probability, defined by c=Pr(X<=Z) |
Fx |
marginal distribution function of X at at (ordered) observed points of X |
Sy |
margianl survival function of Y at (ordered) observed points of Y |
Takeshi Emura
Emura T, Wang W, Hung HN (2011), Semiparametric Inference for Copula Models for Truncated Data, Stat Sinica 21: 349-367.
Emura T, Murotani K (2015), An Algorithm for Estimating Survival Under a Copula-based Dependent Truncation Model, TEST 24 (No.4): 734-751.
########### AIDS data of Kalbfleisch & Lawless (1989, JASA) ############# inf1=c(23,38,38,36,27,45,23,48,25,42,33,45,33,39,34,48,50,35,26,43,3,53,40,53, 28,34,42,66,19,21,37,33,31,48,32,43,17,64,58,67,49,67,35,12,19,60,53,56,65,53) inf2=c(36,12,50,45,33,55,37,46,62,57,34,56,57,64,57,42,54,28,36,66,19,45,53,67, 68,54,40,60,54,42,74,71,43,61,68,52,75,46,62,67,48,68,58,55,70,33,56,47,64,15) inf3=c(41,35,67,35,71,67,36,69,45,76,66,22,74,49,42,15,29,62,65,75,65,69,62,56, 52,82,46,75,27,56,70,49,66,73,76,43,50,41,49,68,39,67,61,82,69,65,56,59,57,57) inf4=c(46,68,76,64,50,59,80,46,78,26,62,19,22,26,76,27,62,75,76,57,58,59,8,41, 70,57,58,63,37,75,58,39,38,73,72,41,56,50,79,83,76,29,17,69,86,29,65,75,74,42) inf5=c(65,61,84,41,83,58,45,83,80,84,59,85,59,65,47,64,73,81,79,36,67,87,85,29, 72,77,72,67,53,54,17,61,65,48,57,29,36,30,45,40,75,43,76,66,86,57,75,71,51) inf6=c(60,41,53,48,36,72,60,36,48,55,58,60,89,37,82,41,68,71,63,49,37,60,78,52, 60,85,68,37,39,22,12,63,80,45,47,85,29,60,84,70,61,69,77,63) x1=c(27,14,15,18,28,10,34,17,34,17,29,17,29,23,29,15,13,29,38,21,61,12,25,12,38, 32,24,0,48,46,30,34,37,21,37,26,53,6,13,4,22,4,37,60,53,13,20,17,8,20) x2=c(38,62,24,29,41,19,37,28,13,18,41,19,18,11,18,33,21,48,40,10,58,32,24,11,10, 25,39,19,25,37,5,8,37,20,13,29,6,35,19,14,33,13,23,27,12,49,26,35,18,68) x3=c(42,48,16,48,12,16,47,14,38,8,18,62,10,35,42,69,55,22,20,10,20,16,23,30,34,4, 40,11,59,30,16,37,20,13,10,43,36,46,38,19,48,20,26,5,18,23,32,29,31,31) x4=c(42,20,12,24,38,29,8,43,11,63,27,70,67,63,13,62,27,15,14,33,32,32,83,50,21, 34,33,29,55,17,34,53,54,19,20,52,37,43,14,10,17,64,76,25,8,65,29,19,20,52) x5=c(29,33,10,53,11,36,49,12,15,11,36,10,36,31,49,32,23,15,17,60,29,9,11,67,24, 19,24,29,43,43,80,36,32,49,40,68,61,68,53,58,23,55,22,32,12,41,23,27,47) x6=c(38,57,46,51,63,27,39,63,51,44,41,39,10,63,18,59,32,29,37,51,63,40,22,48,40, 15,33,64,62,79,89,38,21,56,54,16,72,41,17,31,40,32,24,38) t=c(inf1,inf2,inf3,inf4,inf5,inf6) #### the month of infection with 1=January 1978 #### x=c(x1,x2,x3,x4,x5,x6) #### the duration of the incubation period (month) #### y=102-t #### 102 is the study period (month) #### ######### Breaking ties by adding small noise to the data ########## set.seed(1) x=x+runif(293,min=-0.4,max=0.4) y=y+runif(293,min=-0.4,max=0.4) x[x<=0]=runif(1,0,0.4) x.trunc=x z.trunc=y d=rep(1,length(x.trunc)) ### all data is not censored ### EMURA.Clayton(x.trunc,z.trunc,d)[c(1,2,3)] ######### The same numerical results as Table 3 of Emura et al. (2011) ###########
########### AIDS data of Kalbfleisch & Lawless (1989, JASA) ############# inf1=c(23,38,38,36,27,45,23,48,25,42,33,45,33,39,34,48,50,35,26,43,3,53,40,53, 28,34,42,66,19,21,37,33,31,48,32,43,17,64,58,67,49,67,35,12,19,60,53,56,65,53) inf2=c(36,12,50,45,33,55,37,46,62,57,34,56,57,64,57,42,54,28,36,66,19,45,53,67, 68,54,40,60,54,42,74,71,43,61,68,52,75,46,62,67,48,68,58,55,70,33,56,47,64,15) inf3=c(41,35,67,35,71,67,36,69,45,76,66,22,74,49,42,15,29,62,65,75,65,69,62,56, 52,82,46,75,27,56,70,49,66,73,76,43,50,41,49,68,39,67,61,82,69,65,56,59,57,57) inf4=c(46,68,76,64,50,59,80,46,78,26,62,19,22,26,76,27,62,75,76,57,58,59,8,41, 70,57,58,63,37,75,58,39,38,73,72,41,56,50,79,83,76,29,17,69,86,29,65,75,74,42) inf5=c(65,61,84,41,83,58,45,83,80,84,59,85,59,65,47,64,73,81,79,36,67,87,85,29, 72,77,72,67,53,54,17,61,65,48,57,29,36,30,45,40,75,43,76,66,86,57,75,71,51) inf6=c(60,41,53,48,36,72,60,36,48,55,58,60,89,37,82,41,68,71,63,49,37,60,78,52, 60,85,68,37,39,22,12,63,80,45,47,85,29,60,84,70,61,69,77,63) x1=c(27,14,15,18,28,10,34,17,34,17,29,17,29,23,29,15,13,29,38,21,61,12,25,12,38, 32,24,0,48,46,30,34,37,21,37,26,53,6,13,4,22,4,37,60,53,13,20,17,8,20) x2=c(38,62,24,29,41,19,37,28,13,18,41,19,18,11,18,33,21,48,40,10,58,32,24,11,10, 25,39,19,25,37,5,8,37,20,13,29,6,35,19,14,33,13,23,27,12,49,26,35,18,68) x3=c(42,48,16,48,12,16,47,14,38,8,18,62,10,35,42,69,55,22,20,10,20,16,23,30,34,4, 40,11,59,30,16,37,20,13,10,43,36,46,38,19,48,20,26,5,18,23,32,29,31,31) x4=c(42,20,12,24,38,29,8,43,11,63,27,70,67,63,13,62,27,15,14,33,32,32,83,50,21, 34,33,29,55,17,34,53,54,19,20,52,37,43,14,10,17,64,76,25,8,65,29,19,20,52) x5=c(29,33,10,53,11,36,49,12,15,11,36,10,36,31,49,32,23,15,17,60,29,9,11,67,24, 19,24,29,43,43,80,36,32,49,40,68,61,68,53,58,23,55,22,32,12,41,23,27,47) x6=c(38,57,46,51,63,27,39,63,51,44,41,39,10,63,18,59,32,29,37,51,63,40,22,48,40, 15,33,64,62,79,89,38,21,56,54,16,72,41,17,31,40,32,24,38) t=c(inf1,inf2,inf3,inf4,inf5,inf6) #### the month of infection with 1=January 1978 #### x=c(x1,x2,x3,x4,x5,x6) #### the duration of the incubation period (month) #### y=102-t #### 102 is the study period (month) #### ######### Breaking ties by adding small noise to the data ########## set.seed(1) x=x+runif(293,min=-0.4,max=0.4) y=y+runif(293,min=-0.4,max=0.4) x[x<=0]=runif(1,0,0.4) x.trunc=x z.trunc=y d=rep(1,length(x.trunc)) ### all data is not censored ### EMURA.Clayton(x.trunc,z.trunc,d)[c(1,2,3)] ######### The same numerical results as Table 3 of Emura et al. (2011) ###########
A copula-based estimation based on dependent truncation data under the Frank copula model (Emura, Wang & Hung 2011; Emura & Murotani 2015). The forms of the marginal distributions for X and Y are completely unspecified, but the parametric form of copula is specified as the Frank copula.
EMURA.Frank(x.trunc, z.trunc, d, a = 1/10, plotX = TRUE, plotY = TRUE)
EMURA.Frank(x.trunc, z.trunc, d, a = 1/10, plotX = TRUE, plotY = TRUE)
x.trunc |
vector of variables satisfying x.trunc<=z.trunc |
z.trunc |
vector of variables satisfying x.trunc<=z.trunc |
d |
censoring indicator(0=censoring,1=failure) for z.trunc |
a |
tuning parameter adjusting for small the risk sets (pp.360-361: Emura, Wang & Hung 2011 Sinica) |
plotX |
if TRUE, plot the distribution function of X |
plotY |
if TRUE, plot the survival function of Y |
The function produces the moment-based estimate for the marginal distributions and the estimate of the association parameter under the Frank copula model. The method can handle right-censoring for Y in which Z=min(Y, C) and I(Y<=C) are observed with censoring variable C.
alpha |
association parameter |
tau |
Kendall's tau between X and Y |
c |
inclusion probability, defined by c=Pr(X<=Z) |
Fx |
marginal distribution function of X at at (ordered) observed points of X |
Sy |
margianl survival function of Y at (ordered) observed points of Y |
Takeshi EMURA
Emura T, Wang W, Hung HN (2011), Semiparametric Inference for Copula Models for Truncated Data, Stat Sinica 21: 349-367.
Emura T, Murotani K (2015), An Algorithm for Estimating Survival Under a Copula-based Dependent Truncation Model, TEST 24 (No.4): 734-751.
########### AIDS data of Kalbfleisch & Lawless (1989, JASA) ############# inf1=c(23,38,38,36,27,45,23,48,25,42,33,45,33,39,34,48,50,35,26,43,3,53,40,53, 28,34,42,66,19,21,37,33,31,48,32,43,17,64,58,67,49,67,35,12,19,60,53,56,65,53) inf2=c(36,12,50,45,33,55,37,46,62,57,34,56,57,64,57,42,54,28,36,66,19,45,53,67, 68,54,40,60,54,42,74,71,43,61,68,52,75,46,62,67,48,68,58,55,70,33,56,47,64,15) inf3=c(41,35,67,35,71,67,36,69,45,76,66,22,74,49,42,15,29,62,65,75,65,69,62,56, 52,82,46,75,27,56,70,49,66,73,76,43,50,41,49,68,39,67,61,82,69,65,56,59,57,57) inf4=c(46,68,76,64,50,59,80,46,78,26,62,19,22,26,76,27,62,75,76,57,58,59,8,41, 70,57,58,63,37,75,58,39,38,73,72,41,56,50,79,83,76,29,17,69,86,29,65,75,74,42) inf5=c(65,61,84,41,83,58,45,83,80,84,59,85,59,65,47,64,73,81,79,36,67,87,85,29, 72,77,72,67,53,54,17,61,65,48,57,29,36,30,45,40,75,43,76,66,86,57,75,71,51) inf6=c(60,41,53,48,36,72,60,36,48,55,58,60,89,37,82,41,68,71,63,49,37,60,78,52, 60,85,68,37,39,22,12,63,80,45,47,85,29,60,84,70,61,69,77,63) x1=c(27,14,15,18,28,10,34,17,34,17,29,17,29,23,29,15,13,29,38,21,61,12,25,12,38, 32,24,0,48,46,30,34,37,21,37,26,53,6,13,4,22,4,37,60,53,13,20,17,8,20) x2=c(38,62,24,29,41,19,37,28,13,18,41,19,18,11,18,33,21,48,40,10,58,32,24,11,10, 25,39,19,25,37,5,8,37,20,13,29,6,35,19,14,33,13,23,27,12,49,26,35,18,68) x3=c(42,48,16,48,12,16,47,14,38,8,18,62,10,35,42,69,55,22,20,10,20,16,23,30,34,4, 40,11,59,30,16,37,20,13,10,43,36,46,38,19,48,20,26,5,18,23,32,29,31,31) x4=c(42,20,12,24,38,29,8,43,11,63,27,70,67,63,13,62,27,15,14,33,32,32,83,50,21, 34,33,29,55,17,34,53,54,19,20,52,37,43,14,10,17,64,76,25,8,65,29,19,20,52) x5=c(29,33,10,53,11,36,49,12,15,11,36,10,36,31,49,32,23,15,17,60,29,9,11,67,24, 19,24,29,43,43,80,36,32,49,40,68,61,68,53,58,23,55,22,32,12,41,23,27,47) x6=c(38,57,46,51,63,27,39,63,51,44,41,39,10,63,18,59,32,29,37,51,63,40,22,48,40, 15,33,64,62,79,89,38,21,56,54,16,72,41,17,31,40,32,24,38) t=c(inf1,inf2,inf3,inf4,inf5,inf6) #### the month of infection with 1=January 1978 #### x=c(x1,x2,x3,x4,x5,x6) #### the duration of the incubation period (month) #### y=102-t #### 102 is the study period (month) #### ######### Breaking ties by adding small noise to the data ########## set.seed(1) x=x+runif(293,min=-0.4,max=0.4) y=y+runif(293,min=-0.4,max=0.4) x[x<=0]=runif(1,0,0.4) x.trunc=x z.trunc=y d=rep(1,length(x.trunc)) ### all data is not censored ### EMURA.Frank(x.trunc,z.trunc,d)[c(1,2,3)] ######### The same numerical results as Table 3 of Emura et al. (2011) ###########
########### AIDS data of Kalbfleisch & Lawless (1989, JASA) ############# inf1=c(23,38,38,36,27,45,23,48,25,42,33,45,33,39,34,48,50,35,26,43,3,53,40,53, 28,34,42,66,19,21,37,33,31,48,32,43,17,64,58,67,49,67,35,12,19,60,53,56,65,53) inf2=c(36,12,50,45,33,55,37,46,62,57,34,56,57,64,57,42,54,28,36,66,19,45,53,67, 68,54,40,60,54,42,74,71,43,61,68,52,75,46,62,67,48,68,58,55,70,33,56,47,64,15) inf3=c(41,35,67,35,71,67,36,69,45,76,66,22,74,49,42,15,29,62,65,75,65,69,62,56, 52,82,46,75,27,56,70,49,66,73,76,43,50,41,49,68,39,67,61,82,69,65,56,59,57,57) inf4=c(46,68,76,64,50,59,80,46,78,26,62,19,22,26,76,27,62,75,76,57,58,59,8,41, 70,57,58,63,37,75,58,39,38,73,72,41,56,50,79,83,76,29,17,69,86,29,65,75,74,42) inf5=c(65,61,84,41,83,58,45,83,80,84,59,85,59,65,47,64,73,81,79,36,67,87,85,29, 72,77,72,67,53,54,17,61,65,48,57,29,36,30,45,40,75,43,76,66,86,57,75,71,51) inf6=c(60,41,53,48,36,72,60,36,48,55,58,60,89,37,82,41,68,71,63,49,37,60,78,52, 60,85,68,37,39,22,12,63,80,45,47,85,29,60,84,70,61,69,77,63) x1=c(27,14,15,18,28,10,34,17,34,17,29,17,29,23,29,15,13,29,38,21,61,12,25,12,38, 32,24,0,48,46,30,34,37,21,37,26,53,6,13,4,22,4,37,60,53,13,20,17,8,20) x2=c(38,62,24,29,41,19,37,28,13,18,41,19,18,11,18,33,21,48,40,10,58,32,24,11,10, 25,39,19,25,37,5,8,37,20,13,29,6,35,19,14,33,13,23,27,12,49,26,35,18,68) x3=c(42,48,16,48,12,16,47,14,38,8,18,62,10,35,42,69,55,22,20,10,20,16,23,30,34,4, 40,11,59,30,16,37,20,13,10,43,36,46,38,19,48,20,26,5,18,23,32,29,31,31) x4=c(42,20,12,24,38,29,8,43,11,63,27,70,67,63,13,62,27,15,14,33,32,32,83,50,21, 34,33,29,55,17,34,53,54,19,20,52,37,43,14,10,17,64,76,25,8,65,29,19,20,52) x5=c(29,33,10,53,11,36,49,12,15,11,36,10,36,31,49,32,23,15,17,60,29,9,11,67,24, 19,24,29,43,43,80,36,32,49,40,68,61,68,53,58,23,55,22,32,12,41,23,27,47) x6=c(38,57,46,51,63,27,39,63,51,44,41,39,10,63,18,59,32,29,37,51,63,40,22,48,40, 15,33,64,62,79,89,38,21,56,54,16,72,41,17,31,40,32,24,38) t=c(inf1,inf2,inf3,inf4,inf5,inf6) #### the month of infection with 1=January 1978 #### x=c(x1,x2,x3,x4,x5,x6) #### the duration of the incubation period (month) #### y=102-t #### 102 is the study period (month) #### ######### Breaking ties by adding small noise to the data ########## set.seed(1) x=x+runif(293,min=-0.4,max=0.4) y=y+runif(293,min=-0.4,max=0.4) x[x<=0]=runif(1,0,0.4) x.trunc=x z.trunc=y d=rep(1,length(x.trunc)) ### all data is not censored ### EMURA.Frank(x.trunc,z.trunc,d)[c(1,2,3)] ######### The same numerical results as Table 3 of Emura et al. (2011) ###########
The three log-rank statistics (L_0, L_1, and L_log) corresponding to 3 different weights.
Logrank.stat(x.trunc, z.trunc, d)
Logrank.stat(x.trunc, z.trunc, d)
x.trunc |
vector of variables satisfying x.trunc<=z.trunc |
z.trunc |
vector of variables satisfying x.trunc<=z.trunc |
d |
censoring indicator(0=censoring,1=failure) for z.trunc |
If there is no tie in the data, the function "Logrank.stat.tie" and "Logrank.stat" give identical results. However, "Logrank.stat" is computationally more efficient. The simulations of Emura & Wang (2010) are based on "Logrank.stat" since simulated data are generated from continuous distributions. The real data analyses of Emura & Wang (2010) are based on "Logrank.stat.tie" since there are many ties in the data.
L0 |
Logrank statistics (most powerfull to detect the Clayton copula type dependence) |
L1 |
Logrank statistics (most powerfull to detect the Frank copula type dependence) |
Llog |
Logrank statistics (most powerfull to detect the Gumbel copula type dependence) |
Takeshi Emura
Emura T, Wang W (2010) Testing quasi-independence for truncation data. Journal of Multivariate Analysis 101, 223-239
x.trunc=c(10,5,7,1,3,9) z.trunc=c(12,11,8,6,4,13) d=c(1,1,1,1,0,1) Logrank.stat(x.trunc,z.trunc,d)
x.trunc=c(10,5,7,1,3,9) z.trunc=c(12,11,8,6,4,13) d=c(1,1,1,1,0,1) Logrank.stat(x.trunc,z.trunc,d)
The three log-rank statistics (L_0, L_1, and L_log) corresponding to 3 different weights.
Logrank.stat.tie(x.trunc, z.trunc, d)
Logrank.stat.tie(x.trunc, z.trunc, d)
x.trunc |
vector of variables satisfying x.trunc<=z.trunc |
z.trunc |
vector of variables satisfying x.trunc<=z.trunc |
d |
censoring indicator(0=censoring,1=failure) for z.trunc |
If there is no tie in the data, the function "Logrank.stat.tie" and "Logrank.stat" give identical results. However, "Logrank.stat" is computationally more efficient. The simulations of Emura & Wang (2010) are based on "Logrank.stat" since simulated data are generated from continuous distributions. The real data analyses of Emura & Wang (2010) are based on "Logrank.stat.tie" since there are many ties in the data.
L0 |
Logrank statistics (most powerfull to detect the Clayton copula type dependence) |
L1 |
Logrank statistics (most powerfull to detect the Frank copula type dependence) |
Llog |
Logrank statistics (most powerfull to detect the Gumbel copula type dependence) |
Takeshi Emura
Emura T, Wang W (2010) Testing quasi-independence for truncation data. Journal of Multivariate Analysis 101, 223-239
x.trunc=c(10,5,7,1,3,9) z.trunc=c(12,11,8,6,4,13) d=c(1,1,1,1,0,1) Logrank.stat.tie(x.trunc,z.trunc,d) Logrank.stat(x.trunc,z.trunc,d) ## since there is no tie, the results are the same.
x.trunc=c(10,5,7,1,3,9) z.trunc=c(12,11,8,6,4,13) d=c(1,1,1,1,0,1) Logrank.stat.tie(x.trunc,z.trunc,d) Logrank.stat(x.trunc,z.trunc,d) ## since there is no tie, the results are the same.
Nonparametric maximum likelihood estimation for dependent truncation data under the Frank copula models (Emura & Wang, 2012). The forms of the marginal distributions for X and Y are completely unspecified, but the parametric form of copula is specified as the Frank copula.
NPMLE.Frank(x.trunc, y.trunc, x.fix = median(x.trunc), y.fix = median(y.trunc), plotX = TRUE)
NPMLE.Frank(x.trunc, y.trunc, x.fix = median(x.trunc), y.fix = median(y.trunc), plotX = TRUE)
x.trunc |
vector of variables satisfying x.trunc<=y.trunc |
y.trunc |
vector of variables satisfying x.trunc<=y.trunc |
x.fix |
vector of fixed points at which marginal distribution function of X is calculated |
y.fix |
vector of fixed points at which marginal survival function of Y are calculated |
plotX |
if TRUE, the culumative distribution function for X is plotted |
The function produces the nonparametric maximum likelihood estimate (NPMLE) for the marginal distributions and the estimate of the association parameter under the Frank copula model. The method follows Emura & Wang (2012). The maximization of the likelihood (L) is conducted by minimizing -logL by "nlm". Standard errors are calculated from the diagonal elements in the observed Fisher information matrix, which is obtained from the output of the "nlm". The method can handle ties but cannot handle right-censoring.
alpha |
estimate of association parameter |
alpha_se |
standard error of the estimate of association parameter |
Hx |
estimate of the marginal cumulative reverse-hazard function for X |
Hx_se |
standard error of the estimate of the marginal cumulative reverse-hazard function for X |
Ay |
estimate of the marginal cumulative hazard function for Y |
Ay_se |
standard error of the estimate of the marginal cumulative hazard function for Y |
Fx |
estimate of the marginal distribution function for X |
Fx_se |
standard error of the estimate of the marginal distribution function for X |
Sy |
estimate of the marginal survival function for Y |
Sy_se |
standard error of the estimate of the marginal survival function for Y |
conv |
an integer indicating why the optimization process terminated in "nlm": If conv=1, the maximization of the likelihood function is properly done. Please refer R function "nlm" for more details. |
iteration |
the number of iterations until convergence |
Grad |
L_2 norm for the gradient vector at the solution (close to zero if the solution is proper) |
MinEigen |
Minimum eigenvalue of the Hessian matrix at the solution (positive if the solution is proper) |
Takeshi EMURA
Emura T, Wang W (2012) Nonparametric maximum likelihood estimation for dependent truncation data based on copulas, Journal of Multivariate Analysis 110, 171-88
x.trunc=c(0.53, 0.43, 1.63, 0.98, 0.62) y.trunc=c(1.20, 4.93, 2.09, 2.57, 1.52) NPMLE.Frank(x.trunc, y.trunc, x.fix =1, y.fix = 2, plotX = TRUE)
x.trunc=c(0.53, 0.43, 1.63, 0.98, 0.62) y.trunc=c(1.20, 4.93, 2.09, 2.57, 1.52) NPMLE.Frank(x.trunc, y.trunc, x.fix =1, y.fix = 2, plotX = TRUE)
Nonparametric maximum likelihood estimation for dependent truncation data under the independence copula models (Emura & Wang, 2012). The forms of the marginal distributions for X and Y are completely unspecified, but the parametric form of copula is specified as the independence copula.
NPMLE.Indep(x.trunc, y.trunc, x.fix = median(x.trunc), y.fix = median(y.trunc), plotX = TRUE)
NPMLE.Indep(x.trunc, y.trunc, x.fix = median(x.trunc), y.fix = median(y.trunc), plotX = TRUE)
x.trunc |
vector of variables satisfying x.trunc<=y.trunc |
y.trunc |
vector of variables satisfying x.trunc<=y.trunc |
x.fix |
vector of fixed points at which marginal distribution function of X is calculated |
y.fix |
vector of fixed points at which marginal survival function of Y are calculated |
plotX |
if TRUE, the culumative distribution function for X is plotted |
The function produces the nonparametric maximum likelihood estimate (NPMLE) for the marginal distributions and the estimate of the association parameter under the independence copula model. The method follows Emura & Wang (2012). The maximization of the likelihood (L) is conducted by minimizing -logL by "nlm". Standard errors are calculated from the diagonal elements in the observed Fisher information matrix, which is obtained from the output of the "nlm". The method can handle ties but cannot handle right-censoring.
Hx |
estimate of the marginal cumulative reverse-hazard function for X |
Hx_se |
standard error of the estimate of the marginal cumulative reverse-hazard function for X |
Ay |
estimate of the marginal cumulative hazard function for Y |
Ay_se |
standard error of the estimate of the marginal cumulative hazard function for Y |
Fx |
estimate of the marginal distribution function for X |
Fx_se |
standard error of the estimate of the marginal distribution function for X |
Sy |
estimate of the marginal survival function for Y |
Sy_se |
standard error of the estimate of the marginal survival function for Y |
conv |
an integer indicating why the optimization process terminated in "nlm": If conv=1, the maximization of the likelihood function is properly done. Please refer R function "nlm" for more details. |
Grad |
L_2 norm for the gradient vector at the solution (close to zero if the solution is proper) |
MinEigen |
Minimum eigenvalue of the Hessian matrix at the solution (positive if the solution is proper) |
Takeshi EMURA
Emura T, Wang W (2012) Nonparametric maximum likelihood estimation for dependent truncation data based on copulas, Journal of Multivariate Analysis 110, 171-88
##### Generate independent truncated data with unit exponential marginals ##### set.seed(1) m=35 #### sample size #### x.trunc=y.trunc=numeric(m) l=1 while(l<=m){ x=rexp(1,rate=1) y=rexp(1,rate=1) if((x<y)){ x.trunc[l]=x;y.trunc[l]=y l=l+1 } } NPMLE.Indep(x.trunc, y.trunc, x.fix =1, y.fix = 1, plotX = TRUE) #### compare the above estimate with the true value ##### c(Fx_true=1-exp(-1),Sy_true=exp(-1))
##### Generate independent truncated data with unit exponential marginals ##### set.seed(1) m=35 #### sample size #### x.trunc=y.trunc=numeric(m) l=1 while(l<=m){ x=rexp(1,rate=1) y=rexp(1,rate=1) if((x<y)){ x.trunc[l]=x;y.trunc[l]=y l=l+1 } } NPMLE.Indep(x.trunc, y.trunc, x.fix =1, y.fix = 1, plotX = TRUE) #### compare the above estimate with the true value ##### c(Fx_true=1-exp(-1),Sy_true=exp(-1))
Nonparametric maximum likelihood estimation for dependent truncation data under the normal(Gaussian) copula models (Emura & Wang, 2012). The forms of the marginal distributions for X and Y are completely unspecified, but the parametric form of copula is specified as the normal(Gaussian) copula.
NPMLE.Normal(x.trunc, y.trunc, x.fix = median(x.trunc), y.fix = median(y.trunc), plotX = TRUE)
NPMLE.Normal(x.trunc, y.trunc, x.fix = median(x.trunc), y.fix = median(y.trunc), plotX = TRUE)
x.trunc |
vector of variables satisfying x.trunc<=y.trunc |
y.trunc |
vector of variables satisfying x.trunc<=y.trunc |
x.fix |
vector of fixed points at which marginal distribution function of X is calculated |
y.fix |
vector of fixed points at which marginal survival function of Y are calculated |
plotX |
if TRUE, the culumative distribution function for X is plotted |
The function produces the nonparametric maximum likelihood estimate (NPMLE) for the marginal distributions and the estimate of the association parameter under the normal(Gaussian) copula model. The method follows Emura & Wang (2012). The maximization of the likelihood (L) is conducted by minimizing -logL by "nlm". Standard errors are calculated from the diagonal elements in the observed Fisher information matrix, which is obtained from the output of the "nlm". The method can handle ties but cannot handle right-censoring.
alpha |
estimate of association parameter |
alpha_se |
standard error of the estimate of association parameter |
Hx |
estimate of the marginal cumulative reverse-hazard function for X |
Hx_se |
standard error of the estimate of the marginal cumulative reverse-hazard function for X |
Ay |
estimate of the marginal cumulative hazard function for Y |
Ay_se |
standard error of the estimate of the marginal cumulative hazard function for Y |
Fx |
estimate of the marginal distribution function for X |
Fx_se |
standard error of the estimate of the marginal distribution function for X |
Sy |
estimate of the marginal survival function for Y |
Sy_se |
standard error of the estimate of the marginal survival function for Y |
conv |
an integer indicating why the optimization process terminated in "nlm": If conv=1, the maximization of the likelihood function is properly done. Please refer R function "nlm" for more details. |
iteration |
the number of iterations until convergence |
Grad |
L_2 norm for the gradient vector at the solution (close to zero if the solution is proper) |
MinEigen |
Minimum eigenvalue of the Hessian matrix at the solution (positive if the solution is proper) |
Takeshi EMURA
Emura T, Wang W (2012) Nonparametric maximum likelihood estimation for dependent truncation data based on copulas, Journal of Multivariate Analysis 110, 171-88
x.trunc=c(0.53, 0.43, 1.63, 0.98, 0.62) y.trunc=c(1.20, 4.93, 2.09, 2.57, 1.52) # NPMLE.Normal(x.trunc, y.trunc, x.fix =1, y.fix = 2, plotX = TRUE)
x.trunc=c(0.53, 0.43, 1.63, 0.98, 0.62) y.trunc=c(1.20, 4.93, 2.09, 2.57, 1.52) # NPMLE.Normal(x.trunc, y.trunc, x.fix =1, y.fix = 2, plotX = TRUE)
Nonparametric maximum likelihood estimation for dependent truncation data under the Plackett copula models (Emura & Wang, 2012). The forms of the marginal distributions for X and Y are completely unspecified, but the parametric form of copula is specified as the Plackett copula.
NPMLE.Plackett(x.trunc, y.trunc, x.fix = median(x.trunc), y.fix = median(y.trunc), plotX = TRUE)
NPMLE.Plackett(x.trunc, y.trunc, x.fix = median(x.trunc), y.fix = median(y.trunc), plotX = TRUE)
x.trunc |
vector of variables satisfying x.trunc<=y.trunc |
y.trunc |
vector of variables satisfying x.trunc<=y.trunc |
x.fix |
vector of fixed points at which marginal distribution function of X is calculated |
y.fix |
vector of fixed points at which marginal survival function of Y are calculated |
plotX |
if TRUE, the culumative distribution function for X is plotted |
The function produces the nonparametric maximum likelihood estimate (NPMLE) for the marginal distributions and the estimate of the association parameter under the Plackett copula model. The method follows Emura & Wang (2012). The maximization of the likelihood (L) is conducted by minimizing -logL by "nlm". Standard errors are calculated from the diagonal elements in the observed Fisher information matrix, which is obtained from the output of the "nlm". The method can handle ties but cannot handle right-censoring.
alpha |
estimate of association parameter |
alpha_se |
standard error of the estimate of association parameter |
Hx |
estimate of the marginal cumulative reverse-hazard function for X |
Hx_se |
standard error of the estimate of the marginal cumulative reverse-hazard function for X |
Ay |
estimate of the marginal cumulative hazard function for Y |
Ay_se |
standard error of the estimate of the marginal cumulative hazard function for Y |
Fx |
estimate of the marginal distribution function for X |
Fx_se |
standard error of the estimate of the marginal distribution function for X |
Sy |
estimate of the marginal survival function for Y |
Sy_se |
standard error of the estimate of the marginal survival function for Y |
conv |
an integer indicating why the optimization process terminated in "nlm": If conv=1, the maximization of the likelihood function is properly done. Please refer R function "nlm" for more details. |
iteration |
the number of iterations until convergence |
Grad |
L_2 norm for the gradient vector at the solution (close to zero if the solution is proper) |
MinEigen |
Minimum eigenvalue of the Hessian matrix at the solution (positive if the solution is proper) |
Takeshi EMURA
Emura T, Wang W (2012) Nonparametric maximum likelihood estimation for dependent truncation data based on copulas, Journal of Multivariate Analysis 110, 171-88
##### Generate truncated data from Plackett copula with unit exponential marginals ##### set.seed(1) m=25 #### sample size #### alpha_true=1/5.11 #### Kendall's tau on (X,Y) = 0.5 #### x.trunc=y.trunc=numeric(m) l=1 while(l<=m){ u=runif(1,min=0,max=1) v=runif(1,min=0,max=1) K=function(w){ A=sqrt( (1+(alpha_true-1)*(u+w))^2-4*alpha_true*(alpha_true-1)*u*w ) 2*v+( 1+(alpha_true-1)*u-(alpha_true+1)*w )/A-1 } low=0.00001*u up=1-0.00001*v for(j in 1:100){ #### Invert K(.) by the bisection method to #### mid=(low+up)/2;M<-K(mid);U<-K(up) if(M*U>0){up<-mid}else{low<-mid} } w=mid x=-log(1-u);y=-log(w) if((x<y)){ x.trunc[l]=x;y.trunc[l]=y l=l+1 } } NPMLE.Plackett(x.trunc, y.trunc, x.fix =1, y.fix = 1, plotX = TRUE) #### compare the above estimate with the true value ##### c(alpha_true=alpha_true,Fx_true=1-exp(-1),Sy_true=exp(-1))
##### Generate truncated data from Plackett copula with unit exponential marginals ##### set.seed(1) m=25 #### sample size #### alpha_true=1/5.11 #### Kendall's tau on (X,Y) = 0.5 #### x.trunc=y.trunc=numeric(m) l=1 while(l<=m){ u=runif(1,min=0,max=1) v=runif(1,min=0,max=1) K=function(w){ A=sqrt( (1+(alpha_true-1)*(u+w))^2-4*alpha_true*(alpha_true-1)*u*w ) 2*v+( 1+(alpha_true-1)*u-(alpha_true+1)*w )/A-1 } low=0.00001*u up=1-0.00001*v for(j in 1:100){ #### Invert K(.) by the bisection method to #### mid=(low+up)/2;M<-K(mid);U<-K(up) if(M*U>0){up<-mid}else{low<-mid} } w=mid x=-log(1-u);y=-log(w) if((x<y)){ x.trunc[l]=x;y.trunc[l]=y l=l+1 } } NPMLE.Plackett(x.trunc, y.trunc, x.fix =1, y.fix = 1, plotX = TRUE) #### compare the above estimate with the true value ##### c(alpha_true=alpha_true,Fx_true=1-exp(-1),Sy_true=exp(-1))
Maximum likelihood estimation (MLE) for dependent truncation data under the Clayton copula with Exponential margins for a bivariate lifetimes (L, X). The truncated data (L_j, X_j), subject to L_j<=X_j for all j=1, ..., n, are used to obtain the MLE for the population parameters of (L, X).
PMLE.Clayton.Exponential(l.trunc, x.trunc, GOF = TRUE, Err=3, alpha_max=20,alpha_min=10^-4)
PMLE.Clayton.Exponential(l.trunc, x.trunc, GOF = TRUE, Err=3, alpha_max=20,alpha_min=10^-4)
l.trunc |
vector of truncation variables satisfying l.trunc<=x.trunc |
x.trunc |
vector of variables satisfying l.trunc<=x.trunc |
GOF |
if TRUE, a goodness-of-fit test statistics is computed |
Err |
tuning parameter in the NR algorithm |
alpha_max |
upper bound for the copula parameter |
alpha_min |
lower bound for the copula parameter |
Original paper is submitted for review
n |
sample size |
alpha |
dependence parameter |
lambda_L |
scale parameter of L |
lambda_X |
scale parameter of X |
mean_X |
Mean lifetime of X, defined as E[X] |
logL |
Maximized log-likelihood |
c |
inclusion probability, defined by c=Pr(L<=X) |
C |
Cramer-von Mises goodness-of-fit test statistics |
K |
Kolmogorov-Smirnov goodness-of-fit test statistics |
Takeshi Emura, Chi-Hung Pan
Emura T, Pan CH (2017), Parametric likelihood inference and goodness-of-fit for dependently left-truncated data, a copula-based approach, Statistical Papers, doi:10.1007/s00362-017-0947-z.
l.trunc=c(22.207,23.002,23.982,28.551,21.789,17.042,25.997,23.220,18.854,21.857, 27.321,13.767,23.982,20.110,15.779,26.821,27.934,15.292,28.843,15.985, 23.580,53.770,21.731,28.844,17.046,16.506,15.696,27.959,13.272,16.482, 24.210,17.626,27.770, 18.264,17.694,20.014,13.152,16.886,14.894,15.531,6.951,15.841,14.974, 38.292,11.204,38.156,26.652,17.101,28.953,18.325,18.391,18.220,15.896, 16.447,23.642,19.170,23.257,20.428,20.947,28.462,23.210,17.900,46.134, 39.300,11.768,17.717, 30.863,22.350,44.976,18.169,30.164,21.822,18.201,22.895,27.189,10.915, 25.503,12.350,39.869,17.698,26.296,14.091,21.011,11.201,10.757,25.692, 32.372,13.592,19.102,16.112,53.281,57.298,36.450,19.651,20.755,30.788,20.0,39.62) x.trunc = c(38.701,49.173,42.409,73.823,46.738,44.071,61.904,39.327,49.828,46.314, 56.150,50.549,54.930,54.039,49.170,44.795,72.238,107.783,81.609,45.228, 124.637,64.018,82.957,143.550,43.382,69.644,74.750,32.881,51.483,31.767, 77.633,63.745,82.965, 24.818,68.762,68.762,89.100,64.979,65.127,59.289,53.926,79.370,47.385, 61.395,72.826,53.980,37.220,44.224,50.826,65.460,86.726,43.819,100.605, 67.615,89.542,60.266,103.580,82.570,87.960,42.385,68.914,95.666,78.135, 83.643,18.617,92.629, 42.415,34.346,106.569,20.758,52.003,77.179, 68.934,78.661,165.543,79.547, 55.009,46.774,124.526,92.504,109.986,101.161,59.422,27.772,33.598,69.038, 75.222,58.373,105.610,56.158,55.913,83.770,123.468,68.994,101.869,87.627, 38.790,74.734) u.min=10 l.trunc=l.trunc[-41]-u.min x.trunc=x.trunc[-41]-u.min PMLE.Clayton.Exponential(l.trunc,x.trunc)
l.trunc=c(22.207,23.002,23.982,28.551,21.789,17.042,25.997,23.220,18.854,21.857, 27.321,13.767,23.982,20.110,15.779,26.821,27.934,15.292,28.843,15.985, 23.580,53.770,21.731,28.844,17.046,16.506,15.696,27.959,13.272,16.482, 24.210,17.626,27.770, 18.264,17.694,20.014,13.152,16.886,14.894,15.531,6.951,15.841,14.974, 38.292,11.204,38.156,26.652,17.101,28.953,18.325,18.391,18.220,15.896, 16.447,23.642,19.170,23.257,20.428,20.947,28.462,23.210,17.900,46.134, 39.300,11.768,17.717, 30.863,22.350,44.976,18.169,30.164,21.822,18.201,22.895,27.189,10.915, 25.503,12.350,39.869,17.698,26.296,14.091,21.011,11.201,10.757,25.692, 32.372,13.592,19.102,16.112,53.281,57.298,36.450,19.651,20.755,30.788,20.0,39.62) x.trunc = c(38.701,49.173,42.409,73.823,46.738,44.071,61.904,39.327,49.828,46.314, 56.150,50.549,54.930,54.039,49.170,44.795,72.238,107.783,81.609,45.228, 124.637,64.018,82.957,143.550,43.382,69.644,74.750,32.881,51.483,31.767, 77.633,63.745,82.965, 24.818,68.762,68.762,89.100,64.979,65.127,59.289,53.926,79.370,47.385, 61.395,72.826,53.980,37.220,44.224,50.826,65.460,86.726,43.819,100.605, 67.615,89.542,60.266,103.580,82.570,87.960,42.385,68.914,95.666,78.135, 83.643,18.617,92.629, 42.415,34.346,106.569,20.758,52.003,77.179, 68.934,78.661,165.543,79.547, 55.009,46.774,124.526,92.504,109.986,101.161,59.422,27.772,33.598,69.038, 75.222,58.373,105.610,56.158,55.913,83.770,123.468,68.994,101.869,87.627, 38.790,74.734) u.min=10 l.trunc=l.trunc[-41]-u.min x.trunc=x.trunc[-41]-u.min PMLE.Clayton.Exponential(l.trunc,x.trunc)
Maximum likelihood estimation (MLE) for dependent truncation data under the Clayton copula with Weibull margins for a bivariate lifetimes (L, X). The truncated data (L_j, X_j), subject to L_j<=X_j for all j=1, ..., n, are used to obtain the MLE for the population parameters of (L, X).
PMLE.Clayton.Weibull(l.trunc, x.trunc, GOF = TRUE, Err=2,alpha_max=20,alpha_min=10^-6)
PMLE.Clayton.Weibull(l.trunc, x.trunc, GOF = TRUE, Err=2,alpha_max=20,alpha_min=10^-6)
l.trunc |
vector of truncation variables satisfying l.trunc<=x.trunc |
x.trunc |
vector of variables satisfying l.trunc<=x.trunc |
GOF |
if TRUE, a goodness-of-fit test statistics is computed |
Err |
tuning parameter in the NR algorithm |
alpha_max |
upper bound for the copula parameter |
alpha_min |
lower bound for the copula parameter |
Relevant paper is submitted for review
n |
sample size |
alpha |
dependence parameter |
lambda_L |
scale parameter of L |
lambda_X |
scale parameter of X |
nu_L |
shape parameter of L |
nu_X |
shape parameter of X |
mean_X |
Mean lifetime of X, defined as E[X] |
logL |
Maximized log-likelihood |
c |
inclusion probability, defined by c=Pr(L<=X) |
C |
Cramer-von Mises goodness-of-fit test statistics |
K |
Kolmogorov-Smirnov goodness-of-fit test statistics |
Takeshi Emura
Emura T, Pan CH (2017), Parametric likelihood inference and goodness-of-fit for dependently left-truncated data, a copula-based approach, Statistical Papers, doi:10.1007/s00362-017-0947-z.
l.trunc=c(22.207,23.002,23.982,28.551,21.789,17.042,25.997,23.220,18.854,21.857, 27.321,13.767,23.982,20.110,15.779,26.821,27.934,15.292,28.843,15.985, 23.580,53.770,21.731,28.844,17.046,16.506,15.696,27.959,13.272,16.482, 24.210,17.626,27.770, 18.264,17.694,20.014,13.152,16.886,14.894,15.531,6.951,15.841,14.974, 38.292,11.204,38.156,26.652,17.101,28.953,18.325,18.391,18.220,15.896, 16.447,23.642,19.170,23.257,20.428,20.947,28.462,23.210,17.900,46.134, 39.300,11.768,17.717, 30.863,22.350,44.976,18.169,30.164,21.822,18.201,22.895,27.189,10.915, 25.503,12.350,39.869,17.698,26.296,14.091,21.011,11.201,10.757,25.692, 32.372,13.592,19.102,16.112,53.281,57.298,36.450,19.651,20.755,30.788,20.0,39.62) x.trunc = c(38.701,49.173,42.409,73.823,46.738,44.071,61.904,39.327,49.828,46.314, 56.150,50.549,54.930,54.039,49.170,44.795,72.238,107.783,81.609,45.228, 124.637,64.018,82.957,143.550,43.382,69.644,74.750,32.881,51.483,31.767, 77.633,63.745,82.965, 24.818,68.762,68.762,89.100,64.979,65.127,59.289,53.926,79.370,47.385, 61.395,72.826,53.980,37.220,44.224,50.826,65.460,86.726,43.819,100.605, 67.615,89.542,60.266,103.580,82.570,87.960,42.385,68.914,95.666,78.135, 83.643,18.617,92.629, 42.415,34.346,106.569,20.758,52.003,77.179, 68.934,78.661,165.543,79.547, 55.009,46.774,124.526,92.504,109.986,101.161,59.422,27.772,33.598,69.038, 75.222,58.373,105.610,56.158,55.913,83.770,123.468,68.994,101.869,87.627, 38.790,74.734) u.min=10 l.trunc=l.trunc[-41]-u.min x.trunc=x.trunc[-41]-u.min PMLE.Clayton.Weibull(l.trunc,x.trunc)
l.trunc=c(22.207,23.002,23.982,28.551,21.789,17.042,25.997,23.220,18.854,21.857, 27.321,13.767,23.982,20.110,15.779,26.821,27.934,15.292,28.843,15.985, 23.580,53.770,21.731,28.844,17.046,16.506,15.696,27.959,13.272,16.482, 24.210,17.626,27.770, 18.264,17.694,20.014,13.152,16.886,14.894,15.531,6.951,15.841,14.974, 38.292,11.204,38.156,26.652,17.101,28.953,18.325,18.391,18.220,15.896, 16.447,23.642,19.170,23.257,20.428,20.947,28.462,23.210,17.900,46.134, 39.300,11.768,17.717, 30.863,22.350,44.976,18.169,30.164,21.822,18.201,22.895,27.189,10.915, 25.503,12.350,39.869,17.698,26.296,14.091,21.011,11.201,10.757,25.692, 32.372,13.592,19.102,16.112,53.281,57.298,36.450,19.651,20.755,30.788,20.0,39.62) x.trunc = c(38.701,49.173,42.409,73.823,46.738,44.071,61.904,39.327,49.828,46.314, 56.150,50.549,54.930,54.039,49.170,44.795,72.238,107.783,81.609,45.228, 124.637,64.018,82.957,143.550,43.382,69.644,74.750,32.881,51.483,31.767, 77.633,63.745,82.965, 24.818,68.762,68.762,89.100,64.979,65.127,59.289,53.926,79.370,47.385, 61.395,72.826,53.980,37.220,44.224,50.826,65.460,86.726,43.819,100.605, 67.615,89.542,60.266,103.580,82.570,87.960,42.385,68.914,95.666,78.135, 83.643,18.617,92.629, 42.415,34.346,106.569,20.758,52.003,77.179, 68.934,78.661,165.543,79.547, 55.009,46.774,124.526,92.504,109.986,101.161,59.422,27.772,33.598,69.038, 75.222,58.373,105.610,56.158,55.913,83.770,123.468,68.994,101.869,87.627, 38.790,74.734) u.min=10 l.trunc=l.trunc[-41]-u.min x.trunc=x.trunc[-41]-u.min PMLE.Clayton.Weibull(l.trunc,x.trunc)
Maximum likelihood estimation (MLE) for dependent truncation data under the bivariate normal distribution. A bivariate normal distribution is assumed for bivariate random variables (L, X). The truncated data (L_j, X_j), subject to L_j<=X_j for all j=1, ..., n, are used to obtain the MLE for the population parameters of (L, X).
PMLE.Normal(l.trunc, x.trunc, testimator = FALSE,GOF=TRUE)
PMLE.Normal(l.trunc, x.trunc, testimator = FALSE,GOF=TRUE)
l.trunc |
vector of truncation variables satisfying l.trunc<=x.trunc |
x.trunc |
vector of variables satisfying l.trunc<=x.trunc |
testimator |
if TRUE, testimator is computed instead of MLE |
GOF |
if TRUE, goodness-of-fit test is performed |
PMLE.Normal performs the maximum likelihood estimation for dependently left-truncated data under the bivariate normal distribution. "PMLE.Normal" implements the methodologies developed in Emura T. & Konno Y. (2012, Statistical Papers 53, 133-149)and can produce the maximum likelihood estimates and their standard errors. Furthermore, "PMLE.Normal" tests the independence assumption between truncation variable and variable of interest via likelihood ratio test. The MLE is obtained by minimizing -logL using "nlm", where L is the log-likelihood.
mu_L |
mean of L and its standard error |
mu_X |
mean of X and its standard error |
var_L |
variance of L and its standard error |
var_X |
variance of X and its standard error |
cov_LX |
covariance between L and X and its standard error |
c |
inclusion probability, defined by c=Pr(L<=X), and its standard error |
test |
Likelihood ratio statistic and p-value |
C |
Cramer-von Mises goodness-of-fit test statistics |
K |
Kolmogorov-Smirnov goodness-of-fit test statistics |
Takeshi EMURA
Emura T, Konno Y (2012), Multivariate Normal Distribution Approaches for Dependently Truncated Data. Statistical Papers 53 (No.1), 133-149.
Emura T, Konno Y (2014), Erratum to: Multivariate Normal Distribution Approaches for Dependently Truncated Data, Statistical Papers 55 (No.4): 1233-36
l.trunc=c(1,2,3,4,5,6,7,8,8) x.trunc=c(2,4,4,5,5,7,7,9,10) PMLE.Normal(l.trunc,x.trunc,testimator=FALSE)
l.trunc=c(1,2,3,4,5,6,7,8,8) x.trunc=c(2,4,4,5,5,7,7,9,10) PMLE.Normal(l.trunc,x.trunc,testimator=FALSE)