psych (version 2.1.9)

fa.lookup: A set of functions for factorial and empirical scale construction


When constructing scales through rational, factorial, or empirical means, it is useful to examine the content of the items that relate most highly to each other (e.g., the factor loadings of fa.lookup of a set of items) , or to some specific set of criteria (e.g., bestScales). Given a dictionary of item content, these routines will sort by factor loading or criteria correlations and display the item content.


item.lookup(f,m, dictionary,cut=.3, digits = 2) 



A data matrix or data frame depending upon the function.


A data matrix or data frame or a vector


Which variables (by name or location) should be the empirical target for bestScales and bestItems. May be a separate object.


The object returned from either a factor analysis (fa) or a principal components analysis (principal)


The word(s) to search for from a dictionary


A list of scoring keys suitable to use for make.keys


Return all values in abs(x[,c1]) > cut.


Return the n best items per factor (as long as they have their highest loading on that factor)


If provided (e.g. from scoreItems) will be added to the lookupFromKeys output


a data.frame with rownames corresponding to rownames in the f$loadings matrix or colnames of the data matrix or correlation matrix, and entries (may be multiple columns) of item content.


Column names of dictionary to search, defaults to "Item" or "Content" (dictionaries have different labels for this column), can search any column specified by search.


A data frame of item means


round to digits


Should the factors be sorted first?


In lookupFromKeys, should we suppress the column labels


Show setCor regressions with probability < p


bestItems returns a sorted list of factor loadings or correlations with the labels as provided in the dictionary.

lookup is a very simple implementation of the match function.

fa.lookup takes a factor/cluster analysis object (or just a keys like matrix), sorts it using fa.sort and then matches by to the corresponding dictionary entries.


fa.lookup and lookup are simple helper functions to summarize correlation matrices or factor loading matrices. bestItems will sort the specified column (criteria) of x on the basis of the (absolute) value of the column. The return as a default is just the rowname of the variable with those absolute values > cut. If there is a dictionary of item content and item names, then include the contents as a two column (or more) matrix with rownames corresponding to the item name and then as many fields as desired for item content. (See the example dictionary bfi.dictionary).

lookup is used by bestItems and will find values in c1 of y that match those in x. It returns those rows of y of that match x. Suppose that you have a "dictionary" of the many variables in a study but you want to consider a small subset of them in a data set x. Then, you can find the entries in the dictionary corresponding to x by lookup(rownames(x),y) If the column is not specified, then it will match by rownames(y).

fa.lookup is used when examining the output of a factor analysis and one wants the corresponding variable names and contents. The returned object may then be printed in LaTex by using the df2latex function with the char option set to TRUE.

fa.lookup will work with output from fa, pca or omega. For omega output, the items are sorted by the non-general factor loadings.

Similarly, given a correlation matrix, r, of the x variables, if you want to find the items that most correlate with another item or scale, and then show the contents of that item from the dictionary, bestItems(r,c1=column number or name of x, contents = y)

item.lookup combines the output from a factor analysis fa with simple descriptive statistics (a data frame of means) with a dictionary. Items are grouped by factor loadings > cut, and then sorted by item mean. This allows a better understanding of how a scale works, in terms of the meaning of the item endorsements.

lookupItems searches a dictionary for all items that have a certain content. The rownames of the returned object are the item numbers which can then be used in other functions to find statistics (e.g. omega) of a scale with those items. If an scales by items correlation matrix is given, then the item correlation with that scale are also shown.


Revelle, W. (in preparation) An introduction to psychometric theory with applications in R. Springer. (Available online at

See Also

fa, iclust,principal, bestScales and bestItems


Run this code
#Tne following shows how to create a dictionary
#first, copy the spreadsheet to the clipboard
# bfi.dictionary <-  #read from the clipboard
# rownames(bfi.dictionary) <- bfi.dictionary[1] #the first column had the names
# bfi.dictionary <- bfi.dictionary[-1]  #these are redundant, drop them

f5 <- fa(psychTools::bfi,5)
m <- colMeans(psychTools::bfi,na.rm=TRUE)
 #just show the item content, not the source of the items

#show how to use lookupFromKeys 
bfi.keys <- 
openness = c("O1","-O2","O3","O4","-O5")) 
bfi.over <- scoreOverlap(bfi.keys,bfi) #returns the corrected for overlap values
lookupFromKeys(bfi.keys,psychTools::bfi.dictionary,n=5, cors=bfi.over$item.cor)
 #show the keying information
lookupItems("life",psychTools::spi.dictionary) #find those items with "life" in the item
# }

Run the code above in your browser using DataCamp Workspace