GAabbreviate(items = NULL,
scales = NULL,
itemCost = 0.05,
maxItems = 5,
maxiter = 100,
popSize = 50,
...,
plot = FALSE,
verbose = TRUE,
crossVal = TRUE,
impute = FALSE,
pairwise = FALSE,
minR = 0,
sWeights = NULL,
nSample = NULL)ga for tuning GAs.TRUE, plot results after every generation (this will slow down the process).TRUE display some info during the search.TRUE, cross-validation will be performed. Note that if you turn this off, the predictive fit of the resulting measure will be biased by overfitting.TRUE, the mean value will be imputed for any missing item or scale scores. This is NOT recommended. Instead, you should decide how to handle missing values yourself before passing the items and scales variables.TRUE, the GA will use pairwise deletion to select items, i.e. some scales/items may have diferent NAs than others. If FALSE, the GA will crash if any NAs are passed. It's recommended to leave this off, as NAs should rmaxItems.nSample observations to use instead of drawing on the full dataset.'GAabbreviate' providing the following information:'GA'.The GAabbreviate uses the GA package (Scrucca, 2012) to efficiently implement Yarkoni's (2010) scale abbreviation cost function:
$$Cost = Ik + \sum_{i=1}^s w_i(1-R_i)^2$$
where $I$ represents a user-specified fixed item cost, $k$ represents the number of items retained by the GA (in any given iteration), $s$ is the number of subscales in the measure, $w_i$ are the weights (by default {w_i = 1} for any $i$) associated with each subscale (if there are any subsets to be retained), and $R_i^2$ is the amount of variance in the ith subscale that can be explained by a linear combination of individual item scores. Adjusting the value of $I$ low or high yields longer or shorter measures respectively. When the cost of each individual item retained in each generation outweighs the cost of a loss in explained variance, the GA yields a relatively brief measure. When the cost is low, the GA yields a relatively longer measure maximizing explained variance (Yarkoni, 2010).
Sahdra, Ciarrochi, Parker & Scrucca (2015) contains an example of how GAabbreviate can be used for item-reduction of a multidimensional scale.
Scrucca, L. (2012). GA: a package for genetic algorithms in R. Journal of Statistical Software, 53, 1-37.
Yarkoni, T. (2010). The abbreviation of personality, or how to measure 200 personality scales with 200 items. Journal of Research in Personality, 44(2), 180-198.
### Example using random generated data
nsubject = 100
nitems = 15
set.seed(123)
items = matrix(sample(1:5, nsubject*nitems, replace = TRUE),
nrow = nsubject, ncol = nitems)
scales = cbind(rowSums(items[,1:10]), rowSums(items[,11:15]))
GAA = GAabbreviate(items, scales, itemCost = 0.01, maxItems = 5,
popSize = 50, maxiter = 300, run = 100,
verbose = TRUE)
plot(GAA)
summary(GAA)
GAA$best
GAA$measureRun the code above in your browser using DataLab