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.
bestScales(x, criteria, cut = 0.1, n.item = 10, overlap = FALSE, dictionary = NULL, digits = 2) bestItems(x,criteria=1,cut=.3, abs=TRUE, dictionary=NULL,cor=TRUE,digits=2) lookup(x,y,criteria=NULL) fa.lookup(f,dictionary,digits=2) item.lookup(f,m, dictionary,cut=.3, digits = 2) keys.lookup(keys.list,dictionary)
| x | A data matrix or data frame depending upon the function. |
|---|---|
| y | A data matrix or data frame or a vector |
| criteria | Which variables (by name or location) should be the empirical target for bestScales and bestItems |
| f | The object returned from either a factor analysis (fa) or a principal components analysis (principal) |
| keys.list | A list of scoring keys suitable to use for make.keys |
| cut | Return all values in abs(x[,c1]) > cut. |
| abs | if TRUE, sort by absolute value in bestItems |
| dictionary | 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. |
| m | A data frame of item means |
| cor | if x is not a square matrix, should correlations be found? |
| n.item | How many items make up an empirical scale |
| overlap | Are the correlations with other criteria fair game for bestScales |
| digits | round to digits |
bestItems 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 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.
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)
bestScales will find up to n.items that have absolute correlations with a criterion greater than cut. If the overlap option is FALSE (default) the other criteria are not used.
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.
bestScales returns the correlation of the empirically constructed scale with each criteria and the items used in the scale. If a dictionary is specified, it also returns a list (value) that shows the item content. Also returns the keys list so that scales can be found using cluster.cor or scoreItems.
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 row.name to the corresponding dictionary entries.
To create a dictionary, create an object with row names as the item numbers, and the columns as the item content. See the link{bfi.dictionary} as an example.
Revelle, W. (in preparation) An introduction to psychometric theory with applications in R. Springer. (Available online at http://personality-project.org/r/book).
Although empirical scale construction is appealing, it has the basic problem of capitalizing on chance. Thus, be careful of over interpreting the results unless working with large samples.
bs <- bestScales(bfi,criteria=c("gender","education","age"),dictionary=bfi.dictionary) bs#> The items most correlated with the criteria yield r's of #> correlation n.items #> gender 0.32 9 #> education 0.14 1 #> age 0.24 9 #> #> The best items, their correlations and content are #> $gender #> Row.names gender ItemLabel Item #> 1 N5 0.2106171 q_1505 Panic easily. #> 2 A2 0.1820202 q_1162 Inquire about others' well-being. #> 3 A1 -0.1571373 q_146 Am indifferent to the feelings of others. #> 4 A3 0.1401320 q_1206 Know how to comfort others. #> 5 A4 0.1261747 q_1364 Love children. #> 6 E1 -0.1261018 q_712 Don't talk a lot. #> 7 N3 0.1207718 q_1099 Have frequent mood swings. #> 8 O1 -0.1031059 q_128 Am full of ideas. #> 9 A5 0.1007091 q_1419 Make people feel at ease. #> Giant3 Big6 Little12 Keying IPIP100 #> 1 Stability Emotional Stability Balance -1 B5:N #> 2 Cohesion Agreeableness Compassion 1 B5:A #> 3 Cohesion Agreeableness Compassion -1 B5:A #> 4 Cohesion Agreeableness Compassion 1 B5:A #> 5 Cohesion Agreeableness Compassion 1 B5:A #> 6 Plasticity Extraversion Sociability -1 B5:E #> 7 Stability Emotional Stability Balance -1 B5:N #> 8 Plasticity Openness Intellect 1 B5:O #> 9 Cohesion Agreeableness Compassion 1 B5:A #> #> $education #> Row.names education ItemLabel Item #> 1 A1 -0.1415734 q_146 Am indifferent to the feelings of others. #> Giant3 Big6 Little12 Keying IPIP100 #> 1 Cohesion Agreeableness Compassion -1 B5:A #> #> $age #> Row.names age ItemLabel Item #> 1 A1 -0.1609637 q_146 Am indifferent to the feelings of others. #> 2 C4 -0.1482659 q_626 Do things in a half-way manner. #> 3 A4 0.1442473 q_1364 Love children. #> 4 A5 0.1290935 q_1419 Make people feel at ease. #> 5 E5 0.1146922 q_1768 Take charge. #> 6 A2 0.1142767 q_1162 Inquire about others' well-being. #> 7 N3 -0.1108648 q_1099 Have frequent mood swings. #> 8 E2 -0.1051612 q_901 Find it difficult to approach others. #> 9 N5 -0.1043322 q_1505 Panic easily. #> Giant3 Big6 Little12 Keying IPIP100 #> 1 Cohesion Agreeableness Compassion -1 B5:A #> 2 Stability Conscientiousness Industriousness -1 B5:C #> 3 Cohesion Agreeableness Compassion 1 B5:A #> 4 Cohesion Agreeableness Compassion 1 B5:A #> 5 Plasticity Extraversion Assertiveness 1 B5:E #> 6 Cohesion Agreeableness Compassion 1 B5:A #> 7 Stability Emotional Stability Balance -1 B5:N #> 8 Plasticity Extraversion Sociability -1 B5:E #> 9 Stability Emotional Stability Balance -1 B5:N #>#>m <- colMeans(bfi,na.rm=TRUE) item.lookup(f5,m,dictionary=bfi.dictionary[2])#> MR2 MR1 MR3 MR5 MR4 means com h2 #> N1 0.78 0.09 0.00 -0.12 -0.03 2.93 1.08 0.61 #> N5 0.53 -0.15 0.01 0.21 -0.17 2.97 1.70 0.37 #> N4 0.50 -0.36 -0.13 0.10 0.09 3.19 2.15 0.48 #> N3 0.73 -0.06 -0.03 0.06 0.02 3.22 1.03 0.56 #> N2 0.76 0.03 0.01 -0.09 0.02 3.51 1.03 0.58 #> E1 -0.03 -0.54 0.10 -0.07 -0.09 2.97 1.17 0.32 #> E2 0.15 -0.64 -0.02 -0.03 -0.06 3.14 1.13 0.51 #> N41 0.50 -0.36 -0.13 0.10 0.09 3.19 2.15 0.48 #> E3 0.08 0.49 0.00 0.16 0.29 4.00 1.93 0.45 #> E4 0.00 0.67 0.02 0.18 -0.07 4.42 1.17 0.55 #> E5 0.12 0.41 0.27 0.03 0.22 4.42 2.58 0.39 #> A5 -0.10 0.32 0.01 0.46 0.05 4.56 1.93 0.45 #> C4 0.18 0.06 -0.62 -0.01 -0.04 2.55 1.20 0.46 #> C5 0.20 -0.12 -0.56 0.01 0.10 3.30 1.43 0.43 #> C3 0.04 -0.05 0.56 0.08 -0.06 4.30 1.09 0.31 #> C2 0.16 -0.05 0.66 0.04 0.04 4.37 1.15 0.44 #> C1 0.07 -0.02 0.55 -0.04 0.15 4.50 1.21 0.33 #> A1 0.20 0.19 0.07 -0.51 -0.05 2.41 1.67 0.28 #> A51 -0.10 0.32 0.01 0.46 0.05 4.56 1.93 0.45 #> A3 0.00 0.23 0.03 0.58 0.03 4.60 1.31 0.49 #> A4 -0.04 0.13 0.20 0.40 -0.14 4.70 2.03 0.28 #> A2 0.01 0.07 0.08 0.63 0.03 4.80 1.07 0.47 #> O5 0.13 0.14 -0.03 -0.02 -0.52 2.49 1.28 0.29 #> O2 0.20 0.11 -0.08 0.10 -0.44 2.71 1.77 0.24 #> O3 0.03 0.17 0.02 0.05 0.62 4.44 1.18 0.47 #> O1 0.01 0.13 0.07 -0.03 0.52 4.82 1.17 0.33 #> O4 0.16 -0.28 -0.02 0.18 0.37 4.89 2.83 0.24 #> Item #> N1 Get angry easily. #> N5 Panic easily. #> N4 Often feel blue. #> N3 Have frequent mood swings. #> N2 Get irritated easily. #> E1 Don't talk a lot. #> E2 Find it difficult to approach others. #> N41 Often feel blue. #> E3 Know how to captivate people. #> E4 Make friends easily. #> E5 Take charge. #> A5 Make people feel at ease. #> C4 Do things in a half-way manner. #> C5 Waste my time. #> C3 Do things according to a plan. #> C2 Continue until everything is perfect. #> C1 Am exacting in my work. #> A1 Am indifferent to the feelings of others. #> A51 Make people feel at ease. #> A3 Know how to comfort others. #> A4 Love children. #> A2 Inquire about others' well-being. #> O5 Will not probe deeply into a subject. #> O2 Avoid difficult reading material. #> O3 Carry the conversation to a higher level. #> O1 Am full of ideas. #> O4 Spend time reflecting on things.fa.lookup(f5,dictionary=bfi.dictionary[2]) #just show the item content, not the source of the items#> MR2 MR1 MR3 MR5 MR4 com h2 #> N1 0.78 0.09 0.00 -0.12 -0.03 1.08 0.61 #> N2 0.76 0.03 0.01 -0.09 0.02 1.03 0.58 #> N3 0.73 -0.06 -0.03 0.06 0.02 1.03 0.56 #> N5 0.53 -0.15 0.01 0.21 -0.17 1.70 0.37 #> N4 0.50 -0.36 -0.13 0.10 0.09 2.15 0.48 #> E4 0.00 0.67 0.02 0.18 -0.07 1.17 0.55 #> E2 0.15 -0.64 -0.02 -0.03 -0.06 1.13 0.51 #> E1 -0.03 -0.54 0.10 -0.07 -0.09 1.17 0.32 #> E3 0.08 0.49 0.00 0.16 0.29 1.93 0.45 #> E5 0.12 0.41 0.27 0.03 0.22 2.58 0.39 #> C2 0.16 -0.05 0.66 0.04 0.04 1.15 0.44 #> C4 0.18 0.06 -0.62 -0.01 -0.04 1.20 0.46 #> C3 0.04 -0.05 0.56 0.08 -0.06 1.09 0.31 #> C5 0.20 -0.12 -0.56 0.01 0.10 1.43 0.43 #> C1 0.07 -0.02 0.55 -0.04 0.15 1.21 0.33 #> A2 0.01 0.07 0.08 0.63 0.03 1.07 0.47 #> A3 0.00 0.23 0.03 0.58 0.03 1.31 0.49 #> A1 0.20 0.19 0.07 -0.51 -0.05 1.67 0.28 #> A5 -0.10 0.32 0.01 0.46 0.05 1.93 0.45 #> A4 -0.04 0.13 0.20 0.40 -0.14 2.03 0.28 #> gender 0.14 0.00 0.11 0.29 -0.16 2.42 0.12 #> age -0.15 -0.12 0.08 0.19 0.08 3.49 0.08 #> O3 0.03 0.17 0.02 0.05 0.62 1.18 0.47 #> O1 0.01 0.13 0.07 -0.03 0.52 1.17 0.33 #> O5 0.13 0.14 -0.03 -0.02 -0.52 1.28 0.29 #> O2 0.20 0.11 -0.08 0.10 -0.44 1.77 0.24 #> O4 0.16 -0.28 -0.02 0.18 0.37 2.83 0.24 #> education -0.10 -0.14 -0.01 0.10 0.15 3.47 0.05 #> Item #> N1 Get angry easily. #> N2 Get irritated easily. #> N3 Have frequent mood swings. #> N5 Panic easily. #> N4 Often feel blue. #> E4 Make friends easily. #> E2 Find it difficult to approach others. #> E1 Don't talk a lot. #> E3 Know how to captivate people. #> E5 Take charge. #> C2 Continue until everything is perfect. #> C4 Do things in a half-way manner. #> C3 Do things according to a plan. #> C5 Waste my time. #> C1 Am exacting in my work. #> A2 Inquire about others' well-being. #> A3 Know how to comfort others. #> A1 Am indifferent to the feelings of others. #> A5 Make people feel at ease. #> A4 Love children. #> gender males=1, females=2 #> age age in years #> O3 Carry the conversation to a higher level. #> O1 Am full of ideas. #> O5 Will not probe deeply into a subject. #> O2 Avoid difficult reading material. #> O4 Spend time reflecting on things. #> education in HS, fin HS, coll, coll grad , grad deg