YPmodel: A main function of package of model of short-term and...

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/YPmodel.R

Description

The main function to perform parameter estimation and hypothesis testing. The corresponding S4 functions, plot.Y Pmodel and print.Y Pmodel, are also included to demonstrate the results.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
YPmodel(...)

## Default S3 method:
YPmodel(data, startPoint, nm, maxIter1, maxIter2, repNum, ...)
## S3 method for class 'YPmodel'
print(x, ...)
## S3 method for class 'YPmodel'
summary(object, ...)
## S3 method for class 'YPmodel'
plot(x, ...)

Arguments

...

For S4 method only.

data

A properly qualified filename where text data is to be saved, or a dataframe of input data set with three vectors: the event / censoring time (unite: year), the censoring indicator, and the group membership indicator. See the structure of sample data set gastric for instance.

startPoint

Start point for estimating \hat{β}.

nm

Parameter for parameter estimation, to define the upper boundary for the absolute value of \hat{β}.

maxIter1

Parameter of out-cycle iteration numbers.

maxIter2

Parameter of inner-cycle iteration numbers.

repNum

Number of iterations, to be used in the two lack-of-fit tests.

x

A dataframe of results from an YPmodel default process.

object

A dataframe of results from an YPmodel default process, equally to x (different symbol for S4 method only).

Value

An object of class YPmodel, basically a list including elements

Data

A dataframe of source data, generated from input data by YPmodel.inputData.

Estimate

A dataframe of estimation results, including 1) estimation of \hat{β}, 2) its confidential intervals and 3) the odds function of the control group \hat{R}(t,\hat{β}), generated by YPmodel.estimate.

IntervalBands

A dataframe of hazard ratios and related confidential intervals and bands, generated by YPmodel.IntervalBands.

LackFitTest

A dataframe of the two lack-of-fit tests for the semi-parametric model, generated by YPmodel.lackfittest.

Adlgrk

A dataframe of the two lack-of-fit tests, to test the hypothesis of equal distribution function in the two groups, generated by YPmodel.adlgrk.

Author(s)

Junlong Sun and Song Yang

References

1) YANG, S. AND PRENTICE, R. L. (2010). Improved Logrank-Type Tests for Survival Data Using Adaptive Weights. Biometrics 66, 30-38. 2) YANG, S. AND PRENTICE, R. L. (2005). Semiparametric analysis of short-term and long-term hazard ratios with two-sample survival data. Biometrika 92, 1-17. 3) YANG, S. AND ZHAO, Y. (2012). Checking the Short-Term and Long-Term Hazard Ratio Model for Survival Data. Scandinavian Journal of Statistics.

See Also

YPmodel.estimate, YPmodel.IntervalBands, YPmodel.lackfittest, YPmodel.adlgrk

Examples

1
2
3
4
5
library(YPmodel)
data(gastric)
result <- YPmodel(gastric, repNum=100)
summary(result)
plot(result)

Example output

Warning messages:
1: In ro * x :
  Recycling array of length 1 in array-vector arithmetic is deprecated.
  Use c() or as.vector() instead.

2: In (t - th2 - ro * x)/sqrt(2 * (1 - ro^2)) :
  Recycling array of length 1 in vector-array arithmetic is deprecated.
  Use c() or as.vector() instead.

3: In ro * x :
  Recycling array of length 1 in array-vector arithmetic is deprecated.
  Use c() or as.vector() instead.

4: In (-t - th2 - ro * x)/sqrt(2 * (1 - ro^2)) :
  Recycling array of length 1 in vector-array arithmetic is deprecated.
  Use c() or as.vector() instead.

Details of model of Yang and Prentice  

-------------------------------------------------------------------------------------------------------------  
Overall of short-term and long-term hazard ration model  

 Censoring rate:
0.0889 

 Total Number:
90 

 Group Number:
        Control Group Treatment Group
Numbers            45              45

-------------------------------------------------------------------------------------------------------------  
Parameters of short-term and long-term hazard ration model  

 Adaptive weight (Beta):
 
          Beta_1 Beta_2
estimates    1.6 -0.906

 Hazard ratio:
 
          Theta_1 Theta_2
estimates  4.9541  0.4041

 Confidence Interval (Beta):
 
       Lower bound Upper bound
Beta_1      0.5461      2.6543
Beta_2     -1.3947     -0.4173

 Confidence Interval (Theta)
 
        Lower bound Upper bound
Theta_1     1.72651     14.2155
Theta_2     0.24791      0.6588

-------------------------------------------------------------------------------------------------------------  
Point estimates, Pointwise confidence intervals, and confidence bands of short-term and long-term hazard ration model  

           Days    HR_fun  lower.cl  upper.cl lower.95%band upper.95%band
 [1,]  103.0000    3.1509    5.6625    1.7534        8.0527        1.2329
 [2,]  105.0000    2.9014    5.0150    1.6786        6.9670        1.2083
 [3,]  108.0000    2.8228    4.7816    1.6664        6.5627        1.2142
 [4,]  122.0000    2.7457    4.5654    1.6513        6.1965        1.2166
 [5,]  129.0000    2.5513    4.1293    1.5763        5.5144        1.1804
 [6,]  144.0000    2.4811    3.9592    1.5548        5.2426        1.1742
 [7,]  167.0000    2.4123    3.8014    1.5307        4.9958        1.1648
 [8,]  170.0000    2.3448    3.6549    1.5044        4.7717        1.1523
 [9,]  182.0000    2.1983    3.3719    1.4332        4.3600        1.1084
