Skip to content

Commit

Permalink
including FDR correction
Browse files Browse the repository at this point in the history
  • Loading branch information
erikdrysdale committed Jan 6, 2022
1 parent 0a1865d commit f002cb9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions gen_individualized.R
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ surv_dist = pm_surv(bhat=X_row$bhat, Sigma = Sigma, Eta=exp(lst_cox$eta),
Y = lst_cox$y, x=matrix(X_row$x_s,nrow=1),
nsim = 1000,alpha = 0.05)

surv_dist %>% filter(time == 24)


# --- (4) PLOT IT --- #
gg_km = ggplot(surv_dist,aes(x=time,y=mu)) +
Expand Down
4 changes: 3 additions & 1 deletion run_model.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ for (pp in pckgs) { library(pp,character.only = T)}
user <- str_split(getwd(),'\\/')[[1]][3]
stopifnot(user %in% c('erik drysdale','lauren edrman'))
if (user == 'erik drysdale') {
dir_base <- "C:/Users/erik drysdale/Documents/projects/Pyeloplasty"
dir_base <- "C:/Users/erik drysdale/Documents/projects/urology/Pyeloplasty"
} else {
dir_base <- "C:/Users/lauren erdman/Desktop/pyloplasty"
}
Expand All @@ -27,6 +27,7 @@ auroc <- function(score,y){

source('funs_support.R')


###########################################
# --------- (1) LOAD THE DATA ----------- #

Expand Down Expand Up @@ -142,6 +143,7 @@ SI_cure <- fixedLassoInf(x=X_cure_s,y=y_cure,
lambda = lam_best*nrow(X_cure))
bhat_cure <- tibble(cn=names(SI_cure$vars),coef=SI_cure$coef0,
pval=SI_cure$pv,lb=SI_cure$ci[,1],ub=SI_cure$ci[,2])
bhat_cure %>% mutate(p_adj=p.adjust(pval,method='fdr')) %>% arrange(p_adj)
bhat_cure %>% filter(pval < 0.05)
# Scale Xmat using cure params
Xmat_scure <- sweep(sweep(Xmat[,colnames(X_cure_s)],2,mu_X_cure,'-'),2,se_X_cure,'/')
Expand Down

0 comments on commit f002cb9

Please sign in to comment.