knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
library(OneSampleLogRankTest)
Log-rank test is a popular hypothesis test used to compared survival distribution between two groups. When there are no control or comparator group or obtaining such group is difficult, it is suitable to compare survival outcomes to a demographically- matched reference population. In this package we present existing methods to conduct such test named one sample log rank test.
Approximate one sample log rank test based on Chi-squared distribution can be applied to larger sample sizes (above 20 samples). oneSampleLogRankTest function would output Standardized Mortality Ratio (SMR), p-value and confidence interval around SMR. Statistical test is conducted based on Finkelstein et al. (2003) paper.
data(dataSurv, package = "OneSampleLogRankTest") data(dataPop_2018_2021_race_sex_eth, package = "OneSampleLogRankTest") ## approximate one sample log rank test oneSampleLogRankTest(dataSurv, dataPop_2018_2021_race_sex_eth, type = "approximate")
Mortality rate in the sample of interest is 1.531 times that in the general population and it is not significantly different from the general population.
Kaplan-Meier curve is a useful visualization tool to compared the survival outcome in the population of interest and the general population. Type of test would be one of the argument in this function and the p-value would be displayed accordingly.
plotKM(dataSurv, dataPop_2018_2021_race_sex_eth, type = "approximate")
For a small sample set and exact test would be applied as described in F D Liddel (1984) paper.
data(dataSurv_small, package = "OneSampleLogRankTest") ## exact test version of one sample log rank test for small sample size oneSampleLogRankTest(dataSurv_small, dataPop_2018_2021_race_sex_eth)
In the small data set, mortality ratio is significantly higher compared to the general population and it is about 3.3 fold higher.
plotKM(dataSurv_small, dataPop_2018_2021_race_sex_eth, type = "exact")
A simulated data set with 500 patients were generated based on sex, race, age, and survival time distribution based on real clinical trial data. Female to male ratio was 30:70 and there were four different race groups: Asian, Black, Other / More than one race and White.
This simulated clinical trial data will be compared against CDC Wonder database data to assess if the survival outcomes are comparable or significantly different between this population and general population.
data(simulated_clinical_data) oneSampleLogRankTest(simulated_clinical_data, dataPop_2018_2021_race_sex_eth, type = "approximate")
In the simulated clinical trial, the mortality ratio is around 9.42 times that of general population and it is highly significant.
plotKM(simulated_clinical_data, dataPop_2018_2021_race_sex_eth, type = "approximate")
Kaplan-Meir curve clearly shows that the simulated patient population is different from the general population.
sessionInfo()
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.