[10,]  183.0000    2.1365    3.2522    1.4035        4.1860        1.0904
[11,]  185.0000    2.0759    3.1403    1.3723        4.0268        1.0702
[12,]  193.0000    2.0167    3.0355    1.3398        3.8808        1.0480
[13,]  195.0000    1.9587    2.9371    1.3062        3.7465        1.0240
[14,]  197.0000    1.9020    2.8444    1.2718        3.6225        0.9986
[15,]  208.0000    1.8465    2.7569    1.2368        3.5075        0.9721
[16,]  216.0000    1.7505    2.5936    1.1815        3.2846        0.9329
[17,]  234.0000    1.6992    2.5166    1.1473        3.1863        0.9061
[18,]  235.0000    1.6490    2.4429    1.1131        3.0935        0.8790
[19,]  250.0000    1.5711    2.3148    1.0663        2.9217        0.8448
[20,]  254.0000    1.5245    2.2478    1.0339        2.8384        0.8188
[21,]  262.0000    1.4573    2.1402    0.9923        2.6960        0.7877
[22,]  301.0000    1.3957    2.0443    0.9529        2.5711        0.7577
[23,]  301.0000    1.3392    1.9583    0.9158        2.4605        0.7289
[24,]  307.0000    1.2993    1.9002    0.8884        2.3877        0.7070
[25,]  315.0000    1.2605    1.8437    0.8617        2.3169        0.6857
[26,]  342.0000    1.2138    1.7729    0.8310        2.2260        0.6619
[27,]  354.0000    1.1705    1.7084    0.8019        2.1442        0.6390
[28,]  356.0000    1.1302    1.6494    0.7744        2.0700        0.6171
[29,]  358.0000    1.0925    1.5951    0.7483        2.0023        0.5961
[30,]  380.0000    1.0573    1.5449    0.7236        1.9402        0.5762
[31,]  383.0000    1.0243    1.4983    0.7003        1.8829        0.5573
[32,]  383.0000    0.9933    1.4549    0.6782        1.8298        0.5393
[33,]  388.0000    0.9642    1.4143    0.6573        1.7804        0.5221
[34,]  394.0000    0.9367    1.3763    0.6375        1.7342        0.5059
[35,]  401.0000    0.9087    1.3296    0.6210        1.6712        0.4941
[36,]  408.0000    0.8843    1.2960    0.6033        1.6306        0.4795
[37,]  445.0000    0.8579    1.2515    0.5881        1.5702        0.4688
[38,]  460.0000    0.8362    1.2219    0.5723        1.5346        0.4556
[39,]  464.0000    0.8114    1.1796    0.5582        1.4769        0.4458
[40,]  484.0000    0.7875    1.1389    0.5445        1.4216        0.4363
[41,]  489.0000    0.7694    1.1147    0.5310        1.3928        0.4250
[42,]  499.0000    0.7521    1.0918    0.5181        1.3657        0.4141
[43,]  523.0000    0.7355    1.0700    0.5056        1.3403        0.4036
[44,]  524.0000    0.7197    1.0494    0.4936        1.3162        0.3935
[45,]  528.0000    0.6987    1.0123    0.4822        1.2649        0.3859
[46,]  535.0000    0.6845    0.9943    0.4713        1.2442        0.3766
[47,]  542.0000    0.6648    0.9594    0.4607        1.1960        0.3695
[48,]  562.0000    0.6522    0.9438    0.4507        1.1784        0.3609
[49,]  567.0000    0.6337    0.9112    0.4407        1.1334        0.3543
[50,]  569.0000    0.6224    0.8977    0.4315        1.1187        0.3463
[51,]  577.0000    0.6051    0.8674    0.4221        1.0770        0.3400
[52,]  580.0000    0.5886    0.8390    0.4129        1.0382        0.3337
[53,]  675.0000    0.5793    0.8288    0.4049        1.0278        0.3265
[54,]  676.0000    0.5702    0.8190    0.3970        1.0180        0.3194
[55,]  748.0000    0.5615    0.8097    0.3894        1.0088        0.3125
[56,]  778.0000    0.5530    0.8007    0.3819        1.0002        0.3058
[57,]  786.0000    0.5448    0.7921    0.3746        0.9919        0.2992
[58,]  795.0000    0.5304    0.7675    0.3665        0.9584        0.2935
[59,]  797.0000    0.5231    0.7605    0.3598        0.9522        0.2873
[60,]  855.0000    0.5099    0.7386    0.3520        0.9227        0.2817
[61,]  955.0000    0.5034    0.7330    0.3457        0.9186        0.2759
[62,]  968.0000    0.4971    0.7276    0.3396        0.9147        0.2702
[63,] 1000.0000    0.4910    0.7224    0.3337        0.9111        0.2646
[64,] 1245.0000    0.4850    0.7175    0.3278        0.9078        0.2591
[65,] 1271.0000    0.4791    0.7128    0.3221        0.9048        0.2537
[66,] 1366.0000    0.4677    0.6951    0.3147        0.8818        0.2481
[67,] 1420.0000    0.4627    0.6916    0.3095        0.8806        0.2431
[68,] 1551.0000    0.4577    0.6884    0.3044        0.8797        0.2382
[69,] 1577.0000    0.4477    0.6745    0.2972        0.8628        0.2324
[70,] 1694.0000    0.4436    0.6725    0.2926        0.8635        0.2278
[71,] 2060.0000    0.4349    0.6622    0.2857        0.8524        0.2219
[72,] 2363.0000    0.4315    0.6613    0.2815        0.8548        0.2178
[73,] 2412.0000    0.4315    0.6613    0.2815        0.8548        0.2178
[74,] 2486.0000    0.4315    0.6613    0.2815        0.8548        0.2178
[75,] 2754.0000    0.4315    0.6613    0.2815        0.8548        0.2178
[76,] 2796.0000    0.4315    0.6613    0.2815        0.8548        0.2178
[77,] 2802.0000    0.4315    0.6613    0.2815        0.8548        0.2178
[78,] 2934.0000    0.4315    0.6613    0.2815        0.8548        0.2178
[79,] 2950.0000    0.4315    0.6613    0.2815        0.8548        0.2178
[80,] 2988.0000    0.4315    0.6613    0.2815        0.8548        0.2178
      lower.90%band upper.90%band
 [1,]        7.2856         1.363
 [2,]        6.3454         1.327
 [3,]        5.9977         1.329
 [4,]        5.6811         1.327
 [5,]        5.0791         1.282
 [6,]        4.8404         1.272
 [7,]        4.6225         1.259
 [8,]        4.4234         1.243
 [9,]        4.0528         1.192
