Running examples in ‘tranSurv-Ex.R’ failed
The error most likely occurred in:

> ### Name: tranSurvfit
> ### Title: This function creates survival curves under dependent truncation
> ###   and independent censoring via a structural transformation model.
> ### Aliases: tranSurvfit
> 
> ### ** Examples
> 
> ## Generate simulated data from a transformation model
> datgen <- function(n) {
+     a <- -0.3
+     X <- rweibull(n, 2, 4) ## failure times
+     U <- rweibull(n, 2, 1) ## latent truncation time
+     T <- (1 + a) * U - a * X ## apply transformation
+     C <- rlnorm(n, .8, 1) ## censoring
+     dat <- data.frame(trun = T, obs = pmin(X, C), delta = 1 * (X <= C))
+     return(subset(dat, trun <= obs))
+ }
> 
> set.seed(123)
> dat <- datgen(300)
> fit <- with(dat, tranSurvfit(trun, obs, delta))
> fit

 Fitting structural transformation model 

 Call: tranSurvfit(trun = trun, obs = obs, delta = delta)

 Conditional Kendall's tau = 0.5212 , p-value = 0
 Restricted inverse probability weighted Kendall's tau = 0.5057 , p-value = 2e-04
 Transformation parameter by minimizing absolute value of Kendall's tau: -1 
 Transformation parameter by minimizing absolute value of Kendall's tau: -0.9643 
 Transformation parameter by minimizing absolute value of Kendall's tau: -0.9286 
 Transformation parameter by minimizing absolute value of Kendall's tau: -0.8929 
 Transformation parameter by minimizing absolute value of Kendall's tau: -0.8572 
 Transformation parameter by minimizing absolute value of Kendall's tau: -0.8215 
 Transformation parameter by minimizing absolute value of Kendall's tau: -0.7858 
 Transformation parameter by minimizing absolute value of Kendall's tau: -0.7501 
 Transformation parameter by minimizing absolute value of Kendall's tau: -0.7144 
 Transformation parameter by minimizing absolute value of Kendall's tau: -0.6787 
 Transformation parameter by minimizing absolute value of Kendall's tau: -0.643 
 Transformation parameter by minimizing absolute value of Kendall's tau: -0.6073 
 Transformation parameter by minimizing absolute value of Kendall's tau: -0.5716 
 Transformation parameter by minimizing absolute value of Kendall's tau: -0.5359 
 Transformation parameter by minimizing absolute value of Kendall's tau: -0.5002 
 Transformation parameter by minimizing absolute value of Kendall's tau: -0.4645 
 Transformation parameter by minimizing absolute value of Kendall's tau: -0.4288 
 Transformation parameter by minimizing absolute value of Kendall's tau: -0.3931 
 Transformation parameter by minimizing absolute value of Kendall's tau: -0.3574 
 Transformation parameter by minimizing absolute value of Kendall's tau: -0.3217 
 Transformation parameter by minimizing absolute value of Kendall's tau: -0.286 
 Transformation parameter by minimizing absolute value of Kendall's tau: -0.2503 
 Transformation parameter by minimizing absolute value of Kendall's tau: -0.2146 
 Transformation parameter by minimizing absolute value of Kendall's tau: -0.1789 
 Transformation parameter by minimizing absolute value of Kendall's tau: -0.1432 
 Transformation parameter by minimizing absolute value of Kendall's tau: -0.1075 
 Transformation parameter by minimizing absolute value of Kendall's tau: -0.0718 
 Transformation parameter by minimizing absolute value of Kendall's tau: -0.0361 
 Transformation parameter by minimizing absolute value of Kendall's tau: -4e-04 
 Transformation parameter by minimizing absolute value of Kendall's tau: 0.0353 
 Transformation parameter by minimizing absolute value of Kendall's tau: 0.071 
 Transformation parameter by minimizing absolute value of Kendall's tau: 0.1067 
 Transformation parameter by minimizing absolute value of Kendall's tau: 0.1424 
 Transformation parameter by minimizing absolute value of Kendall's tau: 0.1781 
 Transformation parameter by minimizing absolute value of Kendall's tau: 0.2138 
 Transformation parameter by minimizing absolute value of Kendall's tau: 0.2495 
 Transformation parameter by minimizing absolute value of Kendall's tau: 0.2852 
 Transformation parameter by minimizing absolute value of Kendall's tau: 0.3209 
 Transformation parameter by minimizing absolute value of Kendall's tau: 0.3566 
 Transformation parameter by minimizing absolute value of Kendall's tau: 0.3923 
 Transformation parameter by minimizing absolute value of Kendall's tau: 0.428 
 Transformation parameter by minimizing absolute value of Kendall's tau: 0.4637 
 Transformation parameter by minimizing absolute value of Kendall's tau: 0.4994 
 Transformation parameter by minimizing absolute value of Kendall's tau: 0.5351 
 Transformation parameter by minimizing absolute value of Kendall's tau: 0.5708 
 Transformation parameter by minimizing absolute value of Kendall's tau: 0.6065 
 Transformation parameter by minimizing absolute value of Kendall's tau: 0.6422 
 Transformation parameter by minimizing absolute value of Kendall's tau: 0.6779 
 Transformation parameter by minimizing absolute value of Kendall's tau: 0.7136 
 Transformation parameter by minimizing absolute value of Kendall's tau: 0.7493 
 Transformation parameter by minimizing absolute value of Kendall's tau: 0.785 
 Transformation parameter by minimizing absolute value of Kendall's tau: 0.8207 
 Transformation parameter by minimizing absolute value of Kendall's tau: 0.8564 
 Transformation parameter by minimizing absolute value of Kendall's tau: 0.8921 
 Transformation parameter by minimizing absolute value of Kendall's tau: 0.9278 
 Transformation parameter by minimizing absolute value of Kendall's tau: 0.9635 
 Transformation parameter by minimizing absolute value of Kendall's tau: 0.9992 
 Transformation parameter by minimizing absolute value of Kendall's tau: 1.0349 
 Transformation parameter by minimizing absolute value of Kendall's tau: 1.0706 
 Transformation parameter by minimizing absolute value of Kendall's tau: 1.1063 
 Transformation parameter by minimizing absolute value of Kendall's tau: 1.142 
 Transformation parameter by minimizing absolute value of Kendall's tau: 1.1777 
 Transformation parameter by minimizing absolute value of Kendall's tau: 1.2134 
 Transformation parameter by minimizing absolute value of Kendall's tau: 1.2491 
 Transformation parameter by minimizing absolute value of Kendall's tau: 1.2848 
 Transformation parameter by minimizing absolute value of Kendall's tau: 1.3205 
 Transformation parameter by minimizing absolute value of Kendall's tau: 1.3562 
 Transformation parameter by minimizing absolute value of Kendall's tau: 1.3919 
 Transformation parameter by minimizing absolute value of Kendall's tau: 1.4276 
 Transformation parameter by minimizing absolute value of Kendall's tau: 1.4633 
 Transformation parameter by minimizing absolute value of Kendall's tau: 1.499 
 Transformation parameter by minimizing absolute value of Kendall's tau: 1.5347 
 Transformation parameter by minimizing absolute value of Kendall's tau: 1.5704 
 Transformation parameter by minimizing absolute value of Kendall's tau: 1.6061 
 Transformation parameter by minimizing absolute value of Kendall's tau: 1.6418 
 Transformation parameter by minimizing absolute value of Kendall's tau: 1.6775 
 Transformation parameter by minimizing absolute value of Kendall's tau: 1.7132 
 Transformation parameter by minimizing absolute value of Kendall's tau: 1.7489 
 Transformation parameter by minimizing absolute value of Kendall's tau: 1.7846 
 Transformation parameter by minimizing absolute value of Kendall's tau: 1.8203 
 Transformation parameter by minimizing absolute value of Kendall's tau: 1.856 
 Transformation parameter by minimizing absolute value of Kendall's tau: 1.8917 
 Transformation parameter by minimizing absolute value of Kendall's tau: 1.9274 
 Transformation parameter by minimizing absolute value of Kendall's tau: 1.9631 
 Transformation parameter by minimizing absolute value of Kendall's tau: 1.9988 
 Transformation parameter by minimizing absolute value of Kendall's tau: 2.0345 
 Transformation parameter by minimizing absolute value of Kendall's tau: 2.0702 
 Transformation parameter by minimizing absolute value of Kendall's tau: 2.1059 
 Transformation parameter by minimizing absolute value of Kendall's tau: 2.1416 
 Transformation parameter by minimizing absolute value of Kendall's tau: 2.1773 
 Transformation parameter by minimizing absolute value of Kendall's tau: 2.213 
 Transformation parameter by minimizing absolute value of Kendall's tau: 2.2487 
 Transformation parameter by minimizing absolute value of Kendall's tau: 2.2844 
 Transformation parameter by minimizing absolute value of Kendall's tau: 2.3201 
 Transformation parameter by minimizing absolute value of Kendall's tau: 2.3558 
 Transformation parameter by minimizing absolute value of Kendall's tau: 2.3915 
 Transformation parameter by minimizing absolute value of Kendall's tau: 2.4272 
 Transformation parameter by minimizing absolute value of Kendall's tau: 2.4629 
 Transformation parameter by minimizing absolute value of Kendall's tau: 2.4986 
 Transformation parameter by minimizing absolute value of Kendall's tau: 2.5343 
 Transformation parameter by minimizing absolute value of Kendall's tau: 2.57 
 Transformation parameter by minimizing absolute value of Kendall's tau: 3.08 
 Transformation parameter by minimizing absolute value of Kendall's tau: 3.59 
 Transformation parameter by minimizing absolute value of Kendall's tau: 4.1 
 Transformation parameter by minimizing absolute value of Kendall's tau: 4.61 
 Transformation parameter by minimizing absolute value of Kendall's tau: 5.12 
 Transformation parameter by minimizing absolute value of Kendall's tau: 5.63 
 Transformation parameter by minimizing absolute value of Kendall's tau: 6.14 
 Transformation parameter by minimizing absolute value of Kendall's tau: 6.65 
 Transformation parameter by minimizing absolute value of Kendall's tau: 7.16 
 Transformation parameter by minimizing absolute value of Kendall's tau: 7.67 
 Transformation parameter by minimizing absolute value of Kendall's tau: 8.18 
 Transformation parameter by minimizing absolute value of Kendall's tau: 8.69 
 Transformation parameter by minimizing absolute value of Kendall's tau: 9.2 
 Transformation parameter by minimizing absolute value of Kendall's tau: 9.71 
 Transformation parameter by minimizing absolute value of Kendall's tau: 10.22 
 Transformation parameter by minimizing absolute value of Kendall's tau: 10.73 
 Transformation parameter by minimizing absolute value of Kendall's tau: 11.24 
 Transformation parameter by minimizing absolute value of Kendall's tau: 11.75 
 Transformation parameter by minimizing absolute value of Kendall's tau: 12.26 
 Transformation parameter by minimizing absolute value of Kendall's tau: 12.77 
 Transformation parameter by minimizing absolute value of Kendall's tau: 13.28 
 Transformation parameter by minimizing absolute value of Kendall's tau: 13.79 
 Transformation parameter by minimizing absolute value of Kendall's tau: 14.3 
 Transformation parameter by minimizing absolute value of Kendall's tau: 14.81 
 Transformation parameter by minimizing absolute value of Kendall's tau: 15.32 
 Transformation parameter by minimizing absolute value of Kendall's tau: 15.83 
 Transformation parameter by minimizing absolute value of Kendall's tau: 16.34 
 Transformation parameter by minimizing absolute value of Kendall's tau: 16.85 
 Transformation parameter by minimizing absolute value of Kendall's tau: 17.36 
 Transformation parameter by minimizing absolute value of Kendall's tau: 17.87 
 Transformation parameter by minimizing absolute value of Kendall's tau: 18.38 
 Transformation parameter by minimizing absolute value of Kendall's tau: 18.89 
 Transformation parameter by minimizing absolute value of Kendall's tau: 19.4 
 Transformation parameter by minimizing absolute value of Kendall's tau: 19.91 
 Transformation parameter by minimizing absolute value of Kendall's tau: 20.42 
 Transformation parameter by minimizing absolute value of Kendall's tau: 20.93 
 Transformation parameter by minimizing absolute value of Kendall's tau: 21.44 
 Transformation parameter by minimizing absolute value of Kendall's tau: 21.95 
 Transformation parameter by minimizing absolute value of Kendall's tau: 22.46 
 Transformation parameter by minimizing absolute value of Kendall's tau: 22.97 
 Transformation parameter by minimizing absolute value of Kendall's tau: 23.48 
 Transformation parameter by minimizing absolute value of Kendall's tau: 23.99 
 Transformation parameter by minimizing absolute value of Kendall's tau: 24.5 
 Transformation parameter by minimizing absolute value of Kendall's tau: 25.01 
 Transformation parameter by minimizing absolute value of Kendall's tau: 25.52 
 Transformation parameter by minimizing absolute value of Kendall's tau: 26.03 
 Transformation parameter by minimizing absolute value of Kendall's tau: 26.54 
 Transformation parameter by minimizing absolute value of Kendall's tau: 27.05 
 Transformation parameter by minimizing absolute value of Kendall's tau: 27.56 
 Transformation parameter by minimizing absolute value of Kendall's tau: 28.07 
 Transformation parameter by minimizing absolute value of Kendall's tau: 28.58 
 Transformation parameter by minimizing absolute value of Kendall's tau: 29.09 
 Transformation parameter by minimizing absolute value of Kendall's tau: 29.6 
 Transformation parameter by minimizing absolute value of Kendall's tau: 30.11 
 Transformation parameter by minimizing absolute value of Kendall's tau: 30.62 
 Transformation parameter by minimizing absolute value of Kendall's tau: 31.13 
 Transformation parameter by minimizing absolute value of Kendall's tau: 31.64 
 Transformation parameter by minimizing absolute value of Kendall's tau: 32.15 
 Transformation parameter by minimizing absolute value of Kendall's tau: 32.66 
 Transformation parameter by minimizing absolute value of Kendall's tau: 33.17 
 Transformation parameter by minimizing absolute value of Kendall's tau: 33.68 
 Transformation parameter by minimizing absolute value of Kendall's tau: 34.19 
 Transformation parameter by minimizing absolute value of Kendall's tau: 34.7 
 Transformation parameter by minimizing absolute value of Kendall's tau: 35.21 
 Transformation parameter by minimizing absolute value of Kendall's tau: 35.72 
 Transformation parameter by minimizing absolute value of Kendall's tau: 36.23 
 Transformation parameter by minimizing absolute value of Kendall's tau: 36.74 
 Transformation parameter by minimizing absolute value of Kendall's tau: 37.25 
 Transformation parameter by minimizing absolute value of Kendall's tau: 37.76 
 Transformation parameter by minimizing absolute value of Kendall's tau: 38.27 
 Transformation parameter by minimizing absolute value of Kendall's tau: 38.78 
 Transformation parameter by minimizing absolute value of Kendall's tau: 39.29 
 Transformation parameter by minimizing absolute value of Kendall's tau: 39.8 
 Transformation parameter by minimizing absolute value of Kendall's tau: 40.31 
 Transformation parameter by minimizing absolute value of Kendall's tau: 40.82 
 Transformation parameter by minimizing absolute value of Kendall's tau: 41.33 
 Transformation parameter by minimizing absolute value of Kendall's tau: 41.84 
 Transformation parameter by minimizing absolute value of Kendall's tau: 42.35 
 Transformation parameter by minimizing absolute value of Kendall's tau: 42.86 
 Transformation parameter by minimizing absolute value of Kendall's tau: 43.37 
 Transformation parameter by minimizing absolute value of Kendall's tau: 43.88 
 Transformation parameter by minimizing absolute value of Kendall's tau: 44.39 
 Transformation parameter by minimizing absolute value of Kendall's tau: 44.9 
 Transformation parameter by minimizing absolute value of Kendall's tau: 45.41 
 Transformation parameter by minimizing absolute value of Kendall's tau: 45.92 
 Transformation parameter by minimizing absolute value of Kendall's tau: 46.43 
 Transformation parameter by minimizing absolute value of Kendall's tau: 46.94 
 Transformation parameter by minimizing absolute value of Kendall's tau: 47.45 
 Transformation parameter by minimizing absolute value of Kendall's tau: 47.96 
 Transformation parameter by minimizing absolute value of Kendall's tau: 48.47 
 Transformation parameter by minimizing absolute value of Kendall's tau: 48.98 
 Transformation parameter by minimizing absolute value of Kendall's tau: 49.49 
 Transformation parameter by minimizing absolute value of Kendall's tau: 50
 Transformation parameter by maximizing p-value of the test: -1 

