Skip to content

Commit

Permalink
first upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Bioinfoplanet committed Jul 15, 2020
1 parent aba3752 commit fa7ee53
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion R/survival_cut_cox_km.R
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ surv_cox <-function(exprSet_hub,meta,cut.point = F,pvalue_cutoff = 0.05,HRkeep =
}else{
meta$group=ifelse(gene>median(gene),'high','low')
}
meta$group = factor(meta$group,levels = c("low","high"))
m=survival::coxph(survival::Surv(time, event) ~ group, data = meta)

beta <- coef(m)
Expand All @@ -110,7 +111,7 @@ surv_cox <-function(exprSet_hub,meta,cut.point = F,pvalue_cutoff = 0.05,HRkeep =
HRz = (HR - 1) / HRse, HRp = 1 - pchisq(((HR - 1)/HRse)^2, 1),
HRCILL = exp(beta - qnorm(.975, 0, 1) * se),
HRCIUL = exp(beta + qnorm(.975, 0, 1) * se)), 3)
cox_results[[i]] = tmp['grouplow',]
cox_results[[i]] = tmp['grouphigh',]
}
cox_results = do.call(cbind,cox_results)
cox_results=t(cox_results)
Expand Down

0 comments on commit fa7ee53

Please sign in to comment.