{'fraction_non_alphanumeric': 0.04433322999247088, 'fraction_numerical': 0.013552415961734355, 'mean_word_length': 4.296739385409336, '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': 7, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Correcting for Measurement Error in Segmented Cox Model

Measurement error in the covariate of main interest (e.g. the exposure variable, or the risk factor) is common in epidemiologic and health studies. It can effect the relative risk estimator or other types of coefficients derived from the fitted regression model. In order to perform a measurement error analysis, one needs information about the error structure. Two sources of validation data are an internal subset of the main data, and external or independent study. For the both sources, the true covariate is measured (that is, without error), or alternatively, its surrogate, which is error-prone covariate, is measured several times (repeated measures). This paper compares the precision in estimation via the different validation sources in the Cox model with a changepoint in the main covariate, using the bias correction methods RC and RR. The theoretical properties under each validation source is presented. In a simulation study it is found that the best validation source in terms of smaller mean square error and narrower confidence interval is the internal validation with measure of the true covariate in a common disease case, and the external validation with repeated measures of the surrogate for a rare disease case. In addition, it is found that addressing the correlation between the true covariate and its surrogate, and the value of the changepoint, is needed, especially in the rare disease case.


Introduction
Measurement error is common in many empirical studies. This error refers to the discrepancy between the true value and the measured value of a covariate (Thomas et al., 1993). It occurs when a covariate cannot be observed exactly (usually due to instrument or sampling error), and therefore we observe a surrogate covariate instead of measuring the true covariate. The surrogate measures the true covariate with some error. For example, in clinical trials, biomarkers such as blood pressure (Carroll et al., 1995) and CD4 counts (Tsiatis et al., 1995), are subject to measurement error; fat intake in nutritional studies relies largely on self-reported measures of dietary intake, and therefore is often measured with error (Carroll et al., 1995, Keogh 2013). Ignoring such error can substantially degrade the quality of inference or even yield erroneous results (see, for example, Carroll et al., 2006). Therefore, ways to correct the impact of this error are needed. There are two broad strategies to correct for measurement error (Buonaccorsi, 2010): The first is to estimate the required corrections for the model parameters from a validation study, independent of the main study under consideration, that is, an external study; The second is to measure the required corrections within the main study, that is, an internal study. In both external and internal studies, the sample may include the true covariate, or alternatively, repeated measures of the errorprone covariate. That is, we can distinguish between four sources of validation data: 1. External Validation data (EV) -the main study includes measures of the surrogate covariate only, but there exists a previous study, external to the main study, which includes measures of surrogate covariate and the true covariate. Then the connection between these two covariates can be estimated using this external data. 2. Internal Validation data (IV) -the true covariate is available on a subset of the main study. 3. Repeated measures, External (RM external) -the true covariate is not observed for any subject, but repeated measures of surrogate covariate are available on subjects that are outside the main study. 4. Repeated measures, Internal (RM internal) -the true covariate is not observed for any subject, but repeated measures of surrogate covariate are available on a subset of the main study.
Internal validation study has the capability of direct examination of the error structure. With external validation study, there may be doubt as to whether the populations characterized by the validation and main study samples are comparable in the sense that the measurement error model is equivalent or "transportable" between the populations. Based on validity concerns alone, internal validation study may has the greatest advantage. However, this neglects the important issue of the costs of obtaining the true exposures, which may be considerably larger than those for a more readily available surrogate.
Validation for measurement error correction had been examined widely in the literature. For example, Lyles et al. (2007) studied the efficiency of combining internal and external validation data in a case-control setting; Wong et al. (1999) studied the design of validation study for estimation the correction factor in univariate and bivariate situation; Muoka et al. (2019) proposed a method that adjusts for measurement error in three correlated exposures in the absence of internal validation study; Siddique at al. (2019) proposed a statistical framework for correcting for measurement error in longitudinal self-reported dietary data using an external validation study; Spiegelman and Gray (1991) studied cost-efficient study designs for binary response data with Gaussian covariate measurement error; Thurigen et al. (2000) presented a review of methods and their applicability in case-control studies for Measurement error correction using validation data.
The aim of the current paper is to study the validation for measurement error correction in the segmented Cox model, which was introduced by Agami et al. (2020). Specifically, the aim is to examine the influence of the validation type on the precision of the model parameters estimation. Agami et al. (2020) studied several bias correction methods, and examined their performance under repeated measures from an external reliability design. In this paper, some of these bias correction methods are considered, and the theoretical properties under each source validation is developed for the considered bias correction methods. The paper is organized as follows: Section 2 presents the setting, the segmented Cox model, and the considered bias correction methods. Section 3 presents the theoretical properties under each validation data. Section 4 presents a simulation study comparing the model parameters estimation under the various bias correction methods based on the various validation data. The comparison is done in terms of point estimation and confidence intervals. Section 5 presents a brief summary.

The Model
Let X(t) denotes the covariate of main interest (which can depend on time), and let Z(t) ∈ R p denotes the vector of additional covariates. Define a + = max(a, 0). The Cox model describes the hazard as a function of the covariates X(t) and Z(t), and the baseline hazard function λ 0 (t). Once the influence of X(t) on the hazard changes at some level of X(t), the segmented Cox model is of the form: Assuming a known changepoint τ , the unknown parameters are θ = (γ T , β, ω). When it is impossible or too expansive to observe the covariate X(t), we observe instead a surrogate covariate W (t), which measures the covariate X(t) with error. The assumptions throughout this paper are: (i) The error is additive, that is, W (t) = X(t) + U , where U is a random variable such that E(U |X(t)) = 0 (this is the classical error model).
, independent of the X(t)'s and the Z(t)'s. (iv) µ x (z) is of the form µ x (z) = α 0 + α 1 z. The observations are on n independent individuals. For a given individual i,T i denotes the time of entry into the study, T • i denotes the survival time, and C i denotes the time of right censoring. The event indicator is δ i = I(T • i ≤ C i ), and the at-risk indicator is denoted by Y i (t) = I(T i ≤ t ≤ T • i ). The maximum possible follow-up time is denoted by t * .
Let us write the relative risk as r(x, z, θ) = exp(γ T z + βx + ω(x − τ ) + ). If X(t) was known, the standard Cox log partial likelihood is given by Generally, the bias correction methods for Cox regression analysis with covariate error, as were studied in Agami et al. (2020), involve replacing r(x, z, θ) with some substitute, are as follows: This is an extension of the method proposed by Prentice (1982) to threshold models; B2. Modified RR Method (RR2): This is a bootstrap bias-correction procedure based on the weighted bootstrap algorithm as in Kosorok and Song (2007).

Background
The type of the validation data is involved in the log partial likelihood, and therefore has influence on the point estimators of the model parameters, and their corresponded confidence intervals as well. The RC and RR estimators are obtained as the solution to U (t * , θ) = 0, where U (t * , θ) is the score function based on the above log partial likelihood. Denote byθ the resulting estimator. In addition, let u (g) (t * , θ) be the limit of the score function U (t * , θ). and denote by θ * the solution of u(t * , θ) = 0. As was showed in Agami et al. (2020), n 1/2 (θ − θ * ) converges in distribution to a mean-zero multivariate normal distribution whose covariance matrix can be consistently estimated by Ω(t,θ, g) = [n −1 I(t,θ, g)] −1Â (t,θ, g)[n −1 I(t,θ, g)] −1 .
The explicit expression for each quantity depends on the specific bias correction method. This asymptotic covariance matrix ofθ involves the nuisance parameters vector φ := µ x , σ 2 x , σ 2 u . φ is usually unknown and need to be estimated, and the error in estimating φ must be accounted for in the asymptotic covariance matrix ofθ.

Point Estimation and Confidence Interval
As was mentioned in Section 1, the error estimation can be done by one of four sources of data: EV, IV, RM external, RM internal. Bellow, a description of the estimation procedure and the theoretical properties under each validation data is presented. Notation: Denote by φ * the true value of φ. Also, denote byθ ns the estimator of θ that involves the estimated nuisance parameters, and by I ns the minus second derivative of the log likelihood with the nuisance parameters replaced by their estimates. LetU φ denotes the first derivative of U respect to φ.

External Validation data (EV)
In this setting, the main study includes measures of W (t) only, but there exists a previous study, external to the main study, which includes measures of X(t) and W (t). Suppose this external data includes information on m independent subjects. In this case, the knowledge of X(t) is entered in the estimation of the nuisance parameters φ only, and therefore influence the log-likelihood through r(X i (t), Z i (t), θ). The measurement error can be calculated as U = W (t) − X(t) for the subjects with both X(t) and W (t) known. The estimated φ,φ, may be obtained as a solution of the estimation equations of the form The corrected covariance matrix is The proof is presented in Appendix A.1.

Internal Validation Data (IV)
Here, the main study includes measures of W (t) for all the n subjects, but there are m independent subjects that have measures of X(t) and W (t). In this case, the knowledge of X(t) is entered in the estimation of the nuisance parameters φ, but also through the observations included in the log partial likelihood. Hence we use the true X(t) where available, and otherwise we use its surrogate. That is, the log-likelihood is of the form: whereX is a vector of length n for which m < n includes the information of real X(t) and the other n − m the relevant surrogate. Since X(t) is available for some subjects, therefore, the consistency ofφ p →φ * is the same as previously in the case of EV setting. Regarding the corrected covariance matrix, althoughφ and U (t * , θ * , φ * , g) involve data from the same sample, they are nonetheless asymptotically independent. This holds using the argument in Zucker and Speigelman (2008) that the contribution to U (t * , θ * , φ * , g) made by each individual in the study has asymptotically expectation zero conditional on the true covariate value, and hence it follows from an iterated expectation argument that U (t * , θ * , φ * , g) andφ are asymptotically uncorrelated. For more details, see Zucker and Spiegelman (2008), Section 3. It then follows that the corrected covariance matrix in the case of IV setting is the same as in the previous case of EV setting.

RM External
In repeated measures setting, the vectorφ is obtained as a solution of the estimation equations of the form with k i replications for each subject i, andW i• is the average of W i over the k i replications.
The corrected covariance matrix is Ω corr (t * ,θ ns ,φ, g) = n −1 I ns (t * ,θ ns , g) −1 A corr (t * ,θ ns ,φ, g)n −1 I ns (t * ,θ ns , g U φ denotes the first derivative of U respect to φ. Proof of Proposition 2. The proof is similar to the proof in the previous case of EV or IV.
The corrected covariance matrix here is the same as in the previous cases of EV or IV settings.

RM Internal
Here, the consistency ofφ p →φ * is the same as in the previous case of RM external. Regarding the corrected covariance matrix, we have the following proposition: Proposition 3. Corrected Covariance Matrix: Denote by R the set of individuals in the replicated measures sample.
whereΨ φ denotes the first derivative of Ψ respect to φ. Then, the corrected covariance matrix is U φ denotes the first derivative of U respect to φ, andΨ φ denotes the second derivative of Ψ respect to φ. The proof is presented in Appendix A.2.

Design
This section presents a simulation study comparing the four validation data for the bias correction methods RC and RR, under several scenarios. The setting of the simulation is the same as in Agami et al. (2020), and detailed below. The results are summarized in Table 1 -Table 2 below and are presented in details in Appendix B. The following labels for the validation types are used: (i) EV_X, external validation having measures of the real X (ii) IV_X, internal validation having measures of the real X (iii) EV_RM, external validation having repeated measures of the surrogate W (iv) IV_RM, internal validation having repeated measures of the surrogate W .

Simulation Design
The simulation included a single time-independent covariate W , without additional covariates Z(t), and assumed a fixed administrative censoring at time t * = 10. The considered real values of the model were β = log(1.5) and ω = log (2), that is the effect of the covariate on the hazard is initially moderate and later becomes more pronounced. The covariate X was generated as standard normal and the event time was generated as exponential with parameter λ = λ 0 exp(βX + ω(X − τ ) + ).
The observed surrogate covariate value W was generated using the classical measurement error model with U ∼ N (0, σ 2 u ). Denote by ρ xw the correlation between X and W ; then, the values of σ 2 u were set to yield ρ xw = 0.8, 0.6, or 0.4 (with the resulting σ 2 u values being 0.56, 1.77 and 5.25). The changepoint τ was set at one of 5 points at various percentiles of the distribution of X: The performance of the estimators was examined under the common disease scenario where n = 3, 000 and the cumulative incidence was 0.5, and the rare disease scenario where n = 50, 000 and the cumulative incidence was 0.03. The value of the baseline hazard λ 0 was determined by the cumulative incidence and the value of the changepoint τ , for each case. The simulations results are based on 1,000 replications, and in all cases, the reported results include: (i) Relative bias of the median ofθ. That is, (bias(θ)/θ, when bias(θ) = median(θ) − θ.
(ii) Mean square error (MSE) of the median. That is, V ar(θ) + bias(θ) 2 . (iii) Confidence interval for θ, based on the asymptotic theory. This is the empirical coverage rate of nominal 95% confidence interval centered at the estimated parameter value and with half-width equal to 1.96 times the estimated asymptotic standard deviation.
In order to eliminate cases of divergence, the condition of |θ| ≤ 4.9 was imposed, and the results (i)-(iii) are based on replicates for which this condition was satisfied. Convergence problems arose more often when greater measurement error was considered, i.e. ρ xw = 0.4, and when the changepoint was at the lower or upper extreme of the covariate domain. The convergence percent (percentage of replications in which the estimation procedure converged) is presented Appendix B, and is denoted by "Pctgud". The validation data (both internal and external) included a sample size of 500, with two measurements of W for each subject when X was unlivable in the validation data.

Results
Comparing the results of the estimates among the four validation types, the best validation data in terms of smaller relative bias was the IV with X for the common disease, and the EV with RM for the rare disease, in most of the scenarios. In terms of smaller MSE, the best validation data was the IV with X for the common disease. For the rare disease, the results of the MSE were depended on the correlation ρ xw and the value of the changepoint τ ; But generally for ρ xw = 0.8, 0.6 in most of the scenarios, the smaller MSE was obtained in the EV with RM, and in EV with X for ρ xw = 0.4. For more details, see the summary in Table 1. Note that convergence problems arose usually for all τ in ρ xw = 0.4 and in τ < 0 in ρ xw = 0.6 (for both common and rare disease). Similarly, the confidence intervals under IV with X in the common disease were narrower and closer to 0.95, and under EV with RM in the rare disease except for the RC1 which the best was IV with RM. For more details, see the summary in Table 2.
For these two values of τ , the best is EV_RM, but for RR and τ = Φ −1 (0.25), the best is IV_X.

EV_RM for β.
Different results for a given method over the 4 validation data. No best validation data for ω, but in most scenarios, EV_RM is the best. c But in most scenarios, EV_X is the best. c a n = 3, 000 with cumulative incidence of 0.5. b n = 50, 000 with cumulative incidence of 0.03. c Large variability of Pctgud, hence comparison is less correct. For RR1: small differences over the four validation data in β, but the best is IV_RM in ω.
EV_RM for RC2 small differences over the four validation data for RR1 in both β and ω. a n = 3, 000 with cumulative incidence of 0.5. b n = 50, 000 with cumulative incidence of 0.03.

Summary
In this paper the theoretical properties of four validation types were examined, and a numerical comparison of these validation data had conducted via a simulation study. The numerical comparison was under the RC and RR bias correction methods in the setting of segmented Cox model with known changepoint. It was found that in general, the best validation data was IV with X for the common disease case. For the rare disease, which best validation type depends on the value of ρ xw : EV with RM for ρ xw = 0.8, 0.6, and EV with X for ρ xw = 0.4.

Appendices Appendix A. Theoretical Proofs
A.1. Proof of Proposition 1.

(i) Consistency
The estimation equations m i=1 Ψ i (φ) = 0 are of the form of M-estimator. By the theory of M-estimator and if the estimation equations are unbiased, under regularity conditions,φ is a consistent estimator of φ and its asymptotic distribution is normal. In the considered case, it is easy to see that the estimator is unbiased and the regularity conditions are fulfilled. Thereforeφ is consistent estimator of φ * and asymptotically normal.
The following is based on Zucker and Spiegelman (2008).
In particular forθ ns we have that: This is equivalent to: Rearranging, the last equation becomes: The normality of (θ ns − θ * ) involves two parts: the first is the convergence of U (t * , θ * , φ * , g) to a mean-zero multivariate normal distribution, and the second part is checking the distribution of (φ − φ * ) and finding the limits of the matrices I −1 (t * ,θ,φ, g) andU φ (t * ,θ,φ, g).
The proof of convergence of U (t, θ * , φ * , g) to a mean-zero multivariate normal distribution is the same as in the case with no nuisance parameters, see at Agami et al. (2020).
In the case of the estimation equations m i=1 Ψ i (φ) = 0, we have by Taylor expansion:

Applying the law of the large numbers yieldsφ
, respectively. As in the case with no nuisance parameters (Agami et al., 2020) where Σ ns (t * , θ, φ, g) depends on the nuisance parameters, and similarly,U φ (t * ,θ,φ, g) tends to a constant that depends on θ * and φ * . Therefore the asymptotic distribution ofU depends on the source data for the estimation of φ. Since hereφ is estimated by an external data (EV design), thenφ and U (t * , θ * , φ * , g) are independent. Therefore, Then, the corrected covariance matrix is and can be estimated by:

A.2. Proof of Proposition 3.
The proof here is similar to the proof in the case of external data, but with the additional argument which is relevant for the case of estimation of φ by an internal data or by repeated measures: . In addition, as already mentioned, we can express For the RC and RR methods, which involve the nuisance parameters φ = (µ x , σ 2 x , σ 2 u ), these parameters are unknown and need to be estimated with the estimation error accounted for in the covariance matrix of the estimates. Suppose the estimation of φ is based on a sample of m independent individuals, and denote byφ the estimator of φ. Then, the vectorφ is obtained as a solution of the estimation equations of the form whereΨ φ denote the first derivative of Ψ respect to φ. Also, denote byΨ φ the second derivative of Ψ respect to φ, and byU (g) φ the first derivative of U (g) respect to φ. Φ can be estimated asymptotically byΦ As in Zucker and Spiegelman (2008), the corrected covariance matrix is whereÂ corr (t,θ,φ, g) is equal to the sum ofÂ(t,θ,φ, g) and the terṁ                a The values in the cells are the convergence percent, i.e., percentage of replications over 1000 replications in which the estimation procedure converged. b n = 3, 000 with cumulative incidence of 0.5. c The estimates were obtained under unknown nuisance parameters which were estimated by a validation sample of size 500.   a Empirical coverage rate of nominal 95% confidence interval. b n = 3, 000 with cumulative incidence of 0.5. c The estimates were obtained under unknown nuisance parameters which were estimated by a validation sample of size 500.   a Empirical coverage rate of nominal 95% confidence interval. b n = 50, 000 with cumulative incidence of 0.03. c The estimates were obtained under unknown nuisance parameters which were estimated by a validation sample of size 500.