Function to obtain the average survival curve from all individual survival curves.
Arguments
- x
(
matrix
)
the matrix with the subgroup covariates.- h0
(
numeric
)
the vector with the cumulative baseline hazard.- est_coef
(
matrix
)
the estimated coefficients from the fitted model.
Examples
survival_curves(
elastic_net_surv$x, elastic_net_surv$h0,
elastic_net_surv$est_coef
)
#> [,1]
#> [1,] 0.9985914
#> [2,] 0.9977026
#> [3,] 0.9966367
#> [4,] 0.9962126
#> [5,] 0.9956792
#> [6,] 0.9943605
#> [7,] 0.9939882
#> [8,] 0.9913913
#> [9,] 0.9896410
#> [10,] 0.9891088
#> [11,] 0.9876629
#> [12,] 0.9867822
#> [13,] 0.9848705
#> [14,] 0.9842316
#> [15,] 0.9839075
#> [16,] 0.9837950
#> [17,] 0.9825901
#> [18,] 0.9826514
#> [19,] 0.9804890
#> [20,] 0.9797387
#> [21,] 0.9793895
#> [22,] 0.9791932
#> [23,] 0.9789862
#> [24,] 0.9778238
#> [25,] 0.9758639
#> [26,] 0.9754396
#> [27,] 0.9728670
#> [28,] 0.9709872
#> [29,] 0.9691415
#> [30,] 0.9686824
#> [31,] 0.9685754
#> [32,] 0.9683266
#> [33,] 0.9663449
#> [34,] 0.9652200
#> [35,] 0.9652201
#> [36,] 0.9639871
#> [37,] 0.9633101
#> [38,] 0.9619682
#> [39,] 0.9609175
#> [40,] 0.9597114
#> [41,] 0.9587441
#> [42,] 0.9581678
#> [43,] 0.9574661
#> [44,] 0.9555973
#> [45,] 0.9549646
#> [46,] 0.9535128
#> [47,] 0.9522276
#> [48,] 0.9516975
#> [49,] 0.9514425
#> [50,] 0.9512803
#> [51,] 0.9483750
#> [52,] 0.9475651
#> [53,] 0.9472621
#> [54,] 0.9463165
#> [55,] 0.9458871
#> [56,] 0.9456886
#> [57,] 0.9421522
#> [58,] 0.9408196
#> [59,] 0.9406011
#> [60,] 0.9394546
#> [61,] 0.9376855
#> [62,] 0.9374786
#> [63,] 0.9362615
#> [64,] 0.9355270
#> [65,] 0.9334124
#> [66,] 0.9327922
#> [67,] 0.9327396
#> [68,] 0.9327586
#> [69,] 0.9316638
#> [70,] 0.9297386
#> [71,] 0.9290235
#> [72,] 0.9283610
#> [73,] 0.9282563
#> [74,] 0.9249489
#> [75,] 0.9243026
#> [76,] 0.9240143
#> [77,] 0.9237238
#> [78,] 0.9224496
#> [79,] 0.9184512
#> [80,] 0.9180905
#> [81,] 0.9166927
#> [82,] 0.9162321
#> [83,] 0.9150547
#> [84,] 0.9147334
#> [85,] 0.9147142
#> [86,] 0.9136660
#> [87,] 0.9108798
#> [88,] 0.9101839
#> [89,] 0.9096258
#> [90,] 0.9094318
#> [91,] 0.9091829
#> [92,] 0.9088422
#> [93,] 0.9073051
#> [94,] 0.9051206
#> [95,] 0.9037174
#> [96,] 0.9032032
#> [97,] 0.9014999
#> [98,] 0.8985444
#> [99,] 0.8978649
#> [100,] 0.8977202
#> [101,] 0.8969057
#> [102,] 0.8968319
#> [103,] 0.8965444
#> [104,] 0.8935581
#> [105,] 0.8934057
#> [106,] 0.8918321
#> [107,] 0.8916548
#> [108,] 0.8914404
#> [109,] 0.8870812
#> [110,] 0.8866062
#> [111,] 0.8864957
#> [112,] 0.8853133
#> [113,] 0.8851474
#> [114,] 0.8850676
#> [115,] 0.8847958
#> [116,] 0.8845424
#> [117,] 0.8838709
#> [118,] 0.8815926
#> [119,] 0.8795597
#> [120,] 0.8793394
#> [121,] 0.8783747
#> [122,] 0.8780420
#> [123,] 0.8776180
#> [124,] 0.8759695
#> [125,] 0.8728793
#> [126,] 0.8701619
#> [127,] 0.8693094
#> [128,] 0.8680929
#> [129,] 0.8666363
#> [130,] 0.8656281
#> [131,] 0.8656186
#> [132,] 0.8647534
#> [133,] 0.8635656
#> [134,] 0.8611822
#> [135,] 0.8598210
#> [136,] 0.8595375
#> [137,] 0.8594294
#> [138,] 0.8589126
#> [139,] 0.8585581
#> [140,] 0.8571565
#> [141,] 0.8565434
#> [142,] 0.8553200
#> [143,] 0.8540678
#> [144,] 0.8508024
#> [145,] 0.8500768
#> [146,] 0.8476692
#> [147,] 0.8470354
#> [148,] 0.8469025
#> [149,] 0.8459541
#> [150,] 0.8455729
#> [151,] 0.8450828
#> [152,] 0.8441519
#> [153,] 0.8419080
#> [154,] 0.8408543
#> [155,] 0.8390415
#> [156,] 0.8388866
#> [157,] 0.8374835
#> [158,] 0.8347918
#> [159,] 0.8298524
#> [160,] 0.8294330
#> [161,] 0.8288115
#> [162,] 0.8279316
#> [163,] 0.8274962
#> [164,] 0.8275720
#> [165,] 0.8275644
#> [166,] 0.8273014
#> [167,] 0.8234590
#> [168,] 0.8215966
#> [169,] 0.8190003
#> [170,] 0.8177649
#> [171,] 0.8170845
#> [172,] 0.8166657
#> [173,] 0.8158843
#> [174,] 0.8148882
#> [175,] 0.8134590
#> [176,] 0.8112624
#> [177,] 0.8099117
#> [178,] 0.8091479
#> [179,] 0.8089619
#> [180,] 0.8077942
#> [181,] 0.8030700
#> [182,] 0.8018751
#> [183,] 0.8010040
#> [184,] 0.8000968
#> [185,] 0.7993527
#> [186,] 0.7991127
#> [187,] 0.7976266
#> [188,] 0.7969706
#> [189,] 0.7965759
#> [190,] 0.7946924
#> [191,] 0.7912343
#> [192,] 0.7900930
#> [193,] 0.7867848
#> [194,] 0.7859211
#> [195,] 0.7810967
#> [196,] 0.7806495
#> [197,] 0.7788710
#> [198,] 0.7767248
#> [199,] 0.7739717
#> [200,] 0.7738316
#> [201,] 0.7730738
#> [202,] 0.7717754
#> [203,] 0.7701988
#> [204,] 0.7677599
#> [205,] 0.7664517
#> [206,] 0.7646262
#> [207,] 0.7634121
#> [208,] 0.7615882
#> [209,] 0.7613466
#> [210,] 0.7588795
#> [211,] 0.7546929
#> [212,] 0.7527914
#> [213,] 0.7467169
#> [214,] 0.7438294
#> [215,] 0.7428341
#> [216,] 0.7408302
#> [217,] 0.7402092
#> [218,] 0.7362668
#> [219,] 0.7355365
#> [220,] 0.7351676
#> [221,] 0.7342494
#> [222,] 0.7340733
#> [223,] 0.7327771
#> [224,] 0.7301757
#> [225,] 0.7284076
#> [226,] 0.7244630
#> [227,] 0.7166914
#> [228,] 0.7149904
#> [229,] 0.7144865
#> [230,] 0.7125020
#> [231,] 0.7061839
#> [232,] 0.7003435
#> [233,] 0.6999777
#> [234,] 0.6990021
#> [235,] 0.6967436
#> [236,] 0.6923973
#> [237,] 0.6834372
#> [238,] 0.6818823
#> [239,] 0.6802440
#> [240,] 0.6774570
#> [241,] 0.6749417
#> [242,] 0.6742928
#> [243,] 0.6737741
#> [244,] 0.6726222
#> [245,] 0.6701898
#> [246,] 0.6380954
#> [247,] 0.6081849