Description Usage Arguments Value See Also Examples
View source: R/quest_functions.R
score
calculates observed unweighted scores across a set of variables/items.
If a row's frequency of observed data is less than (or equal to)
ov.min
, then NA is returned for that row. data[vrb.nm]
is
coerced to a matrix before scoring. If the coercion leads to a character
matrix, an error is returned.
1 2 3 4 5 6 7 8 9 10 11 12 
data 
data.frame or numeric/logical matrix 
vrb.nm 
character vector of colnames in 
avg 
logical vector of length 1 specifying whether mean scores (TRUE) or sum scores (FALSE) should be created. 
ov.min 
minimum frequency of observed values required per row. If

prop 
logical vector of length 1 specifying whether 
inclusive 
logical vector of length 1 specifying whether the score
should be calculated (rather than NA) if the frequency of observed values
in a row is exactly equal to 
impute 
logical vector of length 1 specifying if missing values should
be imputed with the mean of observed values from each row of

std 
logical vector of length 1 specifying whether 1)

std.data 
logical vector of length 1 specifying whether

std.score 
logical vector of length 1 specifying whether the score should be standardized after creation. 
numeric vector of the mean/sum of each row or NA
if the
frequency of observed values is less than (or equal to) ov.min
. The
names are the rownames of data
.
scores
rowMeans_if
rowSums_if
scoreItems
1 2 3 4 5  score(data = attitude, vrb.nm = c("complaints","privileges","learning","raises"))
score(data = attitude, vrb.nm = c("complaints","privileges","learning","raises"),
std = TRUE) # standardized scoring
score(data = airquality, vrb.nm = c("Ozone","Solar.R","Temp"),
ov.min = 0.75) # conditional on observed values

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.