[10,]        3.8961         1.172
[11,]        3.7520         1.149
[12,]        3.6190         1.124
[13,]        3.4960         1.097
[14,]        3.3818         1.070
[15,]        3.2755         1.041
[16,]        3.0713         0.998
[17,]        2.9796         0.969
[18,]        2.8927         0.940
[19,]        2.7346         0.903
[20,]        2.6562         0.875
[21,]        2.5247         0.841
[22,]        2.4089         0.809
[23,]        2.3059         0.778
[24,]        2.2376         0.754
[25,]        2.1712         0.732
[26,]        2.0865         0.706
[27,]        2.0101         0.682
[28,]        1.9405         0.658
[29,]        1.8770         0.636
[30,]        1.8185         0.615
[31,]        1.7645         0.595
[32,]        1.7143         0.576
[33,]        1.6676         0.557
[34,]        1.6239         0.540
[35,]        1.5660         0.527
[36,]        1.5275         0.512
[37,]        1.4722         0.500
[38,]        1.4384         0.486
[39,]        1.3855         0.475
[40,]        1.3347         0.465
[41,]        1.3073         0.453
[42,]        1.2815         0.441
[43,]        1.2571         0.430
[44,]        1.2341         0.420
[45,]        1.1872         0.411
[46,]        1.1673         0.401
[47,]        1.1233         0.393
[48,]        1.1063         0.384
[49,]        1.0652         0.377
[50,]        1.0508         0.369
[51,]        1.0127         0.362
[52,]        0.9772         0.355
[53,]        0.9668         0.347
[54,]        0.9570         0.340
[55,]        0.9477         0.333
[56,]        0.9389         0.326
[57,]        0.9305         0.319
[58,]        0.8997         0.313
[59,]        0.8933         0.306
[60,]        0.8661         0.300
[61,]        0.8615         0.294
[62,]        0.8571         0.288
[63,]        0.8529         0.283
[64,]        0.8491         0.277
[65,]        0.8455         0.272
[66,]        0.8241         0.265
[67,]        0.8222         0.260
[68,]        0.8204         0.255
[69,]        0.8044         0.249
[70,]        0.8043         0.245
[71,]        0.7934         0.238
[72,]        0.7947         0.234
[73,]        0.7947         0.234
[74,]        0.7947         0.234
[75,]        0.7947         0.234
[76,]        0.7947         0.234
[77,]        0.7947         0.234
[78,]        0.7947         0.234
[79,]        0.7947         0.234
[80,]        0.7947         0.234

-------------------------------------------------------------------------------------------------------------  
Lack-of-fit tests for checking short-term and long-term hazard ration model  

 Adaptive weight (Beta, sample odds function estimator using only the control group data): 
 
          Beta_1 Beta_2
estimates  1.712 -0.949

 Residual, the martingale residual-based test (p-value):
0.12 

 Contrast, the contrast-based test (p-value):
0.58 
-------------------------------------------------------------------------------------------------------------  

Improved Logrank-Type Tests (p-value):
0.0304 

-------------------------------------------------------------------------------------------------------------  

YPmodel documentation built on Oct. 23, 2020, 5:15 p.m.