Last updated: 2023-02-21
Checks: 6 1
Knit directory: survival-susie/
This reproducible R Markdown analysis was created with workflowr (version 1.6.2). The Checks tab describes the reproducibility checks that were applied when the results were created. The Past versions tab lists the development history.
Great! Since the R Markdown file has been committed to the Git repository, you know the exact version of the code that produced these results.
Great job! The global environment was empty. Objects defined in the global environment can affect the analysis in your R Markdown file in unknown ways. For reproduciblity it’s best to always run the code in an empty environment.
The command set.seed(20230201)
was run prior to running the code in the R Markdown file. Setting a seed ensures that any results that rely on randomness, e.g. subsampling or permutations, are reproducible.
Great job! Recording the operating system, R version, and package versions is critical for reproducibility.
To ensure reproducibility of the results, delete the cache directory run_ser_simple_dat_cache
and re-run the analysis. To have workflowr automatically delete the cache directory prior to building the file, set delete_cache = TRUE
when running wflow_build()
or wflow_publish()
.
Great job! Using relative paths to the files within your workflowr project makes it easier to run your code on other machines.
Great! You are using Git for version control. Tracking code development and connecting the code version to the results is critical for reproducibility.
The results in this page were generated with repository version eecfb7f. See the Past versions tab to see a history of the changes made to the R Markdown and HTML files.
Note that you need to be careful to ensure that all relevant files for the analysis have been committed to Git prior to generating the results (you can use wflow_publish
or wflow_git_commit
). workflowr only checks the R Markdown file, but you know if there are other scripts or data files that it depends on. Below is the status of the Git repository when the results were generated:
Ignored files:
Ignored: .DS_Store
Ignored: .Rhistory
Ignored: .Rproj.user/
Ignored: analysis/.DS_Store
Ignored: analysis/.RData
Ignored: analysis/.Rhistory
Ignored: analysis/run_ser_simple_dat_cache/
Untracked files:
Untracked: analysis/ibss_null_model.Rmd
Unstaged changes:
Modified: analysis/check_coxph_fit.Rmd
Deleted: analysis/null_model_demo.Rmd
Modified: analysis/null_model_zscore.Rmd
Deleted: analysis/one_predictor_investigation.Rmd
Note that any generated files, e.g. HTML, png, CSS, etc., are not included in this status report because it is ok for generated content to have uncommitted changes.
These are the previous versions of the repository in which changes were made to the R Markdown (analysis/run_ser_simple_dat.Rmd
) and HTML (docs/run_ser_simple_dat.html
) files. If you’ve configured a remote Git repository (see ?wflow_git_remote
), click on the hyperlinks in the table below to view the files as they were in that past version.
File | Version | Author | Date | Message |
---|---|---|---|---|
Rmd | eecfb7f | yunqiyang0215 | 2023-02-21 | wflow_publish("analysis/run_ser_simple_dat.Rmd") |
html | 7a533c6 | yunqiyang0215 | 2023-02-21 | Build site. |
Rmd | afa4e95 | yunqiyang0215 | 2023-02-21 | wflow_publish("analysis/run_ser_simple_dat.Rmd") |
html | 69498d8 | yunqiyang0215 | 2023-02-16 | Build site. |
Rmd | 7f7cab7 | yunqiyang0215 | 2023-02-16 | wflow_publish("analysis/run_ser_simple_dat.Rmd") |
html | 8f08853 | yunqiyang0215 | 2023-02-15 | Build site. |
Rmd | 0b9d885 | yunqiyang0215 | 2023-02-15 | wflow_publish("analysis/run_ser_simple_dat.Rmd") |
html | fa55cee | yunqiyang0215 | 2023-02-15 | Build site. |
Rmd | 2aab4d2 | yunqiyang0215 | 2023-02-15 | wflow_publish("analysis/run_ser_simple_dat.Rmd") |
html | 973f023 | yunqiyang0215 | 2023-02-13 | Build site. |
Rmd | cfd4df5 | yunqiyang0215 | 2023-02-13 | wflow_publish("analysis/run_ser_simple_dat.Rmd") |
html | b407f93 | yunqiyang0215 | 2023-02-12 | Build site. |
Rmd | 4f242bd | yunqiyang0215 | 2023-02-12 | wflow_publish("analysis/run_ser_simple_dat.Rmd") |
html | d7a14e4 | yunqiyang0215 | 2023-02-12 | Build site. |
Rmd | a70c34c | yunqiyang0215 | 2023-02-12 | wflow_publish("analysis/run_ser_simple_dat.Rmd") |
html | d16db2f | yunqiyang0215 | 2023-02-12 | Build site. |
Rmd | 4910cfc | yunqiyang0215 | 2023-02-12 | wflow_publish("analysis/run_ser_simple_dat.Rmd") |
html | 9d83f72 | yunqiyang0215 | 2023-02-12 | Build site. |
Rmd | 55b418b | yunqiyang0215 | 2023-02-12 | wflow_publish("analysis/run_ser_simple_dat.Rmd") |
html | b67c343 | yunqiyang0215 | 2023-02-09 | Build site. |
Rmd | b2b3b99 | yunqiyang0215 | 2023-02-09 | wflow_publish("analysis/run_ser_simple_dat.Rmd") |
html | 210cf66 | yunqiyang0215 | 2023-02-09 | Build site. |
Rmd | 2360f30 | yunqiyang0215 | 2023-02-09 | wflow_publish("analysis/run_ser_simple_dat.Rmd") |
html | cc386a1 | yunqiyang0215 | 2023-02-09 | Build site. |
Rmd | 4f1c5c3 | yunqiyang0215 | 2023-02-09 | wflow_publish("analysis/run_ser_simple_dat.Rmd") |
html | ba5113f | yunqiyang0215 | 2023-02-09 | Build site. |
Rmd | 4e06f27 | yunqiyang0215 | 2023-02-09 | wflow_publish("analysis/run_ser_simple_dat.Rmd") |
I simulated data in 4 different scenarios, and apply both coxph model and susie procedure. The data simulation procedure is available at https://yunqiyang0215.github.io/survival-susie/sim_survival.html
Susie works in 1,2,4 scenarios, but not scenario 3.
\[ ABF(H_1/H_0)=\sqrt\frac{V}{V+W}\exp\{\frac{z^2}{2}\frac{W}{V+W}\}, \] where \(V\) is the variance of estimated regression coefficient, and \(W\) is variance in the normal prior, \(N(0,W)\).
# Function to calculate approximate BF based on Wakefield approximation
# @param z: zscore of the regression coefficient
# @param s: standard deviation of the estimated coefficient
compute_abf <- function(z, s, prior_variance){
abf <- sqrt(s^2/(s^2+prior_variance))*exp(z^2/2*(prior_variance/(s^2+prior_variance)))
return(abf)
}
compute_approx_post_var <- function(z, s, prior_variance){
post_var <- 1/(1/s^2 + 1/prior_variance)
return(post_var)
}
# @param post_var: posterior variance
# @param s: standard deviation of the estimated coefficient
# @param bhat: estimated beta effect
compute_approx_post_mean <- function(post_var, s, bhat){
mu <- post_var/(s^2)*bhat
return(mu)
}
dat = readRDS("./data/sim_dat_simple.rds")
library(survival)
# Modified Karl's code for intercept part
devtools::load_all("/Users/nicholeyang/Desktop/logisticsusie")
ℹ Loading logisticsusie
surv_uni_fun <- function(x, y, o, prior_variance, estimate_intercept = 0, ...){
fit <- coxph(y~ x + offset(o))
bhat <- summary(fit)$coefficients[1, 1] # bhat = -alphahat
sd <- summary(fit)$coefficients[1, 3]
zscore <- bhat/sd
bf <- compute_abf(zscore, sd, prior_variance)
var <- compute_approx_post_var(zscore, sd, prior_variance)
mu <- compute_approx_post_mean(var, sd, bhat)
lbf <- log(bf)
return(list(mu = mu, var=var, lbf=lbf, intercept=0))
}
fit_coxph <- ser_from_univariate(surv_uni_fun)
\(\log T_i =\beta_0+\epsilon_i\) and \(\beta_0 = 1\).
## Create survival object. status == 2 is death
dat[[1]]$y <- with(dat[[1]], Surv(surT, status == 2))
# Fit cox ph. Cox ph model with select multiple significant predictors..
cox1 <- coxph(y ~ .-status - surT, data = dat[[1]])
p = 50
X = as.matrix(dat[[1]][, c(2:(p+1))])
y = dat[[1]]$y
# IBSS of susie
set.seed(1)
fit1 <- ibss_from_ser(X, y, L = 1, prior_variance = 1., prior_weights = rep(1/p, p), tol = 1e-3, maxit = 500, estimate_intercept = TRUE, ser_function = fit_coxph)
0.602 sec elapsed
par(mfrow = c(1,2))
hist(fit1$alpha, breaks = 20)
hist(fit1$mu* fit1$alpha, breaks = 20)
# IBSS of susie
t1 <- proc.time()
fit2 <- ibss_from_ser(X, y, L = 5, prior_variance = 1., prior_weights = rep(1/p, p), tol = 1e-3, maxit = 50, estimate_intercept = TRUE, ser_function = fit_coxph)
6.5 sec elapsed
t2 <- proc.time()
t(apply(fit2$alpha, 1, function(x) sort(x, decreasing = TRUE)))
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] 0.05609322 0.04032955 0.03492124 0.03336796 0.03314579 0.03097663
[2,] 0.02896932 0.02623430 0.02481716 0.02286828 0.02282500 0.02269597
[3,] 0.02745036 0.02469365 0.02337122 0.02308924 0.02272713 0.02198974
[4,] 0.02796014 0.02430599 0.02331861 0.02310070 0.02252764 0.02223497
[5,] 0.02799527 0.02427965 0.02333430 0.02308225 0.02251404 0.02225175
[,7] [,8] [,9] [,10] [,11] [,12]
[1,] 0.03080564 0.03034312 0.03024764 0.02753592 0.02542502 0.02455909
[2,] 0.02266410 0.02265191 0.02216320 0.02197107 0.02131879 0.02120126
[3,] 0.02126563 0.02118921 0.02104036 0.02098470 0.02094191 0.02087132
[4,] 0.02156076 0.02124952 0.02111598 0.02102838 0.02077182 0.02068683
[5,] 0.02158102 0.02126382 0.02112493 0.02101741 0.02076020 0.02067426
[,13] [,14] [,15] [,16] [,17] [,18]
[1,] 0.02370002 0.02311701 0.02208584 0.02195033 0.02169923 0.02162388
[2,] 0.02095127 0.02078628 0.02065878 0.02038459 0.02014915 0.02011939
[3,] 0.02051121 0.02044395 0.02033894 0.02032515 0.02028252 0.02012283
[4,] 0.02046062 0.02040317 0.02031091 0.02030855 0.02027867 0.02015906
[5,] 0.02046893 0.02041141 0.02030988 0.02029474 0.02026738 0.02016380
[,19] [,20] [,21] [,22] [,23] [,24]
[1,] 0.02106625 0.01894784 0.01883752 0.01854216 0.01823958 0.01783465
[2,] 0.01992669 0.01978913 0.01961306 0.01954943 0.01945667 0.01931688
[3,] 0.02008913 0.02006092 0.01998112 0.01993821 0.01980109 0.01952122
[4,] 0.02001577 0.01990919 0.01987853 0.01983631 0.01965239 0.01957681
[5,] 0.02000845 0.01990424 0.01986610 0.01982932 0.01964224 0.01958364
[,25] [,26] [,27] [,28] [,29] [,30]
[1,] 0.01775138 0.01741396 0.01672260 0.01639646 0.01609113 0.01517470
[2,] 0.01931072 0.01928345 0.01925305 0.01909494 0.01909311 0.01907063
[3,] 0.01947655 0.01943566 0.01941398 0.01936334 0.01934717 0.01929358
[4,] 0.01955838 0.01944712 0.01943737 0.01943675 0.01936155 0.01931401
[5,] 0.01956089 0.01944788 0.01944720 0.01944172 0.01935795 0.01931977
[,31] [,32] [,33] [,34] [,35] [,36]
[1,] 0.01499459 0.01499112 0.01466262 0.01432951 0.01419841 0.01383754
[2,] 0.01902290 0.01894060 0.01865592 0.01854349 0.01842011 0.01840300
[3,] 0.01922937 0.01920149 0.01909674 0.01903267 0.01900058 0.01890968
[4,] 0.01926617 0.01919231 0.01909377 0.01901204 0.01899055 0.01896307
[5,] 0.01926059 0.01919166 0.01909792 0.01901901 0.01898327 0.01896540
[,37] [,38] [,39] [,40] [,41] [,42]
[1,] 0.01371178 0.01339826 0.01338319 0.01334452 0.01326245 0.01324939
[2,] 0.01836541 0.01835444 0.01832318 0.01831466 0.01821466 0.01819967
[3,] 0.01889245 0.01885691 0.01880577 0.01874234 0.01856491 0.01851308
[4,] 0.01896075 0.01891510 0.01873787 0.01863618 0.01858348 0.01854783
[5,] 0.01896046 0.01891904 0.01873321 0.01862890 0.01858471 0.01855017
[,43] [,44] [,45] [,46] [,47] [,48]
[1,] 0.01239763 0.01239286 0.01189832 0.01171859 0.01082499 0.01053711
[2,] 0.01816079 0.01810006 0.01794403 0.01793372 0.01782749 0.01781656
[3,] 0.01850820 0.01848166 0.01845963 0.01831789 0.01817668 0.01805154
[4,] 0.01851871 0.01850763 0.01845904 0.01828050 0.01823954 0.01803063
[5,] 0.01851940 0.01851089 0.01845746 0.01828759 0.01823417 0.01802917
[,49] [,50]
[1,] 0.009008596 0.008913122
[2,] 0.017161011 0.017110724
[3,] 0.017917187 0.017880153
[4,] 0.017988391 0.017869995
[5,] 0.017993240 0.017869278
Warning: The above code chunk cached its results, but it won’t be re-run if previous chunks it depends on are updated. If you need to use caching, it is highly recommended to also set knitr::opts_chunk$set(autodep = TRUE)
at the top of the file (in a chunk that is not cached). Alternatively, you can customize the option dependson
for each individual chunk that is cached. Using either autodep
or dependson
will remove this warning. See the knitr cache options for more details.
beta <- colSums(fit2$alpha * fit2$mu)
hist(beta, breaks = 20)
\(\beta_0 = 1, \beta_1 = 3\)
dat[[2]]$y <- with(dat[[2]], Surv(surT, status == 2))
X = as.matrix(dat[[2]][, c(2:(p+1))])
y = dat[[2]]$y
# IBSS of susie
t1 <- proc.time()
fit2 <- ibss_from_ser(X, y, L = 5, prior_variance = 1., prior_weights = rep(1/p, p), tol = 1e-3, maxit = 500, estimate_intercept = TRUE, ser_function = fit_coxph)
5.843 sec elapsed
t2 <- proc.time()
t2 - t1
user system elapsed
5.579 0.101 5.900
Warning: The above code chunk cached its results, but it won’t be re-run if previous chunks it depends on are updated. If you need to use caching, it is highly recommended to also set knitr::opts_chunk$set(autodep = TRUE)
at the top of the file (in a chunk that is not cached). Alternatively, you can customize the option dependson
for each individual chunk that is cached. Using either autodep
or dependson
will remove this warning. See the knitr cache options for more details.
fit2$alpha
[,1] [,2] [,3] [,4] [,5]
[1,] 1.00000000 2.307716e-25 7.411530e-25 1.364349e-25 1.378772e-25
[2,] 0.04292694 1.186338e-02 2.799609e-02 1.203703e-02 1.555158e-02
[3,] 0.04292983 1.186381e-02 2.799437e-02 1.203744e-02 1.555229e-02
[4,] 0.04293056 1.186391e-02 2.799435e-02 1.203752e-02 1.555240e-02
[5,] 0.04292941 1.186371e-02 2.799521e-02 1.203733e-02 1.555207e-02
[,6] [,7] [,8] [,9] [,10]
[1,] 1.274855e-25 1.394375e-25 1.440577e-25 2.041674e-25 1.271053e-25
[2,] 1.231117e-02 2.285562e-02 2.032461e-02 2.102240e-02 1.836279e-02
[3,] 1.231149e-02 2.285620e-02 2.032511e-02 2.102288e-02 1.836289e-02
[4,] 1.231157e-02 2.285623e-02 2.032525e-02 2.102311e-02 1.836299e-02
[5,] 1.231143e-02 2.285592e-02 2.032503e-02 2.102291e-02 1.836296e-02
[,11] [,12] [,13] [,14] [,15]
[1,] 1.270159e-25 1.282280e-25 1.315745e-25 1.133932e-25 1.193168e-25
[2,] 7.315552e-02 1.591384e-02 1.347406e-02 4.542299e-02 1.040702e-02
[3,] 7.314127e-02 1.591454e-02 1.347450e-02 4.543055e-02 1.040733e-02
[4,] 7.313721e-02 1.591463e-02 1.347458e-02 4.543086e-02 1.040740e-02
[5,] 7.314364e-02 1.591430e-02 1.347439e-02 4.542696e-02 1.040726e-02
[,16] [,17] [,18] [,19] [,20]
[1,] 1.268907e-25 2.277648e-25 3.677275e-25 1.637013e-25 1.343948e-25
[2,] 1.495222e-02 1.127507e-02 1.213458e-02 1.553421e-02 1.255682e-02
[3,] 1.495291e-02 1.127545e-02 1.213500e-02 1.553447e-02 1.255730e-02
[4,] 1.495300e-02 1.127553e-02 1.213507e-02 1.553453e-02 1.255739e-02
[5,] 1.495267e-02 1.127536e-02 1.213489e-02 1.553442e-02 1.255717e-02
[,21] [,22] [,23] [,24] [,25]
[1,] 1.567569e-25 1.655280e-25 1.442488e-25 1.158482e-25 2.546165e-25
[2,] 1.473564e-02 1.400340e-02 1.576270e-02 1.254437e-02 1.556932e-02
[3,] 1.473622e-02 1.400388e-02 1.576297e-02 1.254491e-02 1.556980e-02
[4,] 1.473639e-02 1.400398e-02 1.576308e-02 1.254505e-02 1.556989e-02
[5,] 1.473612e-02 1.400376e-02 1.576296e-02 1.254481e-02 1.556968e-02
[,26] [,27] [,28] [,29] [,30]
[1,] 1.629070e-25 1.160590e-25 1.728822e-25 1.318097e-25 1.442441e-25
[2,] 1.671226e-02 1.151320e-02 1.592331e-02 1.909934e-02 1.350350e-02
[3,] 1.671323e-02 1.151358e-02 1.592358e-02 1.909905e-02 1.350396e-02
[4,] 1.671339e-02 1.151366e-02 1.592362e-02 1.909903e-02 1.350404e-02
[5,] 1.671294e-02 1.151349e-02 1.592350e-02 1.909917e-02 1.350383e-02
[,31] [,32] [,33] [,34] [,35]
[1,] 1.248397e-25 2.453707e-25 3.780222e-25 1.546542e-25 1.318572e-25
[2,] 1.268569e-02 2.897596e-02 1.361216e-02 1.530646e-02 2.093614e-02
[3,] 1.268614e-02 2.897633e-02 1.361263e-02 1.530710e-02 2.093680e-02
[4,] 1.268623e-02 2.897630e-02 1.361266e-02 1.530726e-02 2.093680e-02
[5,] 1.268603e-02 2.897610e-02 1.361242e-02 1.530697e-02 2.093646e-02
[,36] [,37] [,38] [,39] [,40]
[1,] 6.916937e-25 9.750268e-26 1.307822e-25 2.011690e-25 1.501407e-25
[2,] 2.134703e-02 1.161268e-02 1.756904e-02 1.390547e-02 1.632848e-02
[3,] 2.134732e-02 1.161312e-02 1.757048e-02 1.390593e-02 1.632902e-02
[4,] 2.134741e-02 1.161318e-02 1.757071e-02 1.390602e-02 1.632913e-02
[5,] 2.134731e-02 1.161298e-02 1.757003e-02 1.390581e-02 1.632889e-02
[,41] [,42] [,43] [,44] [,45]
[1,] 1.222045e-25 1.801522e-25 1.440586e-25 1.505744e-25 1.226334e-25
[2,] 1.618001e-02 1.313164e-02 6.208979e-02 1.230718e-02 3.292905e-02
[3,] 1.618063e-02 1.313214e-02 6.207667e-02 1.230761e-02 3.293183e-02
[4,] 1.618072e-02 1.313225e-02 6.207589e-02 1.230769e-02 3.293201e-02
[5,] 1.618042e-02 1.313204e-02 6.208229e-02 1.230749e-02 3.293060e-02
[,46] [,47] [,48] [,49] [,50]
[1,] 1.893290e-25 1.236505e-25 1.410184e-25 7.540486e-25 2.087607e-25
[2,] 4.334369e-02 1.297647e-02 1.982894e-02 2.130821e-02 1.418095e-02
[3,] 4.333981e-02 1.297698e-02 1.982963e-02 2.130754e-02 1.418150e-02
[4,] 4.333966e-02 1.297707e-02 1.982971e-02 2.130749e-02 1.418160e-02
[5,] 4.334149e-02 1.297684e-02 1.982936e-02 2.130783e-02 1.418135e-02
beta <- colSums(fit2$alpha * fit2$mu)
hist(beta, breaks = 20)
dat[[3]]$y <- with(dat[[3]], Surv(surT, status == 2))
X = as.matrix(dat[[3]][, c(2:(p+1))])
y = dat[[3]]$y
# IBSS of susie
t1 <- proc.time()
fit3 <- ibss_from_ser(X, y, L = 5, prior_variance = 1., prior_weights = rep(1/p, p), tol = 1e-3, maxit = 500, estimate_intercept = TRUE, ser_function = fit_coxph)
15.182 sec elapsed
t2 <- proc.time()
t2 - t1
user system elapsed
12.794 0.264 15.198
t(apply(fit3$alpha, 1, function(x) sort(x, decreasing = TRUE)))
[,1] [,2] [,3] [,4] [,5]
[1,] 0.99986965 4.136298e-05 4.104706e-05 1.915872e-05 8.894234e-06
[2,] 0.04011044 3.005711e-02 2.690318e-02 2.654547e-02 2.556933e-02
[3,] 0.04157315 2.930629e-02 2.703757e-02 2.603876e-02 2.600848e-02
[4,] 0.03696112 3.178081e-02 2.925385e-02 2.544157e-02 2.452026e-02
[5,] 0.03425956 3.288860e-02 3.287825e-02 2.464801e-02 2.391154e-02
[,6] [,7] [,8] [,9] [,10]
[1,] 6.642297e-06 5.494192e-06 1.702179e-06 1.002326e-06 7.036141e-07
[2,] 2.549146e-02 2.508731e-02 2.405777e-02 2.338434e-02 2.226460e-02
[3,] 2.592096e-02 2.556921e-02 2.451164e-02 2.380416e-02 2.265399e-02
[4,] 2.433410e-02 2.400936e-02 2.303727e-02 2.270160e-02 2.244892e-02
[5,] 2.307498e-02 2.273596e-02 2.252341e-02 2.252128e-02 2.161827e-02
[,11] [,12] [,13] [,14] [,15]
[1,] 6.766364e-07 5.960689e-07 5.140254e-07 3.959313e-07 3.826679e-07
[2,] 2.140634e-02 2.138452e-02 2.055655e-02 2.009172e-02 1.999360e-02
[3,] 2.161356e-02 2.081940e-02 2.081786e-02 2.019267e-02 1.962927e-02
[4,] 2.138739e-02 2.103059e-02 2.091528e-02 1.995622e-02 1.985105e-02
[5,] 2.116558e-02 2.112074e-02 2.083334e-02 2.021565e-02 2.017466e-02
[,16] [,17] [,18] [,19] [,20]
[1,] 2.934595e-07 2.444224e-07 1.713643e-07 1.517155e-07 1.397109e-07
[2,] 1.954806e-02 1.952036e-02 1.942617e-02 1.930895e-02 1.912646e-02
[3,] 1.961999e-02 1.954192e-02 1.950099e-02 1.949585e-02 1.919763e-02
[4,] 1.959289e-02 1.937419e-02 1.936887e-02 1.930050e-02 1.925443e-02
[5,] 2.016384e-02 1.948479e-02 1.933915e-02 1.909220e-02 1.907918e-02
[,21] [,22] [,23] [,24] [,25]
[1,] 1.360481e-07 1.296982e-07 9.392248e-08 7.139341e-08 5.703098e-08
[2,] 1.867244e-02 1.864432e-02 1.855068e-02 1.847495e-02 1.838000e-02
[3,] 1.881009e-02 1.853858e-02 1.842802e-02 1.838719e-02 1.835316e-02
[4,] 1.923710e-02 1.894578e-02 1.886790e-02 1.872295e-02 1.850146e-02
[5,] 1.892436e-02 1.883572e-02 1.883290e-02 1.874236e-02 1.864524e-02
[,26] [,27] [,28] [,29] [,30]
[1,] 4.009682e-08 3.930486e-08 2.651245e-08 2.497218e-08 2.304859e-08
[2,] 1.834848e-02 1.833844e-02 1.830613e-02 1.826313e-02 1.826281e-02
[3,] 1.826319e-02 1.823735e-02 1.821347e-02 1.818663e-02 1.810132e-02
[4,] 1.835433e-02 1.834315e-02 1.831643e-02 1.825185e-02 1.824077e-02
[5,] 1.854049e-02 1.834298e-02 1.822391e-02 1.821059e-02 1.820733e-02
[,31] [,32] [,33] [,34] [,35]
[1,] 2.272884e-08 1.677608e-08 1.352317e-08 1.338892e-08 1.239902e-08
[2,] 1.819833e-02 1.814234e-02 1.812143e-02 1.799278e-02 1.797794e-02
[3,] 1.806854e-02 1.805402e-02 1.804641e-02 1.799291e-02 1.795163e-02
[4,] 1.822718e-02 1.812593e-02 1.809853e-02 1.801765e-02 1.790576e-02
[5,] 1.811122e-02 1.806737e-02 1.806621e-02 1.806195e-02 1.806018e-02
[,36] [,37] [,38] [,39] [,40]
[1,] 9.515233e-09 8.495920e-09 6.910143e-09 5.402280e-09 4.465426e-09
[2,] 1.792216e-02 1.776625e-02 1.758140e-02 1.751661e-02 1.735864e-02
[3,] 1.782753e-02 1.769811e-02 1.757320e-02 1.747955e-02 1.720872e-02
[4,] 1.780908e-02 1.779736e-02 1.775942e-02 1.774160e-02 1.773031e-02
[5,] 1.804226e-02 1.802174e-02 1.793167e-02 1.791618e-02 1.783958e-02
[,41] [,42] [,43] [,44] [,45]
[1,] 4.425620e-09 3.932818e-09 2.873236e-09 2.857335e-09 2.641937e-09
[2,] 1.735184e-02 1.719088e-02 1.706006e-02 1.695498e-02 1.691129e-02
[3,] 1.718913e-02 1.693648e-02 1.686200e-02 1.682594e-02 1.672039e-02
[4,] 1.766149e-02 1.750260e-02 1.737158e-02 1.735684e-02 1.733606e-02
[5,] 1.780413e-02 1.778540e-02 1.767143e-02 1.759025e-02 1.753913e-02
[,46] [,47] [,48] [,49] [,50]
[1,] 1.222350e-09 1.075611e-09 6.611139e-10 4.946253e-10 3.088339e-10
[2,] 1.688266e-02 1.685215e-02 1.676987e-02 1.627919e-02 1.509408e-02
[3,] 1.668792e-02 1.667264e-02 1.664982e-02 1.624125e-02 1.494147e-02
[4,] 1.723302e-02 1.720847e-02 1.703353e-02 1.635244e-02 1.542918e-02
[5,] 1.744093e-02 1.738553e-02 1.712836e-02 1.642592e-02 1.587569e-02
Warning: The above code chunk cached its results, but it won’t be re-run if previous chunks it depends on are updated. If you need to use caching, it is highly recommended to also set knitr::opts_chunk$set(autodep = TRUE)
at the top of the file (in a chunk that is not cached). Alternatively, you can customize the option dependson
for each individual chunk that is cached. Using either autodep
or dependson
will remove this warning. See the knitr cache options for more details.
\(\beta_0 = 1, \beta_1 = 3, \beta_2 = 1.5\) and \(cor=0.9\).
dat[[4]]$y <- with(dat[[4]], Surv(surT, status == 2))
X = as.matrix(dat[[4]][, c(2:(p+1))])
y = dat[[4]]$y
# IBSS of susie
t1 <- proc.time()
fit4 <- ibss_from_ser(X, y, L = 5, prior_variance = 1., prior_weights = rep(1/p, p), tol = 1e-3, maxit = 500, estimate_intercept = TRUE, ser_function = fit_coxph)
8.496 sec elapsed
t2 <- proc.time()
t2 - t1
user system elapsed
7.849 0.145 8.499
Warning: The above code chunk cached its results, but it won’t be re-run if previous chunks it depends on are updated. If you need to use caching, it is highly recommended to also set knitr::opts_chunk$set(autodep = TRUE)
at the top of the file (in a chunk that is not cached). Alternatively, you can customize the option dependson
for each individual chunk that is cached. Using either autodep
or dependson
will remove this warning. See the knitr cache options for more details.
fit4$alpha
[,1] [,2] [,3] [,4] [,5]
[1,] 1.000000e+00 2.933205e-12 4.087642e-12 2.366477e-10 6.257578e-11
[2,] 1.850792e-05 9.943400e-01 1.385772e-05 3.700979e-05 1.013017e-05
[3,] 4.536854e-02 1.871102e-02 1.791956e-02 1.678350e-02 1.959784e-02
[4,] 4.555811e-02 1.873738e-02 1.783248e-02 1.678433e-02 1.950136e-02
[5,] 4.508341e-02 1.866958e-02 1.805353e-02 1.678148e-02 1.974599e-02
[,6] [,7] [,8] [,9] [,10]
[1,] 1.694674e-10 7.732188e-11 3.660192e-11 3.030459e-12 6.169283e-11
[2,] 3.731885e-05 9.823877e-06 1.015834e-05 2.212862e-05 6.528051e-04
[3,] 1.826711e-02 1.993589e-02 2.347674e-02 1.649439e-02 2.241567e-02
[4,] 1.830700e-02 1.981386e-02 2.330862e-02 1.643295e-02 2.248801e-02
[5,] 1.820522e-02 2.012350e-02 2.373685e-02 1.658883e-02 2.230418e-02
[,11] [,12] [,13] [,14] [,15]
[1,] 6.666085e-09 5.848923e-12 1.934489e-10 3.039833e-11 6.544899e-12
[2,] 4.385076e-04 9.447618e-06 4.810615e-04 3.495016e-06 3.581897e-05
[3,] 4.840652e-02 2.666774e-02 1.977692e-02 2.046824e-02 1.579463e-02
[4,] 4.887295e-02 2.644747e-02 1.980515e-02 2.034759e-02 1.575066e-02
[5,] 4.769422e-02 2.700837e-02 1.973304e-02 2.065309e-02 1.586157e-02
[,16] [,17] [,18] [,19] [,20]
[1,] 2.769809e-10 2.606908e-12 1.398502e-09 6.197536e-11 1.710988e-10
[2,] 2.398309e-04 1.466066e-04 2.843799e-05 6.826647e-05 1.077129e-04
[3,] 2.486840e-02 1.577565e-02 1.724187e-02 1.743459e-02 2.052182e-02
[4,] 2.500067e-02 1.574703e-02 1.725621e-02 1.738277e-02 2.057818e-02
[5,] 2.466546e-02 1.581902e-02 1.721918e-02 1.751410e-02 2.043483e-02
[,21] [,22] [,23] [,24] [,25]
[1,] 1.718176e-11 6.041372e-11 7.271671e-10 2.631022e-11 2.394387e-11
[2,] 4.311060e-05 2.349391e-05 8.942508e-05 7.110254e-05 1.260295e-04
[3,] 1.588409e-02 1.762074e-02 1.646286e-02 1.655209e-02 1.753709e-02
[4,] 1.587840e-02 1.756408e-02 1.646071e-02 1.656291e-02 1.750750e-02
[5,] 1.589220e-02 1.770794e-02 1.646586e-02 1.653464e-02 1.758226e-02
[,26] [,27] [,28] [,29] [,30]
[1,] 5.468033e-11 7.795080e-11 1.001601e-09 4.589769e-11 1.391003e-10
[2,] 1.465558e-04 1.997978e-05 1.088381e-05 2.775068e-05 8.511050e-05
[3,] 1.995778e-02 1.620291e-02 1.701408e-02 1.804331e-02 2.010464e-02
[4,] 2.001545e-02 1.619618e-02 1.699197e-02 1.796793e-02 2.015262e-02
[5,] 1.986870e-02 1.621258e-02 1.704734e-02 1.815877e-02 2.003019e-02
[,31] [,32] [,33] [,34] [,35]
[1,] 4.392514e-10 2.126822e-12 1.379937e-12 9.496262e-11 1.283533e-10
[2,] 4.066977e-05 1.418038e-05 9.662177e-05 9.304704e-06 2.596032e-05
[3,] 1.755409e-02 1.979152e-02 1.503885e-02 1.583168e-02 1.711033e-02
[4,] 1.756053e-02 1.965909e-02 1.504818e-02 1.580055e-02 1.707435e-02
[5,] 1.754364e-02 1.999599e-02 1.502366e-02 1.587928e-02 1.716489e-02
[,36] [,37] [,38] [,39] [,40]
[1,] 1.244254e-11 1.095376e-09 1.222179e-11 1.528442e-11 1.005406e-10
[2,] 8.854091e-05 2.771415e-04 2.388364e-04 2.445607e-04 5.453538e-05
[3,] 1.688026e-02 2.775137e-02 1.721127e-02 1.860950e-02 1.837969e-02
[4,] 1.685411e-02 2.792212e-02 1.721253e-02 1.861818e-02 1.834406e-02
[5,] 1.692003e-02 2.749011e-02 1.720836e-02 1.859542e-02 1.843408e-02
[,41] [,42] [,43] [,44] [,45]
[1,] 3.773320e-10 5.691097e-10 7.162237e-12 2.447135e-11 6.571003e-12
[2,] 7.040821e-06 3.794516e-04 6.362457e-06 6.049160e-05 4.984366e-05
[3,] 1.590548e-02 2.109172e-02 2.175785e-02 1.771424e-02 1.681899e-02
[4,] 1.586574e-02 2.115994e-02 2.158632e-02 1.771971e-02 1.678517e-02
[5,] 1.596622e-02 2.098678e-02 2.202348e-02 1.770502e-02 1.686990e-02
[,46] [,47] [,48] [,49] [,50]
[1,] 5.396012e-11 1.172468e-09 1.870435e-11 1.093238e-08 2.967319e-11
[2,] 7.567777e-05 6.167971e-04 2.244213e-04 2.579889e-05 1.094100e-04
[3,] 1.994731e-02 2.531449e-02 1.744199e-02 2.156550e-02 1.697764e-02
[4,] 2.000116e-02 2.544556e-02 1.746130e-02 2.164236e-02 1.698849e-02
[5,] 1.986392e-02 2.511383e-02 1.741165e-02 2.144735e-02 1.696047e-02
t(apply(fit4$alpha, 1, function(x) sort(x, decreasing = TRUE)))
[,1] [,2] [,3] [,4] [,5]
[1,] 0.99999997 1.093238e-08 6.666085e-09 1.398502e-09 1.172468e-09
[2,] 0.99433998 6.528051e-04 6.167971e-04 4.810615e-04 4.385076e-04
[3,] 0.04840652 4.536854e-02 2.775137e-02 2.666774e-02 2.531449e-02
[4,] 0.04887295 4.555811e-02 2.792212e-02 2.644747e-02 2.544556e-02
[5,] 0.04769422 4.508341e-02 2.749011e-02 2.700837e-02 2.511383e-02
[,6] [,7] [,8] [,9] [,10]
[1,] 1.095376e-09 1.001601e-09 7.271671e-10 5.691097e-10 4.392514e-10
[2,] 3.794516e-04 2.771415e-04 2.445607e-04 2.398309e-04 2.388364e-04
[3,] 2.486840e-02 2.347674e-02 2.241567e-02 2.175785e-02 2.156550e-02
[4,] 2.500067e-02 2.330862e-02 2.248801e-02 2.164236e-02 2.158632e-02
[5,] 2.466546e-02 2.373685e-02 2.230418e-02 2.202348e-02 2.144735e-02
[,11] [,12] [,13] [,14] [,15]
[1,] 3.773320e-10 2.769809e-10 2.366477e-10 1.934489e-10 1.710988e-10
[2,] 2.244213e-04 1.466066e-04 1.465558e-04 1.260295e-04 1.094100e-04
[3,] 2.109172e-02 2.052182e-02 2.046824e-02 2.010464e-02 1.995778e-02
[4,] 2.115994e-02 2.057818e-02 2.034759e-02 2.015262e-02 2.001545e-02
[5,] 2.098678e-02 2.065309e-02 2.043483e-02 2.012350e-02 2.003019e-02
[,16] [,17] [,18] [,19] [,20]
[1,] 1.694674e-10 1.391003e-10 1.283533e-10 1.005406e-10 9.496262e-11
[2,] 1.077129e-04 9.662177e-05 8.942508e-05 8.854091e-05 8.511050e-05
[3,] 1.994731e-02 1.993589e-02 1.979152e-02 1.977692e-02 1.959784e-02
[4,] 2.000116e-02 1.981386e-02 1.980515e-02 1.965909e-02 1.950136e-02
[5,] 1.999599e-02 1.986870e-02 1.986392e-02 1.974599e-02 1.973304e-02
[,21] [,22] [,23] [,24] [,25]
[1,] 7.795080e-11 7.732188e-11 6.257578e-11 6.197536e-11 6.169283e-11
[2,] 7.567777e-05 7.110254e-05 6.826647e-05 6.049160e-05 5.453538e-05
[3,] 1.871102e-02 1.860950e-02 1.837969e-02 1.826711e-02 1.804331e-02
[4,] 1.873738e-02 1.861818e-02 1.834406e-02 1.830700e-02 1.796793e-02
[5,] 1.866958e-02 1.859542e-02 1.843408e-02 1.820522e-02 1.815877e-02
[,26] [,27] [,28] [,29] [,30]
[1,] 6.041372e-11 5.468033e-11 5.396012e-11 4.589769e-11 3.660192e-11
[2,] 4.984366e-05 4.311060e-05 4.066977e-05 3.731885e-05 3.700979e-05
[3,] 1.791956e-02 1.771424e-02 1.762074e-02 1.755409e-02 1.753709e-02
[4,] 1.783248e-02 1.771971e-02 1.756408e-02 1.756053e-02 1.750750e-02
[5,] 1.805353e-02 1.770794e-02 1.770502e-02 1.758226e-02 1.754364e-02
[,31] [,32] [,33] [,34] [,35]
[1,] 3.039833e-11 2.967319e-11 2.631022e-11 2.447135e-11 2.394387e-11
[2,] 3.581897e-05 2.843799e-05 2.775068e-05 2.596032e-05 2.579889e-05
[3,] 1.744199e-02 1.743459e-02 1.724187e-02 1.721127e-02 1.711033e-02
[4,] 1.746130e-02 1.738277e-02 1.725621e-02 1.721253e-02 1.707435e-02
[5,] 1.751410e-02 1.741165e-02 1.721918e-02 1.720836e-02 1.716489e-02
[,36] [,37] [,38] [,39] [,40]
[1,] 1.870435e-11 1.718176e-11 1.528442e-11 1.244254e-11 1.222179e-11
[2,] 2.349391e-05 2.212862e-05 1.997978e-05 1.850792e-05 1.418038e-05
[3,] 1.701408e-02 1.697764e-02 1.688026e-02 1.681899e-02 1.678350e-02
[4,] 1.699197e-02 1.698849e-02 1.685411e-02 1.678517e-02 1.678433e-02
[5,] 1.704734e-02 1.696047e-02 1.692003e-02 1.686990e-02 1.678148e-02
[,41] [,42] [,43] [,44] [,45]
[1,] 7.162237e-12 6.571003e-12 6.544899e-12 5.848923e-12 4.087642e-12
[2,] 1.385772e-05 1.088381e-05 1.015834e-05 1.013017e-05 9.823877e-06
[3,] 1.655209e-02 1.649439e-02 1.646286e-02 1.620291e-02 1.590548e-02
[4,] 1.656291e-02 1.646071e-02 1.643295e-02 1.619618e-02 1.587840e-02
[5,] 1.658883e-02 1.653464e-02 1.646586e-02 1.621258e-02 1.596622e-02
[,46] [,47] [,48] [,49] [,50]
[1,] 3.030459e-12 2.933205e-12 2.606908e-12 2.126822e-12 1.379937e-12
[2,] 9.447618e-06 9.304704e-06 7.040821e-06 6.362457e-06 3.495016e-06
[3,] 1.588409e-02 1.583168e-02 1.579463e-02 1.577565e-02 1.503885e-02
[4,] 1.586574e-02 1.580055e-02 1.575066e-02 1.574703e-02 1.504818e-02
[5,] 1.589220e-02 1.587928e-02 1.586157e-02 1.581902e-02 1.502366e-02
sessionInfo()
R version 4.1.1 (2021-08-10)
Platform: x86_64-apple-darwin20.6.0 (64-bit)
Running under: macOS Monterey 12.0.1
Matrix products: default
BLAS: /usr/local/Cellar/openblas/0.3.18/lib/libopenblasp-r0.3.18.dylib
LAPACK: /usr/local/Cellar/r/4.1.1_1/lib/R/lib/libRlapack.dylib
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] logisticsusie_0.0.0.9004 testthat_3.1.0 survival_3.2-11
[4] workflowr_1.6.2
loaded via a namespace (and not attached):
[1] tidyselect_1.1.1 xfun_0.27 bslib_0.4.1 remotes_2.4.1
[5] purrr_0.3.4 splines_4.1.1 lattice_0.20-44 generics_0.1.2
[9] vctrs_0.3.8 usethis_2.1.3 htmltools_0.5.2 yaml_2.2.1
[13] utf8_1.2.2 rlang_1.0.6 pkgbuild_1.2.0 jquerylib_0.1.4
[17] later_1.3.0 pillar_1.6.4 glue_1.4.2 withr_2.5.0
[21] sessioninfo_1.1.1 matrixStats_0.63.0 lifecycle_1.0.1 stringr_1.4.0
[25] tictoc_1.1 devtools_2.4.2 codetools_0.2-18 evaluate_0.14
[29] memoise_2.0.1 knitr_1.36 callr_3.7.0 fastmap_1.1.0
[33] httpuv_1.6.3 ps_1.6.0 fansi_0.5.0 highr_0.9
[37] Rcpp_1.0.8.3 promises_1.2.0.1 cachem_1.0.6 desc_1.4.0
[41] pkgload_1.2.3 jsonlite_1.7.2 fs_1.5.0 digest_0.6.28
[45] stringi_1.7.5 dplyr_1.0.7 processx_3.5.2 rprojroot_2.0.2
[49] grid_4.1.1 cli_3.1.0 tools_4.1.1 magrittr_2.0.1
[53] sass_0.4.4 tibble_3.1.5 crayon_1.4.1 whisker_0.4
[57] pkgconfig_2.0.3 ellipsis_0.3.2 Matrix_1.5-3 prettyunits_1.1.1
[61] rmarkdown_2.11 rstudioapi_0.13 R6_2.5.1 git2r_0.28.0
[65] compiler_4.1.1