"""
Loading example survival analysis datasets

```julia
using LSurvival, Plots # note Plots does not install by default
heartdata, heartmeta = survivaldata("heart")
ft = coxph(@formula(Surv(start, stop, event)~surgery), heartdata);
# plot baseline cumulative hazard
basehazplot(ft)
# plot Schoenfeld residuals
coxdx(ft)  
```

"""
function survivaldata(kwargs...)
    data = Dict(
    "heart" => (start  = [0,0,0,1,0,36,0,0,0,51,0,0,0,12,0,26,0,0,17,0,37,0,0,28,0,0,20,0,0,18,0,8,0,12,0,3,0,83,0,25,0,0,0,71,0,0,16,0,0,17,0,51,0,23,0,0,46,0,19,0,4.5,0,2,0,41,0,58,0,0,0,0,1,0,2,0,21,0,0,36,0,83,0,32,0,0,41,0,0,10,0,67,0,0,21,0,78,0,3,0,0,0,27,0,33,0,12,0,0,57,0,3,0,10,0,5,0,31,0,4,0,27,0,5,0,0,46,0,0,210,0,67,0,26,0,6,0,0,32,0,37,0,0,8,0,60,0,31,0,139,0,160,0,0,310,0,28,0,4,0,2,0,13,0,21,0,96,0,0,38,0,0,0], stop  = [50,6,1,16,36,39,18,3,51,675,40,85,12,58,26,153,8,17,81,37,1387,1,28,308,36,20,43,37,18,28,8,1032,12,51,3,733,83,219,25,1800,1401,263,71,72,35,16,852,16,17,77,51,1587,23,1572,12,46,100,19,66,4.5,5,2,53,41,1408,58,1322,3,2,40,1,45,2,996,21,72,9,36,1142,83,980,32,285,102,41,188,3,10,61,67,942,149,21,343,78,916,3,68,2,69,27,842,33,584,12,78,32,57,285,3,68,10,670,5,30,31,620,4,596,27,90,5,17,2,46,545,21,210,515,67,96,26,482,6,445,428,32,80,37,334,5,8,397,60,110,31,370,139,207,160,186,340,310,340,28,265,4,165,2,16,13,180,21,131,96,109,21,38,39,31,11,6], event  = [1,1,0,1,0,1,1,1,0,1,1,1,0,1,0,1,1,0,1,0,1,1,0,1,1,0,1,1,0,1,0,1,0,1,0,1,0,1,0,0,0,1,0,1,1,0,1,1,0,1,0,0,0,0,1,0,1,0,1,0,1,0,1,0,0,0,0,1,1,1,0,1,0,1,0,1,1,0,0,0,1,0,1,1,0,1,1,0,1,0,0,1,0,1,0,0,0,1,1,1,0,0,0,1,0,1,1,0,1,0,1,0,0,0,1,0,0,0,0,0,1,0,1,1,0,0,1,0,0,0,1,0,0,0,0,0,0,1,0,1,1,0,0,0,1,0,0,0,1,0,1,1,0,0,0,0,0,1,0,1,0,0,0,0,0,0,1,0,0,0,0,1], age  = [-17.1553730321697,3.83572895277207,6.29705681040383,6.29705681040383,-7.73716632443532,-7.73716632443532,-27.2142368240931,6.59548254620123,2.86926762491444,2.86926762491444,-2.65023956194388,-0.837782340862425,-5.49760438056126,-5.49760438056126,-0.0191649555099218,-0.0191649555099218,5.1937029431896,6.57357973990418,6.57357973990418,6.0123203285421,6.0123203285421,5.81519507186858,1.44832306639288,1.44832306639288,-27.668720054757,8.84873374401095,8.84873374401095,11.1238877481177,7.27994524298425,7.27994524298425,-4.6570841889117,-4.6570841889117,-5.21560574948666,-5.21560574948666,10.3572895277207,10.3572895277207,3.80013689253936,3.80013689253936,-14.776180698152,-14.776180698152,-17.4647501711157,-39.2142368240931,6.02327173169062,6.02327173169062,2.43394934976044,-3.08829568788501,-3.08829568788501,6.88569472963724,16.4079397672827,16.4079397672827,0.903490759753595,0.903490759753595,-7.44695414099932,-7.44695414099932,-4.53388090349076,0.925393566050651,0.925393566050651,13.5003422313484,13.5003422313484,-6.52977412731006,-6.52977412731006,2.51882272416153,2.51882272416153,0.481861738535251,0.481861738535251,-2.69678302532512,-2.69678302532512,-11.5592060232717,-4.60780287474333,-5.42094455852156,-11.8165639972622,-11.8165639972622,0.610540725530456,0.610540725530456,-0.90075290896646,-0.90075290896646,8.03559206023272,-11.3456536618754,-11.3456536618754,-2.11362080766598,-2.11362080766598,0.733744010951405,0.733744010951405,-6.75154004106776,-0.657084188911703,-0.657084188911703,-0.208076659822041,4.45448323066393,4.45448323066393,-9.25667351129363,-9.25667351129363,-6.73511293634497,0.0164271047227942,0.0164271047227942,-6.61738535249829,-6.61738535249829,1.05407255304586,1.05407255304586,4.56399726214921,-8.64613278576318,-15.3401779603012,-15.3401779603012,0.815879534565369,0.815879534565369,3.29363449691992,3.29363449691992,5.21286789869952,-28.4490075290897,-28.4490075290897,-2.75975359342916,-2.75975359342916,-0.0109514031485318,-0.0109514031485318,5.00205338809035,5.00205338809035,-0.591375770020534,-0.591375770020534,-21.2731006160164,-21.2731006160164,8.33127994524298,8.33127994524298,-18.8336755646817,-18.8336755646817,4.18069815195072,4.0848733744011,4.0848733744011,-6.88843258042436,0.703627652292951,0.703627652292951,5.782340862423,5.782340862423,-1.55509924709104,-1.55509924709104,4.89253935660506,4.89253935660506,-18.798083504449,5.30869267624914,5.30869267624914,-5.28131416837783,-5.28131416837783,-0.0191649555099218,0.919917864476389,0.919917864476389,-1.74674880219028,-1.74674880219028,6.362765229295,6.362765229295,3.04722792607803,3.04722792607803,4.03285420944559,4.03285420944559,-0.40520191649555,-3.01711156741958,-3.01711156741958,-0.249144421629019,-0.249144421629019,-4.15879534565367,-4.15879534565367,-7.71800136892539,-7.71800136892539,-21.3497604380561,-21.3497604380561,-24.3832991101985,-24.3832991101985,-19.3702943189596,-19.3702943189596,1.83436002737851,-12.9390828199863,-12.9390828199863,1.51676933607118,-7.60848733744011,-8.68446269678302], year  = [0.123203285420945,0.254620123203285,0.265571526351814,0.265571526351814,0.490075290896646,0.490075290896646,0.607802874743327,0.700889801505818,0.780287474332649,0.780287474332649,0.835044490075291,0.856947296372348,0.862422997946612,0.862422997946612,0.87337440109514,0.87337440109514,0.9637234770705,0.969199178644764,0.969199178644764,0.971937029431896,0.971937029431896,0.991101984941821,1.07049965776865,1.07049965776865,1.07597535934292,1.08692676249144,1.08692676249144,1.13347022587269,1.3305954825462,1.3305954825462,1.3388090349076,1.3388090349076,1.46201232032854,1.46201232032854,1.52772073921971,1.52772073921971,1.56605065023956,1.56605065023956,1.57426420260096,1.57426420260096,1.58247775496235,1.59069130732375,1.68377823408624,1.68377823408624,1.78507871321013,1.88364134154689,1.88364134154689,1.89459274469541,1.91101984941821,1.91101984941821,2.1574264202601,2.1574264202601,2.19849418206708,2.19849418206708,2.30800821355236,2.507871321013,2.507871321013,2.56536618754278,2.56536618754278,2.5927446954141,2.5927446954141,2.63381245722108,2.63381245722108,2.64750171115674,2.64750171115674,2.8829568788501,2.8829568788501,2.88843258042437,3.05817932922656,3.16495550992471,3.26351813826146,3.26351813826146,3.27720739219713,3.27720739219713,3.34017796030116,3.34017796030116,3.34839151266256,3.37577002053388,3.37577002053388,3.37577002053388,3.37577002053388,3.47707049965777,3.47707049965777,3.564681724846,3.75085557837098,3.75085557837098,3.75085557837098,3.854893908282,3.854893908282,3.9233401779603,3.9233401779603,3.95071868583162,3.97809719370294,3.97809719370294,3.99452429842574,3.99452429842574,4.13141683778234,4.13141683778234,4.17522245037645,4.18891170431212,4.19712525667351,4.19712525667351,4.33675564681725,4.33675564681725,4.42984257357974,4.42984257357974,4.46817248459959,4.47638603696099,4.47638603696099,4.51745379876797,4.51745379876797,4.66803559206023,4.66803559206023,4.71184120465435,4.71184120465435,4.80492813141684,4.80492813141684,4.87063655030801,4.87063655030801,4.94729637234771,4.94729637234771,4.96646132785763,4.96646132785763,4.99657768651609,5.01026694045174,5.01026694045174,5.01574264202601,5.09240246406571,5.09240246406571,5.16632443531828,5.16632443531828,5.18275154004107,5.18275154004107,5.28405201916496,5.28405201916496,4.08487337440109,5.31690622861054,5.31690622861054,5.33333333333333,5.33333333333333,5.35249828884326,5.4154688569473,5.4154688569473,5.47022587268994,5.47022587268994,5.48939082819986,5.48939082819986,5.51129363449692,5.51129363449692,5.51403148528405,5.51403148528405,5.53319644079398,5.57152635181383,5.57152635181383,5.77686516084873,5.77686516084873,5.95482546201232,5.95482546201232,5.97672826830938,5.97672826830938,6.00958247775496,6.00958247775496,6.14373716632443,6.14373716632443,6.20396988364134,6.20396988364134,6.23408624229979,6.39561943874059,6.39561943874059,6.41752224503765,6.47227926078029,-0.0492813141683778], surgery  = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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,0,0,0,0,1,1,1,1,0,1,1,0,0,1,1,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,1,1,0,0,0], transplant  = [0,0,0,1,0,1,0,0,0,1,0,0,0,1,0,1,0,0,1,0,1,0,0,1,0,0,1,0,0,1,0,1,0,1,0,1,0,1,0,1,0,0,0,1,0,0,1,0,0,1,0,1,0,1,0,0,1,0,1,0,1,0,1,0,1,0,1,0,0,0,0,1,0,1,0,1,0,0,1,0,1,0,1,0,0,1,0,0,1,0,1,0,0,1,0,1,0,1,0,0,0,1,0,1,0,1,0,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,0,1,0,0,1,0,1,0,1,0,1,0,0,1,0,1,0,0,1,0,1,0,1,0,1,0,1,0,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,0,1,0,0,0], id  = [1,2,3,3,4,4,5,6,7,7,8,9,10,10,11,11,12,13,13,14,14,15,16,16,17,18,18,19,20,20,21,21,22,22,23,23,24,24,25,25,26,27,28,28,29,30,30,31,32,32,33,33,34,34,35,36,36,37,37,38,38,39,39,40,40,41,41,42,43,44,45,45,46,46,47,47,48,49,49,50,50,51,51,52,53,53,54,55,55,56,56,57,58,58,59,59,60,60,61,62,63,63,64,64,65,65,66,67,67,68,68,69,69,70,70,71,71,72,72,73,73,74,74,75,76,76,77,78,78,79,79,80,80,81,81,82,83,83,84,84,85,86,86,87,87,88,88,89,89,90,90,91,92,92,93,93,94,94,95,95,96,96,97,97,98,98,99,100,100,101,102,103]),
    "ovarian" => (futime=[59,115,156,421,431,448,464,475,477,563,638,744,769,770,803,855,1040,1106,1129,1206,1227,268,329,353,365,377], fustat=[1,1,1,0,1,0,1,1,0,1,1,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0], age=[72.3315,74.4932,66.4658,53.3644,50.3397,56.4301,56.937,59.8548,64.1753,55.1781,56.7562,50.1096,59.6301,57.0521,39.2712,43.1233,38.8932,44.6,53.9068,44.2055,59.589,74.5041,43.137,63.2192,64.4247,58.3096], resid_ds=[2,2,2,2,2,1,2,2,2,1,1,1,2,2,1,1,2,1,1,2,1,2,2,1,2,1], rx=[1,1,1,2,1,1,2,2,1,2,1,2,2,2,1,1,1,1,2,2,2,1,1,2,2,2], ecog_ps=[1,1,2,1,1,2,2,2,1,2,2,1,2,1,1,2,2,1,1,1,2,2,1,2,1,1])
)
description = Dict(
    "heart" => """
    (description and data drawn directly from the `survival package in R`)

    `start`, `stop`, `event` Entry and exit time and status for this interval of time
    `age` age-48 years
    `year` year of acceptance (in years after 1 Nov 1967)
    `surgery` prior bypass surgery 1=yes
    `transplant` received transplant 1=yes
    `id` patient id
    
    Source
    Crowley and Hu. Covariance analysis of heart transplant survival data (1977) J Am Stat; 72, 27--36.
    """,

    "ovarian" => """
    (description and data drawn directly from the `survival package in R`)
    `futime`: survival or censoring time
    `fustat`: censoring status
    `age`: in years
    `resid_ds`: residual disease present (1=no,2=yes)
    `rx`: treatment group
    `ecog_ps`: ECOG performance status (1 is better, see reference)
    Source
    Terry Therneau
    
    References
    Edmunson, J.H., Fleming, T.R., Decker, D.G., Malkasian, G.D., Jefferies, J.A., Webb, M.J., and Kvols, L.K., Different Chemotherapeutic Sensitivities and Host Factors Affecting Prognosis in Advanced Ovarian Carcinoma vs. Minimal Residual Disease. Cancer Treatment Reports, 63:241-47, 1979.
"""
)
data[kwargs...], description[kwargs...]
end


