{'fraction_non_alphanumeric': 0.03634915215659497, 'fraction_numerical': 0.015044952771139182, 'mean_word_length': 4.572805682394724, 'pattern_counts': {'":': 0, '<': 2, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 11, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Joint modeling of longitudinal drug using pattern and time to first relapse in cocaine dependence treatment data

An important endpoint variable in a cocaine rehabilitation study is the time to first relapse of a patient after the treatment. We propose a joint modeling approach based on functional data analysis to study the relationship between the baseline longitudinal cocaine-use pattern and the interval censored time to first relapse. For the baseline cocaine-use pattern, we consider both self-reported cocaine-use amount trajectories and dichotomized use trajectories. Variations within the generalized longitudinal trajectories are modeled through a latent Gaussian process, which is characterized by a few leading functional principal components. The association between the baseline longitudinal trajectories and the time to first relapse is built upon the latent principal component scores. The mean and the eigenfunctions of the latent Gaussian process as well as the hazard function of time to first relapse are modeled nonparametrically using penalized splines, and the parameters in the joint model are estimated by a Monte Carlo EM algorithm based on Metropolis-Hastings steps. An Akaike information criterion (AIC) based on effective degrees of freedom is proposed to choose the tuning parameters, and a modified empirical information is proposed to estimate the variance-covariance matrix of the estimators.

An important endpoint variable in a cocaine rehabilitation study is the time to first relapse of a patient after the treatment. We propose a joint modeling approach based on functional data analysis to study the relationship between the baseline longitudinal cocaineuse pattern and the interval censored time to first relapse. For the baseline cocaine-use pattern, we consider both self-reported cocaineuse amount trajectories and dichotomized use trajectories. Variations within the generalized longitudinal trajectories are modeled through a latent Gaussian process, which is characterized by a few leading functional principal components. The association between the baseline longitudinal trajectories and the time to first relapse is built upon the latent principal component scores. The mean and the eigenfunctions of the latent Gaussian process as well as the hazard function of time to first relapse are modeled nonparametrically using penalized splines, and the parameters in the joint model are estimated by a Monte Carlo EM algorithm based on Metropolis-Hastings steps. An Akaike information criterion (AIC) based on effective degrees of freedom is proposed to choose the tuning parameters, and a modified empirical information is proposed to estimate the variance-covariance matrix of the estimators.
1. Introduction. In cocaine dependence research, it has been shown that one's baseline cocaine-use pattern is related to the risk of posttreatment cocaine relapse [Fox et al. (2006)], along with many other factors such as cocaine withdrawal severity, stress and negative mood [Kampman et al. (2001), Sinha (2001Sinha ( , 2007]. The timeline follow-back (TLFB) [Sobell and Sobell (1993)] Substance Use Calendar is often used to retrospectively construct trajectories of daily cocaine use in a baseline period before treatment. The TLFB uses a calendar prompt and many other memory aids (e.g., the use of key dates such as holidays, birthdays, newsworthy events and other personal events as anchor points) to enhance the accuracy of self-report substance-use estimates. Fals-Stewart et al. (2000) showed that the TLFB could provide reliable daily cocaine-use data that had high retest reliability, high correlation with other cocaine-use measures and high agreement with collateral informants' reports of patients' cocaine use as well as results obtained from urine assays.
Based on the self-reported daily cocaine-use trajectories, certain summary statistics can be derived and are often used as predictors in a subsequent analysis to explain cocaine relapse outcomes. Commonly used summary statistics include baseline cocaine-use frequency and average daily use amount, and commonly used relapse outcome measures are time to relapse (i.e., time to first cocaine use), frequency of use and quantity of use per occasion during the follow-up period [Carroll et al. (1993), Sinha et al. (2006)]. Among the different relapse outcome measures, time to first relapse (which we also refer as "relapse time" for ease of exposition) is of particular clinical importance because it signals the transition of a cocaine-use pattern from abstinence to relapse. Sinha et al. (2006) examined time to cocaine relapse using Cox proportional hazards regression models. They concluded that the amount of cocaine used per occasion during the 90 days prior to inpatient admission was significantly associated with relapse time. Guan, Li and Sinha (2011) argued that because the baseline cocaine-use trajectories were random, summary statistics derived from them were only estimates of one's long-term cocaine-use behavior and could be subject to large measurement error. In a regression setting, the use of error-prone variables as predictors may cause severe bias to the regression coefficients [Carroll et al. (2006)]. To mitigate the bias, Guan, Li and Sinha (2011) proposed a method-ofmoments-based calibration method for linear regression models and a subsampling extrapolation method that is applicable to both linear and nonlinear regression models. However, their methods require a restrictive assumption that the baseline cocaine-use trajectories are stationary processes, and their subsampling extrapolation method is an approximation method which cannot completely eliminate the estimation bias in survival analysis.
We propose a new modeling framework to link one's baseline cocaineuse pattern to relapse time without assuming stationarity for the baseline cocaine-use trajectories. We treat the baseline cocaine-use trajectories as functional data [Ramsay and Silverman (2005)] and perform functional principal component analysis (FPCA) to these trajectories. The resulting FPCA scores are then used as predictors to model relapse time. We develop a joint JOINT MODELING IN COCAINE DEPENDENCE TREATMENT DATA 3 modeling approach to conduct FPCA and functional regression analysis simultaneously. We consider two types of baseline cocaine-use trajectories: the first is the actual self-reported daily cocaine-use amount as provided by the TLFB, whereas the second is a dichotomized version of the first in the form of any cocaine use versus no use. The actual daily cocaine-use amount can be difficult to estimate depending on the length of the recalling period and also due to the lack of a common scale to assess the amount used for the different methods of consumption (e.g., intranasal use versus injection). The dichotomized cocaine-use trajectories, although maybe less informative, are subject to smaller errors and hence are more reliable.
There is a large volume of recent work on FPCA. See Yao, Müller and Wang (2005a), Hall, Müller and Wang (2006), Li and Hsing (2010) for kernelbased FPCA approaches, and James, Hastie and Sugar (2000), Carroll (2008, 2010) for spline-based FPCA methods. All these papers are concerned with the Gaussian type of functional data and cannot be used for generalized longitudinal trajectories. Hall, Müller and Yao (2008) proposed to model non-Gaussian longitudinal data by generalized linear mixed models, where the FPCA can be performed with respect to some latent random processes. Once the FPCA scores are obtained, a common approach is to use them as predictors in a second-stage regression analysis [e.g., Crainiceanu, Staicu andDi (2009), Yao, Müller andWang (2005b)]. As pointed out in Li, Wang and Carroll (2010), a potential problem with such an approach is that the estimation errors in FPCA are not properly taken into account in the second stage regression analysis, hence, the estimated coefficients can be biased and variations in the estimators may be underestimated. By performing FPCA and functional regression analysis simultaneously, we can avoid these complications.
Our work is also related to joint modeling of longitudinal data and survival time [e.g., Ratcliffe, Guo and Ten Have (2004), Wulfsohn and Tsiatis (1997), Yan and Fine (2005), Yao (2007Yao ( , 2008, Su and Wang (2012)]. However, the vast majority of the existing literature focuses on the instantaneous effect of longitudinal data on survival time. In other words, the hazard rate of the event time is only related to the value of the longitudinal process at the moment of event. In our problem, the longitudinal trajectories were collected prior to the relapse period and we want to use the entire baseline-use trajectory as a functional predictor in the survival analysis. Survival analysis with functional predictors is not well studied in the literature compared with other functional regression models, and an extra complication in our data is that the relapse time is interval censored (see Section 2.1 for details). As noted in Cai and Betensky (2003), Sun (2006), one prominent difficulty in modeling interval censored survival data is that, unlike right censored data, we cannot separate estimating the baseline hazard function from estimating the hazard regression coefficients using approaches such as the partial likelihood. Therefore, we propose to model the log baseline hazard function as a spline function. Some recent literature on spline models of the log baseline hazard function for interval censored data includes Cai and Betensky (2003), Kooperberg and Clarkson (1997), Rosenberg (1995) and Zhang, Hua and Huang (2010).
2. Data structure and joint model.

2.1.
Description of the motivating data. Our data came from a recently completed clinical trial for cocaine dependence treatment. In the study, seventy-nine cocaine-dependent subjects were admitted to the Clinical Neuroscience Research Unit (CNRU) of the Connecticut Mental Health Center to receive an inpatient relapse prevention treatment for cocaine dependence lasting for two to four weeks. The CNRU is a locked inpatient treatment and research facility that provides no access to alcohol or drugs and only limited access to visitors. Upon treatment entry, all subjects were interviewed by means of the Structured Clinical Interview for DSM-IV [First et al. (1995)]. Variables collected during the interview include age, gender, race, number of cocaine-use years and number of anxiety disorders present at interview, among others. The TLFB Substance Use Calendar was used to retrospectively construct daily cocaine-use history in the 90 days prior to admission.
After completing the inpatient treatment, all participants were invited back for follow-up interviews to assess cocaine-use outcomes. Four interviews were conducted at days 14, 30, 90 and 180 after the treatment. During each interview, daily cocaine-use records were collected using the TLFB procedure for the period prior to the interview date. A urine toxicology screen was also conducted to verify the accuracy of a reported relapse or abstinence. A positive urine sample test would suggest that the subject had used cocaine at least once in the reporting period before the positive urine test, but the test could not tell the exact cocaine-use date(s). If the selfreported relapse time had no conflict with the urine tests, we consider it as an observed event time. However, some subjects had reported no prior cocaine use before the first positive urine sample test, their relapse times were interval censored between their first positive urine test and the previous negative test (if there was any). There were also subjects who reported no cocaine use nor yielded any positive urine samples for the entire study period. For these subjects, their relapse time data were right censored at the last interview date. In our data, about 50.6% of the subjects had observed relapse time; 31.6% were interval censored and 17.8% were right censored.
In what follows, let N denote the number of study subjects. For the ith subject, let Y i = {Y i (t ij ), j = 1, . . . , n i } be the baseline cocaine-use trajectory, T i be a posttreatment relapse time that may be right or interval censored, and Z i be an m-dimensional covariate vector, where t ij is the jth observation time for the ith subject within the baseline time interval T , n i is the total number of such observation time, and Z i includes baseline information on age, gender (= 1 for female and 0 for male), race (= 1 for African American and 0 for the rest), number of cocaine-use years (Cocyrs) and number of anxiety disorders present at the baseline interview (Curanxs). As mentioned in the Introduction, we consider two cases that Y i (t) is either the self-reported use amount on day t or the dichotomized version.
2.2.1. Generalized functional mixed model. We assume that the longitudinal observations Y ij = Y i (t ij ) are variables from the canonical exponential family [McCullagh and Nelder (1989)] with a probability density or mass function where θ ij is the canonical parameter and φ is a dispersion parameter. Denote µ ij as the mean of Y ij . Then µ ij is the first derivative of b(·) at θ ij , that is, µ ij = b (1) (θ ij ). The inverse function of b (1) (·), denoted as g(·), is called the canonical link function. We consider two different types of trajectories: Gaussian trajectories where Y  i (t) = 1 if the ith subject used cocaine on day t, and = 0 otherwise. For Gaussian longitudinal outcomes, θ ij = µ ij and f (Y ij |θ ij , φ) is the density of Normal(θ ij , φ); in the case of dichotomized outcomes, f (Y ij |θ ij , φ) is the binary probability mass function with θ ij = logit{P (Y ij = 1)} and φ = 1. We assume that Y i (t) is driven by a latent Gaussian process X i (t) such that θ ij = X i (t ij ) and that X i (t) yields a standard Karhunen-Loève expansion where µ(t) = E{X i (t)} is the mean function, ψ = (ψ 1 , . . . , ψ p ) T is a vector of orthonormal functions also known as the eigenfunctions in FPCA, In theory, the Karhunen-Loève expansion contains an infinite number of terms, and truncating the expansion to a finite order is a finite sample approximation to the reality. The number of principal components p becomes a model parameter and will be chosen by a data-driven method.

2.2.2.
Reduced-rank model based on penalized B-splines. We approximate the unknown functions µ(t) and ψ(t) by B-splines [James, Hastie and Sugar (2000), Zhou, Huang and Carroll (2008)]. The B-spline representation achieves two goals simultaneously: smoothing and dimension reduction. Smoothing is needed because the self-reported cocaine-use amount trajectories contain a substantial amount of measurement error. With our spline representation, each function is parameterized by a small amount of spline coefficients and the estimates are further regularized by a roughness penalty. Let -spline basis defined on equally spaced knots in T , θ µ be a q × 1 vector and Θ ψ = (θ ψ1 , . . . , θ ψp ) be a q × p matrix of spline coefficients, then the unknown functions are represented as µ(t) = B(t) T θ µ and ψ T (t) = B(t) T Θ ψ . The general recommendation for choosing q in the penalized spline literature is to choose a relatively large number q ≫ p, and let the smoothness of the estimated functions be regularized by the roughness penalty [Ruppert, Wand and Carroll (2003)]. The original B-spline basis functions are not orthonormal, therefore, we employ the procedure prescribed by Zhou, Huang and Carroll (2008) to orthogonalize them so that B(t)B(t) T dt = I q , where I q is a q × q identity matrix. Under this construction, the orthonormal constraints on ψ(t) translate into constraints on the coefficients, that is, Θ T ψ Θ ψ = I p . Then the reduced-rank model for the latent process takes the form For the Gaussian trajectories, that is, the log-transformed cocaine-use amount, is the design matrix by interpolating the basis functions on the observation time points and ε i ∼ Normal(0, σ 2 ε I n i ). The conditional log-likelihood function for the baseline-use trajectories is and Θ [1] To regularize the nonparametric estimators, we impose penalties on the L 2 norms of their second derivatives [Eilers and Marx (1996), Ruppert, Wand and Carroll (2003) The penalized log-likelihood for the baseline longitudinal data is Long for Gaussian and dichotomized trajectories, respectively, and h µ and h ψ are tuning parameters.
2.3. Modeling the relapse time. We assume that the relapse time T i depends on the baseline cocaine-use history Y i (t) only through the latent process X i (t). Moreover, the conditional hazard of T i given {X i (t), t ∈ T } and the covariate vector Z i follows the Cox proportional hazards model. Our way of including the functional covariate X i into survival analysis is closely related to the functional linear model; see Ramsay and Silverman (2005), Yao, Müller and Wang (2005b), Crainiceanu, Staicu andDi (2009), Li, Wang and and many others. More specifically, the conditional hazard function of T i is where λ 0 (t) is an unknown baseline hazard function, η is a coefficient vector and B(s) is an unknown coefficient function. When X has the Karhunen-Loève expansion in (2.2), the coefficient function can be written as a linear combination of the eigenfunctions B(s) = p j=1 β j ψ j (s) and the integral in the model can be simplified as T X i (s)B(s) ds = p j=1 ξ ij β j , which motivates the model One important feature of the cocaine dependence treatment data is that the relapse time is partially interval censored. That is, the data are a mixture of noncensored, right censored and interval censored data. For the subjects with interval censoring, we only know that the relapse time occurred within We adopt the idea of Cai and Betensky (2003) and model the log baseline hazard as a linear spline function where x + ≡ max(x, 0) and κ k 's are the knots. The spline basis used in (2.8) is also known as the truncated power basis [Ruppert, Wand and Carroll (2003)]. There are two immediate benefits for this model. First, λ 0 (·) is guaranteed to be nonnegative, so that we do not have to consider any constraints on the parameters when maximizing the likelihood. Second, since log λ 0 (·) is modeled as a piecewise linear polynomial, the cumulative hazard function Λ 0 (t) = t 0 λ 0 (u) du can be written out in an explicit form. For higher order spline functions, such explicit expressions are not available.
To write out the likelihood for the relapse time, we use the following notation. For the ith subject we observe (T gives the censoring interval and δ i is the indicator for right censoring. When δ i = 0 and T l i = T r i , the event time T i is right censored at T r i ; when δ i = 1 and the conditional loglikelihood function for the relapse time is [Cai and Betensky (2003)] With the log baseline hazard function expressed as a linear spline function, the log-likelihood function in (2.9) can be evaluated explicitly. To regularize the estimators, one commonly used approach is to model the polynomial coefficients a = (a 0 , a 1 ) T as fixed effects and the spline coeffi- . This mixed model setup leads to a penalized log-likelihood (2.10) Ruppert, Wand and Carroll (2003) recommended to use a relatively large number of basis functions in a penalized spline estimator, so that the smoothness of log λ 0 (·) is mainly controlled by σ 2 b . Following Cai and Betensky (2003), we set K = min(⌊N/4⌋, 30), where ⌊x⌋ is the floor of x, and choose the knots to be equally spaced with respect to the quantiles defined on the unique values of {T l i , T r i , (T l i + T r i )/2, i = 1, . . . , N }. The variance parameter σ 2 b is treated as a tuning parameter in our nonparametric estimation. When analyzing the survival data alone, Cai and Betensky (2003) proposed to select σ 2 b by maximizing the marginal likelihood using a Laplace approximation [Breslow and Clayton (1993)]. Choosing σ 2 b in our joint model is more challenging and will be addressed in Section 3.2.
2.4. The joint model. The principal component scores ξ i of the longitudinal data are also latent frailties in the survival model for the relapse time. By imposing a normality assumption, the log-likelihood for ξ is The complete data log-likelihood for the joint model is given by combining the parts in (2.6), (2.9) and (2.11) as Here ξ, Y , T l , T r , δ and Z are the vectors or matrices pooling the corresponding variables from all subjects.

Methods.
3.1. Model fitting by the MCEM algorithm. We fit the joint model by an EM algorithm treating the latent variables ξ i as missing values. In our algorithm, we fix the tuning parameters h µ , h ψ and σ 2 b and focus on estimating the model parameters Θ. Selection of the tuning parameters is deferred to Section 3.2.
The loss function of the EM algorithm is where ℓ P is the penalized complete data log-likelihood in (2.13) and Θ curr is the current value of Θ. The algorithm updates the parameters by iteratively maximizing (3.1) over Θ. Given the complexity of the joint model, the conditional expectation in (3.1) does not have a closed form, we therefore approximate Q(Θ; Θ curr ) by Markov Chain Monte Carlo (MCMC). Let {ξ (1) , . . . , ξ (R) } be MCMC samples from the conditional distribution (ξ i |Y i , T l i , T r i , δ i , Z i , Θ curr ), and then Q(Θ; Θ curr ) can be approximated by Q(Θ; Θ curr ) = 1 R R k=1 ℓ P (Θ; ξ (k) , Y, T l , T r , δ, Z). This algorithm is a variant of the Monte Carlo EM (MCEM) algorithm of McCulloch (1997), and the details are provided in Sections A.1 and A.2 of supplementary material [Ye, Li and Guan (2015)]. To ensure convergence of the MCMC, we also monitor the Monte Carlo error in the E-step using the batch means method of Jones et al. (2006). Specifically, we divide the Monte Carlo sequence {ξ (k) , k = 1, . . . , R} in to R 1/3 batches so that we have replicates of Q(Θ; Θ (s) ) to evaluate the Monte Carlo error.
3.2. Model selection by Akaike information criterion. The most pressing model selection issue in our joint model is to select the number of principal components p since it determines the structure of the baseline trajectories and their association with the relapse time. Another important issue is to select the tuning parameters. As mentioned before, as long as we include enough of a number of spline bases and place the knots reasonably, the performance of the estimated functions is mainly controlled by the penalty parameters h µ , h ψ and σ 2 b . We propose to select p, h µ , h ψ and σ 2 b simultaneously by minimizing an Akaike information criterion (AIC), which is the negative log-likelihood plus a penalty on the model complexity.
In our setting, the log-likelihood on observed data requires integrating out the latent variables ξ from the complete data likelihood (2.12), which is intractable. A commonly used approach is to replace the log-likelihood with its conditional expectation given the observed data [Ibrahim, Zhu and Tang (2008)]. Hence, the AIC is of the form AIC(p, h µ , h ψ , σ 2 b ) = −2E{ℓ C ( Θ; ξ, Y, T l , T r , δ, Z)|Y, T l , T r , δ, Z, Θ} + 2M, where the conditional expectation is approximated by a Monte Carlo average using the Monte Carlo samples in the last MCEM iteration and M is the effective degrees of freedom in the model.
For the longitudinal data, both the mean function µ(t) and the eigenfunctions ψ(t) are estimated by penalized splines. Following Wei and Zhou (2010), the effective degrees of freedom for a P-spline estimator with a penalty parameter h is where h can be either h µ or h ψ . Since our model consists of one mean function and p eigenvalues and eigenfunctions, the effective degrees of freedom for the longitudinal data is df(h µ ) + p × {df(h ψ ) + 1}. Similarly, the effective degrees of freedom for the estimated log baseline hazard function can be approximated by [Ruppert, Wand and Carroll (2003)] where T i is the design matrix from the truncated power basis used in (2.8).
For interval censored subjects, we approximate the event time by the midpoint T m i of the interval [T l i , T r i ] and the design matrix for the ith subject is T i = {(T m i − κ 1 ) + , . . . , (T m i − κ K ) + }. By taking into account the degrees of freedom in all model components, the AIC for the joint model becomes Searching for the minimum of AIC in a four-dimensional space is extremely time consuming. One possible simplification is to assume that the baseline mean and eigenfunctions have about the same roughness and set h µ = h ψ ≡ h. Then for each value of p, we search for the optimal value of h and σ 2 b over five grid points in each dimension. We adopt this search scheme in all of our numerical studies and it proves to be computationally feasible.

Variance estimation.
To make inference on parameters in the joint model, we need to estimate the variance-covariance matrix of the estimator Θ. Let O = (Y, T l , T r , δ, Z) be the observed data. Louis (1982) showed that the covariance matrix of Θ can be approximated by the inverse of the observed information matrix where ℓ P is the penalized log-likelihood based on complete data (2.13). We can estimate this information matrix by evaluating the partial derivatives at the final estimator Θ and replacing the conditional expectations by Monte Carlo averages using the Monte Carlo samples generated in the final EM iteration.
One important distinction between our model and the generalized linear mixed models or other joint models is that the eigenfunctions are not identifiable without the orthonormal constraints in (2.3). Because of the constraints, the real number of free parameters in Θ ψ is lower than the nominal dimension. As a result, the information matrix defined above might be singular. One solution is to reparameterize Θ ψ so as to remove the constraints. Details are given in supplementary material [Ye, Li and Guan (2015)].
A referee pointed out the methods by Meilijson (1989) and Meng and Rubin (1991) can also be used to estimate the asymptotic variance of Θ. These methods are not only based on observed information, but also evaluate the derivatives numerically by running additional Markov chains. It is worth pointing out that these methods are designed for the cases where there is no constraint on the parameter Θ. Extending these methods to our problem calls for future research.
4. Simulation study. We illustrate the performance of the proposed methods by a simulation study. To mimic the real data, we consider two simulation settings where the baseline longitudinal trajectories are Gaussian and binary, respectively. In both settings, we simulate N = 100 independent subjects, with n i = 20 baseline longitudinal observations equally spaced on the time interval T = [0, 20].
Gaussian baseline trajectories are generated as Y i (t) = X i (t) + ε i (t), where X i (t) is the ith realization of a Gaussian process with the Karhunen-Loève expansion (2.2). We let the mean function be µ(t) = t/60 + sin(3πt/20), the eigenvalues be d 1 = 9, d 2 = 2.25 and d k = 0 for k ≥ 3, and the eigenfunctions be ψ 1 (t) = −cos(πt/10)/ √ 10, ψ 2 (t) = sin(πt/10)/ √ 10. The principal component scores are simulated as ξ i = (ξ i1 , ξ i2 ) T ∼ Normal(0, D ξ ) with D ξ = diag(9, 2.25). The error ε(t) is a Gaussian white noise process with variance σ 2 ε = 0.49. In the case of the binary baseline, Y ij are generated from a Bernoulli distribution with the probability g −1 {X i (t ij )}, where the latent process X is simulated the same way as for the Gaussian baseline trajectories and g(π) = log( π 1−π ) for 0 < π < 1. Under both simulation settings, we simulate the failure time T i from the Cox proportional hazards model (2.7), which includes the effects of the principal component scores and a covariate Z i . We let Z i be a binary random variable with a success probability of 0.5, the regression coefficients be θ = (β T , η) T = (1, 1, 1) T , and the baseline hazard function be λ 0 (t) = t/20 for t ≥ 0. We assume that the failure time is interval censored at random and set the censoring time to be 4, 10 and 20. Let the censoring indicator δ i be a binary variable independent of ξ i and Z i with P (δ i = 1) = 0.5. When δ i = 1, the event time T i is censored in the interval between the two closest censoring time; if T i is less than 4, it is censored in [T l i = 0, T r i = 4]; if T i is over 20, it is automatically right censored at 20. Overall, the data structure is similar to the cocaine dependence treatment data described in Section 2: about 12% of the failure times are right censored, 43% are interval censored, and the remaining 45% are observed.
For both baseline settings, we repeat the simulation 100 times and apply the proposed method to fit the joint model. For the results reported below, we use q = 8 cubic B-splines to model the mean and eigenfunctions of the latent longitudinal process and K = 12 spline basis functions to model the log baseline hazard function. Our experience and those of many others [e.g., Cai and Betensky (2003), Ruppert, Wand and Carroll (2003), Zhou, Huang and Carroll (2008)] suggest that the performance of penalized spline estimators is mainly controlled by the penalty parameters and is not sensitive to the choice of spline basis.
To choose the number of principal components p and the penalty parameters h µ , h ψ and σ 2 b , we conduct a grid search using the proposed AIC (3.2). For all the simulations, the AIC selects the correct number p = 2 of principal components about 77% of the time and selects p = 3 for the remaining 23% of the time. Since AIC has a well-known tendency to select an over-fitted model and over-fitting is in general considered less problematic than under-fitting, this performance is quite satisfactory. For the estimation results below, we use the penalty parameters selected by AIC when p is fixed at 2.
We summarize in Figures 1 and 2 the nonparametric estimators when the baseline longitudinal trajectories are Gaussian and binary, respectively.  Each figure contains four panels that summarize ψ 1 (t), ψ 2 (t), µ(t) and the log baseline hazard function. We show in each panel the true curve, the median, and the 5th and 95th pointwise percentiles of the estimators. As we can see, the spline estimators perform very well in both simulation settings, and the median and the pointwise percentiles of the estimated curves are very close to the truth. Between the two types of baseline longitudinal data, binary trajectories are less informative, and hence the estimated curves are more variable. For instance, the integrated mean squared error for the two eigenfunctions are 0.0072 and 0.0150 in the Gaussian case and are 0.0462 and 0.1206 in the binary case. The true log hazard function is log(t/20), which is −∞ at t = 0; this explains the bigger bias of our spline estimator near 0. The bias in the nonparametric part has little effect on estimation of the parametric components such as θ.
We summarize the estimation results of the parametric components for both settings in Table 1, where we show the means and Monte Carlo standard deviations of the estimators. As we can see, the estimators for the Table 1 Estimation results of the parametric components under both simulation settings, with either Gaussian or binary baseline trajectories. Presented in the table are the true value of the parameters, mean and Monte-Carlo standard deviations (Stdev) of the estimated parameters, and the mean of the estimated standard error using the Louis formula (Stder). The joint modeling method (joint) is the proposed method, and the two-stage method is by plugging estimated FPCA scores into a second stage survival analysis parametric components are approximately unbiased and the standard deviations are reasonably small. We also present the means of the estimated standard errors using the modified empirical information in Section 3.3, and find that the standard errors slightly underestimate the true standard deviations. This underestimation of standard error is quite common in semiparametric models under small sample sizes, since the standard error is based on an estimate of the asymptotic variance, which only captures the leading term in the asymptotic distribution of the point estimator [Lin and Carroll (2001)]. To demonstrate the advantage of the joint modeling approach, we also provide a comparison between our method and a two-stage functional survival analysis approach, where we perform FPCA to the longitudinal trajectory first and then use the estimated principal component scores as predictors in the second-stage survival analysis. For Gaussian longitudinal trajectories, the FPC scores are estimated by the principal analysis by the conditional expectation (PACE) method [Yao, Müller and Wang (2005a)]; for the dichotomized trajectories, the FPC scores are estimated by the method of Hall, Müller and Yao (2008) which is implemented in a PACE-GRM package in Matlab. The estimation results of the two-stage estimator are also provided in Table 1. We can see that the two-stage estimators for β and η are severely biased. This bias is the result of the attenuation effect caused by the estimation errors in the FPC scores.
5. Cocaine dependence treatment data. We apply our proposed joint modeling approach to analyze the cocaine dependence treatment data described in Section 2. For the baseline cocaine-use trajectories, we consider both the (log-transformed) cocaine-use amount trajectories and the dichotomized trajectories. Relapse time is determined from the self-reported posttreatment cocaine-use trajectories as well as the urine sample tests. As we discussed in Section 2, the relapse time is partially interval/right censored. We use the five covariates described in Section 2 in the Cox model, that is, age, gender, race, Cocyrs and Curanxs. To capture potential weekly periodic patterns of the baseline trajectories, we aligned the baseline trajectories by weekdays such that all trajectories start from the first Sunday of the baseline period and last for 80 days.
We use 30 cubic B-spline basis functions to model the mean and eigenfunctions of the baseline trajectories so that there are about two knots within each weak and the basis functions are flexible enough to capture possible weekly patterns in the data. The smoothness of these nonparametric estimators are governed by the data-driven tuning parameters. We use 12 linear spline basis functions to model the baseline hazard function, similar to the choice in Guan, Li and Sinha (2011). We choose the number of principal components and the penalty parameters h µ , h ψ and σ 2 b by the proposed AIC. The AIC selects three principal components for both types of baseline trajectories. The estimated eigenvalues are 16.1960, 2.2097 and 0.8673 for the cocaine-use amount trajectories and 61.3838, 0.8986 and 0.1695 for the dichotomized trajectories.
We show the estimated mean and eigenfunctions for the cocaine-use amount trajectories in Figure 3 and for the dichotomized trajectories in Figure 4. The curves estimated from the two types of trajectories exhibit rather similar patterns, and they all show clear weekly periodic structuresthe baseline trajectories contain 11 weeks of data and these curves have 11 peaks and troughs matching the weekdays rather closely. If we look beyond the local periodic structures and focus on the overall trend of these curves over the entire baseline period, we can see that the mean functions are reasonably flat except near the beginning and the end of the baseline period. The overall trend in the first eigenfunction is a negative constant function. Increasing the loading on the first principal component leads to less cocaine use (or lower use probability for dichotomized trajectories), and hence the score on the first principal component represents the overall use amount (or probability) of a patient. The second principal component represents an overall decreasing trend in use amount (or probability) over the recall period. The third principal component is a higher order nonlinear trend in the trajectories. To confirm that the weekly structures in these curves are real, we also provide pointwise standard error bands in the plots. Since our simulation study shows that the standard error based on the Louis formula underestimates the true standard deviation under a small sample size, we estimate the standard error using a bootstrap procedure instead. In our bootstrap procedure, we resample the subjects with replacement, fit the joint model to the bootstrap samples using the same tuning parameters as for the real data, and estimate the standard deviations of the estimators using their bootstrap replicates pointwisely. The confidence bands in Figures 3 and 4 are based on 100 bootstrap replicates. These confidence bands confirm that the weekly structures in the eigenfunctions are real. Note that the confidence bands in Figure 4 are wider than those in Figure 3 because the dichotomized trajectories are less informative.
The estimated regression coefficients for the Cox model and the corresponding standard errors and p-values are reported in Table 2. The standard errors are obtained by bootstrap with 100 replicates. For both types of baseline trajectories, the second principal component has a significant positive effect on the hazard rate of relapse time. This suggests that patients with a decline in recent cocaine-use amount or probability relapsed faster. Subjects who experienced such a decline might have established a longer period of abstinence before entering treatment than those who did not. As a result, it would not be surprising for the onset of their cocaine withdrawal symptoms to start sooner; this could have in turn caused a faster relapse. Among the covariates, Cocyrs is significant, suggesting subjects who had used cocaine for fewer years tended to relapse later.
For comparison purposes, we also report in Table 2 the estimation result of the two-stage procedure described in Section 4. In this procedure, FPCA and survival analysis are done in successive steps, and the estimation errors in the estimated principal component scores are not properly taken into account in the survival analysis. It is not surprising that the estimation coefficients for the principal component scores by the two-stage procedure are attenuated and none of them are significant.
Following a referee's suggestion, we have also performed PCA to the use amount trajectories without B-spline representation and roughness penalty regularization and use the PC scores in the survival analysis. The estimated Cox regression coefficients for the first three principal components Table 2 Cocaine data analysis under the joint model using either the cocaine-use amount trajectories (Amnt.) or the dichotomized use trajectories (Dich.). The table shows the estimated coefficients for the variable ξ and five covariates. Cocyrs and Curanxs denote the number of cocaine-use years and the number of current anxiety symptoms at baseline interview, respectively. "Stder" is the estimated standard error, which is calculated under bootstrap in the joint model. In other words, none of these PC scores is found to be significantly related to the first relapse time. This is because the cocaine-use amount trajectories contain a large amount of error (due to self-reporting and converting different consumption methods to equivalent grams), and without regularization and joint modeling the estimation errors in the PC scores greatly attenuate the Cox regression coefficients and reduce statistical power. Such a direct PCA approach is not applicable to the dichotomized trajectories. In our joint modeling analysis, we also closely monitor the convergence of the Markov Chain. We estimate the Monte Carlo error in the final EM iteration using the method described in Section 3.1, which is 8.3408 × 10 −4 for the cocaine-use amount trajectories and 7.8830 × 10 −4 for the dichotomized trajectories.
In a previous work, Sinha et al. (2006) analyzed a similar data set and concluded that the baseline average cocaine-use amount had a significant negative effect on the hazard function of relapse; this implies that those who used less during the baseline period tended to relapse sooner, which is counterintuitive. In Guan, Li and Sinha (2011), the authors argued that the counterintuitive results could be due to measurement error in the average use amount. After having accounted for the measurement error, they found that the baseline average cocaine-use amount was no longer significant. Since the first principal component in our joint model is closely related to the baseline average cocaine-use amount, our result further confirms the analysis of Guan, Li and Sinha (2011). However, we have also found that the subject-specific decreasing trend in the cocaine-use trajectories (i.e., the second principal component) is related to faster relapse, while such a finding was not made by either Sinha et al. (2006) or Guan, Li and Sinha (2011). 6. Summary. In studying the relationship between baseline cocaine-use patterns and posttreatment time to first cocaine relapse, most existing literature only makes use of some basic summary statistics derived from the cocaine-use trajectories, such as the average use amount and frequency of use. These summary statistics are subject to measurement error and cannot fully describe the dynamic structure of the baseline trajectories.
We propose an innovative joint modeling approach based on functional data analysis to jointly model the baseline generalized longitudinal trajectories and the interval censored failure time. Specifically, we model the latent process that drives the longitudinal responses as functional data, approximate the mean and eigenfunctions of the latent process by flexible spline basis functions, and propose a data-driven method to determine the number of principal components and hence the covariance structure of the longitudinal data. We propose and implement a Monte Carlo EM algorithm to fit the model and modified empirical information to estimate the standard error of the regression coefficients. Our analysis of the cocaine dependence treatment data shows that the relapse time is related to a decreasing trend in the cocaine-use behaviors rather than the average use amount.
Our proposed model can also be used to predict the first relapse time of the new subject. For a future subject, suppose that we only observe his/her baseline cocaine-use amount trajectory {Y * (t), t ∈ T }, then we can predict his/her first relapse time T * using an empirical Bayes method. Using the proposed joint model, we can write out the conditional distribution [T * , ξ * |Y * (t), t ∈ T ], where ξ * is the vector of latent principal component scores for the new subject. We can use the model parameters estimated from the training data set, and run an MCMC to draw samples from this conditional distribution. We use the MCMC samples to estimate the posterior distribution of T * , which provides both a point predictor and prediction intervals.
As all Monte Carlo based methods, our methods are computationally intense. For the cocaine dependence treatment data, it takes about 25 EM iterations for the algorithm to converge and the running time is about 1.5 hours using the self-reported use amount trajectories and about 2.5 hours using the dichotomized use trajectories. It takes a lot longer to perform model selection and bootstrap, since we have to fit the model many times. However, we argue that the computation time is a worthy price to pay in exchange for unbiased estimates and correct statistical inference. One of our future research directions is to accelerate the EM algorithm using graphics processing units (GPU) and parallel computing.