ScaleCalc {CMO} | R Documentation |
Calculates a scale raw score by summarizing test item values concerning a question of interest. Test items are first recoded to conform their correlation to the question of interest. Integration of test items is done either by sum or mean.
ScaleCalc(mat, polungsVek, calcMethod = "mean", recodeMethod = "maxminus", maxVal = 100, nBootRep = 0)
mat |
numeric matrix of test item scores |
polungsVek |
recode scheme foreach test item, depicted by "+" or "-" signs |
calcMethod |
method to integrate the recoded test item values; either sum or mean |
recodeMethod |
method to recode the test item values by the recoding scheme; either maxminus, minus |
maxVal |
maximal test item value (default = 100) |
nBootRep |
number of bootstraps to perform |
returns a list of class Berechnungsvorschrift
rawItemScores |
test item raw data |
polungVek |
character vector depicting the recoding scheme |
recodeMethod |
recoding method |
calcMethod |
method used to integrate the test item values |
maxVal |
maximum score per test item values |
recItemScores |
recoded test item scores |
rawScores |
itegrated scale raw score |
and all items Cronbach's alpha scores as calculated by the function mcron
Christian Montel
#create some arbitrary test results data <- matrix(ceiling(runif(400)*100),nrow=20) #create some question of interest result erg <- ceiling(runif(20)*100) polung <- apply(data,2,function(x) if (cor.test(erg,x)$estimate < 0) return("-") else return("+")) str(ScaleCalc(data,polungsVek=polung))