Title: | One-Sample Log-Rank Test |
---|---|
Description: | The log-rank test is performed to assess the survival outcomes between two group. When there is no proper control group or obtaining such data is cumbersome, one sample log-rank test can be applied. This package performs one sample log-rank test as described in Finkelstein et al. (2003)<doi:10.1093/jnci/djt227> and variation of the test for small sample sizes which is detailed in FD Liddell (1984)<doi:10.1136/jech.38.1.85> paper. Visualization function in the package generates Kaplan-Meier Curve comparing survival curve of the general population against that of the population of interest. |
Authors: | Divy Kangeyan [aut, cre], Jin Xie [aut] |
Maintainer: | Divy Kangeyan <[email protected]> |
License: | GPL (>= 3) |
Version: | 0.9.2 |
Built: | 2025-03-05 05:34:36 UTC |
Source: | https://github.com/cran/OneSampleLogRankTest |
This data set contains mortality rate for various demographic groups by age. all column has overall mortality rate for all groups. Race groups are indicated by the following notation: w - white, b - black, ai - american indian and as - asian. Female and Males are indicated by an additional suffix _f and _m.
dataPop_1999_2020
dataPop_1999_2020
A dataframe with 16 columns and 151 rows.
CDC Wonder Database. Data Colleceted from 1999 - 2020
https://wonder.cdc.gov/
This data set contains mortality rate for various demographic groups by age. all column has overall mortality rate for all groups. Race groups are indicated by the following notation: w - white, b - black, ai - american indian and as - asian, nh - native hawaiian. Female and Males are indicated by an additional suffix _f and _m.
dataPop_2018_2021
dataPop_2018_2021
A dataframe with 19 columns and 151 rows.
CDC Wonder Database. Data Colleceted from 2018_2021
https://wonder.cdc.gov/
This data set contains mortality rate for various demographic groups by age. all column has overall mortality rate for all groups. Race groups are indicated by the following notation: w - white, b - black, ai - american indian and as - asian, nh - native hawaiian. Female and Males are indicated by an additional suffix _f and _m.
dataPop_2018_2021
dataPop_2018_2021
A dataframe with 16 columns and 151 rows.
CDC Wonder Database. Data Colleceted from 2018_2021
https://wonder.cdc.gov/
This data set is obtained from Finkelstein et al. paper that contains the following five columns: age, time, event status, sex and race.
dataSurv
dataSurv
A dataframe with 5 columns and 33 rows.
Finkelstein et al. (2003)
Finkelstein, D. M., Muzikansky, A., & Schoenfeld, D. A. (2003). Comparing survival of a sample to that of a standard population. Journal of the National Cancer Institute, 95(19), 1434-1439.
This data set is subset of data obtained from Finkelstein et al. paper that contains the following five columns: age, time, event status, sex and race. In order to apply the exact test 12 patients were randomly selected out of 33 patients.
dataSurv
dataSurv
A dataframe with 5 columns and 12 rows.
Finkelstein et al. (2003)
Finkelstein, D. M., Muzikansky, A., & Schoenfeld, D. A. (2003). Comparing survival of a sample to that of a standard population. Journal of the National Cancer Institute, 95(19), 1434-1439.
Find Matched Cumulative Survival Probability
findMatchedCumuSurvProb(time, ageDiag, sex, race, dataPop, maxFollowUp = NULL)
findMatchedCumuSurvProb(time, ageDiag, sex, race, dataPop, maxFollowUp = NULL)
time |
follow up length |
ageDiag |
age at diagnosis |
sex |
sex |
race |
race |
dataPop |
Population level mortality data |
maxFollowUp |
maximum follow-up, if max follow-up not provided then the time would be considered until death or censoring |
matched survival probability
# load data data(dataSurv_small) data(dataPop_2018_2021) # Extract info for the first subject time_vec <- dataSurv_small$time[1] age_vec <- dataSurv_small$age[1] sex_vec <- dataSurv_small$sex[1] race_vec <- dataSurv_small$race[1] # Generate cumulative survival probability findMatchedCumuSurvProb(time = time_vec, ageDiag = age_vec, sex = sex_vec, race = race_vec, dataPop = dataPop_2018_2021) #If maximum followup is determined to be 20 years findMatchedCumuSurvProb(time = time_vec, ageDiag = age_vec, sex = sex_vec, race = race_vec, dataPop = dataPop_2018_2021, maxFollowUp = 20)
# load data data(dataSurv_small) data(dataPop_2018_2021) # Extract info for the first subject time_vec <- dataSurv_small$time[1] age_vec <- dataSurv_small$age[1] sex_vec <- dataSurv_small$sex[1] race_vec <- dataSurv_small$race[1] # Generate cumulative survival probability findMatchedCumuSurvProb(time = time_vec, ageDiag = age_vec, sex = sex_vec, race = race_vec, dataPop = dataPop_2018_2021) #If maximum followup is determined to be 20 years findMatchedCumuSurvProb(time = time_vec, ageDiag = age_vec, sex = sex_vec, race = race_vec, dataPop = dataPop_2018_2021, maxFollowUp = 20)
Calculate One-Sample Log-Rank Test
oneSampleLogRankTest(dataSurv, dataPop, type = c("exact", "approximate"))
oneSampleLogRankTest(dataSurv, dataPop, type = c("exact", "approximate"))
dataSurv |
Survival data |
dataPop |
Population data |
type |
Type of test |
p-value for one-sample log-rank test
# load data data(dataSurv_small) data(dataPop_2018_2021) # Since the dataset is small run an exact test oneSampleLogRankTest(dataSurv_small, dataPop_2018_2021, type = "exact")
# load data data(dataSurv_small) data(dataPop_2018_2021) # Since the dataset is small run an exact test oneSampleLogRankTest(dataSurv_small, dataPop_2018_2021, type = "exact")
Plot Kaplan-Meier Curve against Population
plotKM(dataSurv, dataPop, type = c("exact", "approximate"))
plotKM(dataSurv, dataPop, type = c("exact", "approximate"))
dataSurv |
Survival data |
dataPop |
Population data |
type |
Type of test to conduct in order to display p-value |
ggplot object
# load data data(dataSurv_small) data(dataPop_2018_2021) plotKM(dataSurv_small, dataPop_2018_2021, type = "exact")
# load data data(dataSurv_small) data(dataPop_2018_2021) plotKM(dataSurv_small, dataPop_2018_2021, type = "exact")
This data is simulated data from clinical trial data that contains five columns: race, sex, age, event status and time in years.
simulated_clinical_data
simulated_clinical_data
A dataframe with 5 columns and 500 rows.
Simulated
None