> 
> ## Checking the transformation parameter
> fit$byTau$par
  [1] -0.999990000 -0.964290007 -0.928590014 -0.892890021 -0.857190028
  [6] -0.821490035 -0.785790042 -0.750090049 -0.714390056 -0.678690063
 [11] -0.642990070 -0.607290077 -0.571590084 -0.535890091 -0.500190098
 [16] -0.464490105 -0.428790112 -0.393090119 -0.357390126 -0.321690133
 [21] -0.285990140 -0.250290147 -0.214590154 -0.178890161 -0.143190168
 [26] -0.107490175 -0.071790182 -0.036090189 -0.000390196  0.035309797
 [31]  0.071009790  0.106709783  0.142409776  0.178109769  0.213809762
 [36]  0.249509755  0.285209748  0.320909741  0.356609734  0.392309727
 [41]  0.428009720  0.463709713  0.499409706  0.535109699  0.570809692
 [46]  0.606509685  0.642209678  0.677909671  0.713609664  0.749309657
 [51]  0.785009650  0.820709643  0.856409636  0.892109629  0.927809622
 [56]  0.963509615  0.999209608  1.034909601  1.070609594  1.106309587
 [61]  1.142009580  1.177709573  1.213409566  1.249109559  1.284809552
 [66]  1.320509545  1.356209538  1.391909531  1.427609524  1.463309517
 [71]  1.499009510  1.534709503  1.570409496  1.606109489  1.641809482
 [76]  1.677509475  1.713209468  1.748909461  1.784609454  1.820309447
 [81]  1.856009440  1.891709433  1.927409426  1.963109419  1.998809412
 [86]  2.034509405  2.070209398  2.105909391  2.141609384  2.177309377
 [91]  2.213009370  2.248709363  2.284409356  2.320109349  2.355809342
 [96]  2.391509335  2.427209328  2.462909321  2.498609314  2.534309307
