Description Usage Arguments Value Examples
View source: R/surv_calc_scores_stats.R
An adaptation of GBJ::calc_scores_stats()
to survival context.
Wrapper of sGBJ_scores() function.
1 | surv_calc_scores_stats(null_model, factor_matrix, nperm = 300)
|
null_model |
An R cox model fitted with |
factor_matrix |
An |
nperm |
Number of permutations (default is 300) |
A list with the elements:
test_stats |
The |
cor_mat |
The |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | n <- 100
surv_data <- data.frame(Time = runif(n = n, min = 0, max = 100),
event = rbinom(n = n, size = 1, prob = 0.5))
surv <- survival::Surv(time = surv_data$Time, event = surv_data$event)
factor_matrix <- data.frame(P1 = rnorm(n = n),
P2 = rnorm(n = n))
covariates <- data.frame(age = runif(n = n, 60, 90))
null_model <- survival::coxph(surv ~ age, data = covariates, x = TRUE)
surv_reg_stats <- surv_calc_scores_stats(null_model = null_model,
factor_matrix = factor_matrix,
nperm = 2)#nperm = 300)
GBJ::GBJ(test_stats=surv_reg_stats$test_stats, cor_mat=surv_reg_stats$cor_mat)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.