opts | R Documentation |
opts
computes the OPTS MLE in low dimensional
case.
opts(X, Y, m, crit = "aic", prop_split = 0.5, cutoff = 0.75, ...)
X |
n x p covariate matrix (without intercept) |
Y |
n x 1 binary response vector |
m |
number of subsamples |
crit |
information criterion to select the variables: (a) aic = minimum AIC and (b) bic = minimum BIC |
prop_split |
proportion of subsample size and sample size, default value = 0.5 |
cutoff |
cutoff used to select the variables using the stability selection criterion, default value = 0.75 |
... |
other arguments passed to the glm function, e.g., family = "binomial" |
opts
returns a list:
betahat |
OPTS MLE of regression parameter vector |
Jhat |
estimated set of active predictors (TRUE/FALSE) corresponding to the OPTS MLE |
SE |
standard error of OPTS MLE |
freqs |
relative frequency of selection for all variables |
require(MASS) P = 15 N = 100 M = 20 BETA_vector = c(0.5, rep(0.5, 2), rep(0.5, 2), rep(0, P - 5)) MU_vector = numeric(P) SIGMA_mat = diag(P) X <- mvrnorm(N, MU_vector, Sigma = SIGMA_mat) linearPred <- cbind(rep(1, N), X) Y <- rbinom(N, 1, plogis(linearPred)) # OPTS-AIC MLE opts(X, Y, 10, family = "binomial")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.