[101]  2.570009300  3.080009200  3.590009100  4.100009000  4.610008900
[106]  5.120008800  5.630008700  6.140008600  6.650008500  7.160008400
[111]  7.670008300  8.180008200  8.690008100  9.200008000  9.710007900
[116] 10.220007800 10.730007700 11.240007600 11.750007500 12.260007400
[121] 12.770007300 13.280007200 13.790007100 14.300007000 14.810006900
[126] 15.320006800 15.830006700 16.340006600 16.850006500 17.360006400
[131] 17.870006300 18.380006200 18.890006100 19.400006000 19.910005900
[136] 20.420005800 20.930005700 21.440005600 21.950005500 22.460005400
[141] 22.970005300 23.480005200 23.990005100 24.500005000 25.010004900
[146] 25.520004800 26.030004700 26.540004600 27.050004500 27.560004400
[151] 28.070004300 28.580004200 29.090004100 29.600004000 30.110003900
[156] 30.620003800 31.130003700 31.640003600 32.150003500 32.660003400
[161] 33.170003300 33.680003200 34.190003100 34.700003000 35.210002900
[166] 35.720002800 36.230002700 36.740002600 37.250002500 37.760002400
[171] 38.270002300 38.780002200 39.290002100 39.800002000 40.310001900
[176] 40.820001800 41.330001700 41.840001600 42.350001500 42.860001400
[181] 43.370001300 43.880001200 44.390001100 44.900001000 45.410000900
[186] 45.920000800 46.430000700 46.940000600 47.450000500 47.960000400
[191] 48.470000300 48.980000200 49.490000100 50.000000000
> fit$byTau$obj
  [1] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
 [38] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
 [75] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
[112] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
[149] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
[186] 0 0 0 0 0 0 0 0 0
> with(dat, condKendall(trun, obs, delta, method = "IPW2", a = fit$byTau$par))$PE
Warning in mapply(FUN, X = obs, T = trun, a = a) :
  longer argument not a multiple of length of shorter
Warning in mapply(FUN, X = obs, T = trun, a = a) :
  longer argument not a multiple of length of shorter
Error in Surv(trun, obs, 1 - delta) : 
  Start and stop are different lengths
Calls: with ... <Anonymous> -> model.frame.default -> eval -> eval -> Surv
Execution halted