# Adapted from https://github.com/tmatta/lsasim/issues/50#issue-2254039296
# Package, Data and subset
remotes::install_github("tmatta/lsasim", "issue-50")
#> Using GitHub PAT from the git credential store.
#> Skipping install of 'lsasim' from a github remote, the SHA1 (28b71cf3) has not changed since last install.
#> Use `force = TRUE` to force installation
library(lsasim)
#> This is lsasim 2.1.4-1713963651
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
/* | |
* Chemistry Quiz Game | |
* | |
* This program is a simple console-based quiz game that tests the user's knowledge of chemistry. | |
* The game consists of a series of multiple-choice questions, each with four possible answers. | |
* Players must select the correct option (A, B, C, or D) to score points. The quiz contains five |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Constants | |
max_si <- 100000L | |
tolerances <- c(0, 1e-9) | |
# Load required packages, create testing function | |
library(parallel) | |
test_me <- function(si, quiet = TRUE, fam = "chisq", tolerance = 0) { | |
set.seed(si) | |
results <- c() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Setting up objects ========================================================= | |
set.seed(1235) | |
N <- 100 | |
p <- 50 | |
nz <- 4 | |
K <- nz | |
X <- matrix(rnorm(n = N * p), nrow = N, ncol = p) | |
mx <- colMeans(X) | |
sx <- sqrt(apply(X, 2, var)) | |
X <- scale(X, mx, sx) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
s | |
) | |
) | |
# Run a Bayesian Cox model | |
## Initial value: null model without covariates | |
initial <- list("gamma.ini" = rep(0, ncol(dataset$X))) | |
initial_2S <- list( | |
initial, | |
list("gamma.ini" = rep(0, ncol(dataset_2S[[2]]$X))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install and load the package, set the seed | |
remotes::install_github("ocbe-uio/MADMMplasso") | |
library(MADMMplasso) | |
set.seed(1235) | |
# Generate the data | |
N <- 100 | |
p <- 50 | |
nz <- 4 | |
K <- nz |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install and load the package, set the seed | |
remotes::install_github("ocbe-uio/MADMMplasso@issue-17") | |
library(MADMMplasso) | |
set.seed(1235) | |
# Generate the data | |
N <- 100 | |
p <- 50 | |
nz <- 4 | |
K <- nz |
# Setup
remotes::install_github("tmatta/lsasim", "issue-50")
#> Using GitHub PAT from the git credential store.
#> Downloading GitHub repo tmatta/lsasim@issue-50
#>
#> ── R CMD build ─────────────────────────────────────────────────────────────────
#> * checking for file ‘/tmp/RtmpCKm8ak/remotes9c8f72a0c9f7/tmatta-lsasim-940c83a/DESCRIPTION’ ... OK
#> * preparing ‘lsasim’:
#> * checking DESCRIPTION meta-information ... OK
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Loading package ============================================================== | |
library("MADMMplasso") | |
message(paste("MADMMplasso version", packageVersion("MADMMplasso"))) | |
# Loading data ================================================================= | |
CRC_data <- readRDS("aux/CRC_data_300.rds") # change this manually, I won't bother with commandArgs() | |
X23 <- CRC_data$x | |
# log2 transfermation f or the expression levels | |
X1 <- (X23) |
# Setup ========================================================================
rm(list = ls())
devtools::install_github("ocbe-uio/MADMMplasso", force = TRUE)
#> Downloading GitHub repo ocbe-uio/MADMMplasso@HEAD
#>
#> ── R CMD build ─────────────────────────────────────────────────────────────────
#> * checking for file ‘/tmp/Rtmpr2fzD2/remotes149907717ef58/ocbe-uio-MADMMplasso-9896eeb/DESCRIPTION’ ... OK
#> * preparing ‘MADMMplasso’:
#> * checking DESCRIPTION meta-information ... OK
NewerOlder