## code to prepare `SimData2_100` dataset goes here
set.seed(2021)
num.cov<-4
beta_true <- c(1, -1, 1, -1)
logit.inv <- function(x){exp(x)/(1+exp(x))}
samplesize<-100
# model 2_100
z <- matrix(rnorm(samplesize*num.cov, mean=0, sd=1), nrow=num.cov)
z <- round(z, digits=3)
p <- logit.inv(t(as.matrix(beta_true))%*%as.matrix(z))
y <- rbinom(samplesize, 1, p)
sum(y)
SimData <- list(t(z), y)
names(SimData) <- c("X", "Y")
SimData2_100 <- SimData
usethis::use_data(SimData2_100, overwrite = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.