Description Usage Arguments Value Examples
Simultaneously perform variable subet selection and model averaging with the shotgun stochastic genetic algorithm regression
1 2 |
X |
A dataset whose rows represent a vector of p measurements across a set of independent variables |
y |
A set of outcomes |
model.type |
Specify the type of regression model ('linear', 'logistic', 'poisson') |
fitness.fun |
Specify the fitness function ('AIC', 'BIC', 'CUSTOM') |
forced.vars |
A set of 1 or more columns with the same number of rows as |
print.flag |
When |
penalty |
If |
Returns an object of class 'ssga'
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | ## Load ICU workspace for logistic regression (data were obtained from aplore3 package)
load(system.file('extdata', 'ssga_icu_ws.RData', package = 'ssga'))
no.trials <- 5
model.type <- 'logistic'
fitness.fun <- 'AIC'
ssga.obj <- ssga.reg(X, y,
no.trials = no.trials,
model.type = model.type,
fitness.fun = fitness.fun,
print.flag = TRUE)
summary(ssga.obj)
## Poisson regression with the ICU data
model.type <- 'poisson'
y <- X[ , 'age']
X <- X[ , !colnames(X)%in%'age']
ssga.obj <- ssga.reg(X, y,
no.trials = no.trials,
model.type = model.type,
fitness.fun = fitness.fun)
summary(ssga.obj)
## Load Swiss workspace for linear regression
rm(list = ls(all = TRUE))
load(system.file('extdata', 'ssga_swiss_ws.RData', package = 'ssga'))
no.trials <- 5
model.type <- 'linear'
fitness.fun <- 'AIC'
ssga.obj <- ssga.reg(X, y,
no.trials = no.trials,
model.type = model.type,
fitness.fun = fitness.fun,
print.flag = TRUE)
summary(ssga.obj)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.