Nothing
## ----include = FALSE----------------------------------------------------------
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)
## ----setup--------------------------------------------------------------------
library(subsampling)
## -----------------------------------------------------------------------------
set.seed(2)
N <- 2 * 1e4
beta0 <- c(-6, -rep(0.5, 6))
d <- length(beta0) - 1
corr <- 0.5
sigmax <- corr ^ abs(outer(1:d, 1:d, "-"))
X <- MASS::mvrnorm(n = N, mu = rep(0, d), Sigma = sigmax)
Y <- rbinom(N, 1, 1 - 1 / (1 + exp(beta0[1] + X %*% beta0[-1])))
n.plt <- 200
n.ssp <- 600
data <- as.data.frame(cbind(Y, X))
colnames(data) <- c("Y", paste0("V", 1:ncol(X)))
formula <- Y ~ .
print(paste("N:", N))
print(paste("sum(Y):", sum(Y)))
## -----------------------------------------------------------------------------
set.seed(11)
fit_default <- ssp.relogit(
formula = formula,
data = data,
n.plt = n.plt,
n.ssp = n.ssp,
criterion = "optL",
likelihood = "logOddsCorrection"
)
summary(fit_default)
## -----------------------------------------------------------------------------
set.seed(2)
fit_optA <- ssp.relogit(
formula = formula,
data = data,
n.plt = n.plt,
n.ssp = n.ssp,
criterion = "optA",
likelihood = "logOddsCorrection"
)
summary(fit_optA)
## -----------------------------------------------------------------------------
set.seed(9)
fit_uniform <- ssp.relogit(
formula = formula,
data = data,
n.plt = n.plt,
n.ssp = n.ssp,
criterion = "uniform",
likelihood = "logOddsCorrection"
)
fit_uniform$subsample.size.expect
length(fit_uniform$index)
summary(fit_uniform)
## -----------------------------------------------------------------------------
names(fit_default)
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.