View source: R/Selbal_Functions.R
| selbal | R Documentation | 
Looks for a highly-associated balance with a response variable
selbal(x, y, th.imp = 0, covar = NULL, logit.acc = "AUC", logt = T,
  col = c("steelblue1", "tomato1"), tab = T, draw = T,
  maxV = 1e+10, zero.rep = "bayes")
x | 
 a   | 
y | 
 the response variable, either continuous or dichotomous.  | 
th.imp | 
 a numeric value indicating the minimum increment required in the association parameter between two consecutive steps in order to continue with the variable addition into the balance.  | 
covar | 
 
  | 
logit.acc | 
 when   | 
logt | 
 
  | 
col | 
 
  | 
tab | 
 
  | 
draw | 
 
  | 
maxV | 
 
  | 
zero.rep | 
 a value defining the method to use for zero - replacement.
  | 
opt.cri | 
 parameter for selecting the method to determine the optimal
number of variables.   | 
A list with the following objects:
FINAL.BAL the numeric values of the selected balance for each
sample.
POS a vector with the variables appearing in the numerator of
the balance.
NEG a vector with the variables appearing in the denominator of
the balance.
INC.VAR a vector with both POS and NUM variables
(included variables).
ACC.Bal a vector with the association value after each step of
the algorithm.
EVOL a data.frame with the variables sorted as they have
been added into the balance with the corresponding association value after
their inclusion. Only returned if tab is TRUE.
FINAL.P the graphical representation of the results. Only
showed if draw = T.
FIT.Final the regression model taking covariates and the final
balance as the explanatory variables and y as the response variable.
# Load data set
  load("HIV.rda")
# Define x and y
  x <- HIV[,1:60]
  y <- HIV[,62]
# Run the algorithm
  Bal <- selbal(x,y)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.