Learn R Programming

psych (version 2.6.1)

scoreWtd: Score items using regression or correlation based weights

Description

Item weights from bestScales or lmCor are used to find weighted scale scores. In contrast to the unit weights used in scoreItems, scoreWtd will multiply the data by a set of weights to find scale scores. These weight may come from a regression (e.g., lm or lmCor) or may be the zero order correlation weights from bestScales.

Usage

scoreWtd(weights, items, std = TRUE, sums = FALSE, impute = "none")

Arguments

Value

A data frame of scores.

Details

Although meant for finding correlation weighted scores using the weights from bestScales, it also possible to use alternative weight matrices, such as those returned by the coefficients in lm.

See Also

bestScales and lmCor

Examples

Run this code
  
#find the weights from a regression model and then apply them to a new set
#derivation of weights from the first 20 cases 
model.lm <- lm(rating ~ complaints + privileges + learning,data=attitude[1:20,])
#or use lmCor to find the coefficents
model <- lmCor(rating ~ complaints + privileges +learning,data=attitude[1:20,],std=FALSE)
 
 #Apply these to a different set of data (the last 10 cases)
  #note that the regression coefficients need to be a matrix
  scores.lm <- scoreWtd(as.matrix(model.lm$coefficients),attitude[21:30,],sums=TRUE,std=FALSE)
scores <- scoreWtd(model$coefficients,attitude[21:30,],sums=TRUE,std=FALSE)
describe(scores)  

Run the code above in your browser using DataLab