First some prelimaries

The ‘psych’ and ‘psychTools’ packages have been updated to versions 2.2.5. You need to install them and then restart RStudio.

After doing so,

library(psych)
library(psychTools)
sessionInfo()  #to make sure you have the most recent release
## R version 4.2.0 (2022-04-22)
## Platform: aarch64-apple-darwin20 (64-bit)
## Running under: macOS Monterey 12.3.1
## 
## Matrix products: default
## BLAS:   /Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/lib/libRblas.0.dylib
## LAPACK: /Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/lib/libRlapack.dylib
## 
## locale:
## [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
## 
## attached base packages:
## [1] stats     graphics  grDevices utils     datasets  methods   base     
## 
## other attached packages:
## [1] psychTools_2.2.5 psych_2.2.5     
## 
## loaded via a namespace (and not attached):
##  [1] lattice_0.20-45 digest_0.6.28   grid_4.2.0      R6_2.5.1        nlme_3.1-157    jsonlite_1.7.2 
##  [7] magrittr_2.0.1  evaluate_0.14   rlang_0.4.12    stringi_1.7.5   jquerylib_0.1.4 bslib_0.3.1    
## [13] rmarkdown_2.11  tools_4.2.0     foreign_0.8-82  stringr_1.4.0   parallel_4.2.0  xfun_0.28      
## [19] yaml_2.3.5      fastmap_1.1.0   compiler_4.2.0  mnormt_2.0.2    tmvnsim_1.0-2   htmltools_0.5.2
## [25] knitr_1.36      sass_0.4.0

Alice Eagly and I have been working on a manuscript examining the effect of data aggregation on the validity of scales. The paper (https://personality-project.org/revelle/publications/eagly.revelle.21.pdf ) Understanding the Magnitude of Psychological Differences Between Women and Men Requires Seeing the Forest and the Trees (in press)) uses data from an article by Ursala Athenstaedt (2003). Here we show the steps necessary to convert a raw data set into the final, publication ready graphics that we have in our paper.

In the process of final proof reading, we discovered some errors in the way we had processed the data. This is a nice example of the to document your scripts and to double check (and then check again) your analyses.

Getting the original data

The data are in an SPSS sav file that I have put into the course files. We need to get the name of that file, and then read it.

fn <- "https://personality-project.org/courses/350/3studien.sav"
ursala <- read.file(fn)
## Data from the SPSS sav file https://personality-project.org/courses/350/3studien.sav has been loaded.
dim(ursala)   #how many subjects (rows) and variables (columns)
## [1] 677 114
colnames(ursala) 
##   [1] "STUDIE"  "GESCHL"  "V1"      "V2"      "V3"      "V4"      "V5"      "V6"      "V7"     
##  [10] "V8"      "V9"      "V10"     "V11"     "V12"     "V13"     "V14"     "V15"     "V16"    
##  [19] "V17"     "V18"     "V19"     "V20"     "V21"     "V22"     "V23"     "V24"     "V25"    
##  [28] "V26"     "V27"     "V28"     "V29"     "V30"     "V31"     "V32"     "V33"     "V34"    
##  [37] "V35"     "V36"     "V37"     "V38"     "V39"     "V40"     "V41"     "V42"     "V43"    
##  [46] "V44"     "V45"     "V46"     "V47"     "V48"     "V49"     "V50"     "V51"     "V52"    
##  [55] "V53"     "V54"     "V55"     "V56"     "V57"     "V58"     "V59"     "V60"     "V61"    
##  [64] "V62"     "V63"     "V64"     "V65"     "V66"     "V67"     "V68"     "V69"     "V70"    
##  [73] "V71"     "V72"     "V73"     "V74"     "MMINUS1" "FMINUS1" "MPLUS1"  "FPLUS1"  "MMINUS2"
##  [82] "MPLUS2"  "MMINUS3" "FPLUS2"  "FPLUS3"  "FMINUS2" "FPLUS4"  "FMINUS3" "MMINUS4" "FPLUS5" 
##  [91] "MMINUS5" "FMINUS4" "FPLUS6"  "MPLUS3"  "FMINUS5" "MPLUS4"  "MMINUS6" "MPLUS5"  "MMINUS7"
## [100] "MPLUS6"  "MMINUS8" "FPLUS7"  "FPLUS8"  "FMINUS6" "FMINUS7" "MPLUS7"  "MMINUS9" "NGRO"   
## [109] "FMINUS"  "FPLUS"   "MMINUS"  "MPLUS"   "FBEHAV"  "MBEHAV"
describe(ursala)  #always describe the data!
##         vars   n   mean    sd median trimmed   mad min max range  skew kurtosis   se
## STUDIE     1 677   1.90  0.69      2    1.87  0.00   1   3     2  0.13    -0.88 0.03
## GESCHL     2 665   1.47  0.50      1    1.46  0.00   1   2     1  0.12    -1.99 0.02
## V1         3 677   5.35  1.63      6    5.55  1.48   1   9     8 -0.89     0.38 0.06
## V2         4 677   3.39  2.33      3    3.22  2.97   1   9     8  0.40    -1.32 0.09
## V3         5 677   4.03  2.10      4    4.01  2.97   1   9     8  0.04    -1.17 0.08
## V4         6 677   3.99  2.26      4    3.97  2.97   1   9     8  0.01    -1.41 0.09
## V5         7 677   5.42  1.86      6    5.69  1.48   1   9     8 -0.91    -0.28 0.07
## V6         8 677   5.43  1.72      6    5.69  1.48   1   9     8 -0.99     0.22 0.07
## V7         9 677   5.42  1.83      6    5.69  1.48   1   9     8 -0.96    -0.09 0.07
## V8        10 677   2.81  2.04      2    2.53  1.48   1   9     8  0.84    -0.45 0.08
## V9        11 677   2.46  2.07      1    2.07  0.00   1   9     8  1.25     0.27 0.08
## V10       12 677   3.89  2.09      4    3.83  2.97   1   9     8  0.19    -1.04 0.08
## V11       13 677   4.40  2.09      5    4.48  2.97   1   9     8 -0.16    -1.11 0.08
## V12       14 677   2.77  1.81      2    2.54  1.48   1   9     8  0.97     0.42 0.07
## V13       15 677   5.86  1.20      6    6.00  1.48   2   9     7 -0.78     1.05 0.05
## V14       16 677   5.60  1.66      6    5.83  1.48   1   9     8 -0.96     0.35 0.06
## V15       17 677   3.70  2.25      3    3.59  2.97   1   9     8  0.31    -1.22 0.09
## V16       18 677   5.33  1.70      6    5.51  1.48   1   9     8 -0.69    -0.23 0.07
## V17       19 677   4.66  2.05      5    4.79  1.48   1   9     8 -0.42    -0.86 0.08
## V18       20 677   5.93  1.50      7    6.18  1.48   1   9     8 -1.25     1.26 0.06
## V19       21 677   2.29  1.76      1    1.96  0.00   1   9     8  1.36     0.92 0.07
## V20       22 677   3.85  2.17      4    3.81  2.97   1   9     8  0.10    -1.38 0.08
## V21       23 677   2.80  1.97      2    2.54  1.48   1   9     8  0.87    -0.40 0.08
## V22       24 677   3.06  1.94      3    2.86  2.97   1   9     8  0.62    -0.68 0.07
## V23       25 677   5.11  1.97      6    5.32  1.48   1   9     8 -0.66    -0.86 0.08
## V24       26 677   2.63  2.16      2    2.28  1.48   1   9     8  1.10    -0.20 0.08
## V25       27 677   4.82  1.52      5    4.89  1.48   1   9     8 -0.41    -0.28 0.06
## V26       28 677   4.99  1.82      5    5.17  1.48   1   9     8 -0.64    -0.48 0.07
## V27       29 677   3.83  1.82      4    3.81  2.97   1   9     8  0.11    -1.01 0.07
## V28       30 677   3.68  2.30      3    3.58  2.97   1   9     8  0.25    -1.40 0.09
## V29       31 677   4.48  2.38      5    4.58  2.97   1   9     8 -0.29    -1.46 0.09
## V30       32 677   4.48  2.20      5    4.59  2.97   1   9     8 -0.33    -1.27 0.08
## V31       33 677   5.73  1.26      6    5.86  1.48   1   9     8 -0.83     0.56 0.05
## V32       34 677   4.83  1.95      5    4.96  2.97   1   9     8 -0.41    -0.97 0.08
## V33       35 677   5.93  1.59      7    6.25  0.00   1   9     8 -1.46     1.37 0.06
## V34       36 677   4.13  2.27      4    4.15  2.97   1   9     8 -0.07    -1.44 0.09
## V35       37 677   2.45  2.12      1    2.06  0.00   1   9     8  1.27     0.19 0.08
## V36       38 677   4.19  2.24      4    4.22  2.97   1   9     8 -0.12    -1.40 0.09
## V37       39 677   2.94  2.17      2    2.65  1.48   1  13    12  0.92     0.10 0.08
## V38       40 677   4.42  2.06      4    4.51  2.97   1   9     8 -0.18    -1.18 0.08
## V39       41 677   4.73  1.93      5    4.88  1.48   1   9     8 -0.45    -0.89 0.07
## V40       42 677   3.87  2.19      4    3.83  2.97   1   9     8  0.11    -1.39 0.08
## V41       43 677   5.38  1.65      6    5.59  1.48   1   9     8 -0.81    -0.15 0.06
## V42       44 677   2.43  1.85      2    2.11  1.48   1   9     8  1.17     0.30 0.07
## V43       45 677   4.17  2.13      4    4.21  2.97   1   9     8 -0.09    -1.35 0.08
## V44       46 677   2.48  2.10      1    2.10  0.00   1   9     8  1.16    -0.10 0.08
## V45       47 677   5.06  2.03      6    5.29  1.48   1   7     6 -0.67    -0.93 0.08
## V46       48 677   4.16  2.27      4    4.20  2.97   1   7     6 -0.09    -1.51 0.09
## V47       49 677   2.87  2.22      2    2.59  1.48   1   7     6  0.73    -1.03 0.09
## V48       50 677   3.77  2.12      4    3.71  2.97   1   7     6  0.18    -1.35 0.08
## V49       51 677   5.73  1.40      6    5.95  1.48   1   7     6 -1.04     0.29 0.05
## V50       52 677   4.69  1.80      5    4.82  1.48   1   7     6 -0.48    -0.78 0.07
## V51       53 677   4.44  1.86      5    4.53  1.48   1   7     6 -0.35    -1.02 0.07
## V52       54 677   4.33  2.19      5    4.41  2.97   1   7     6 -0.21    -1.42 0.08
## V53       55 677   2.95  2.21      2    2.69  1.48   1   9     8  0.71    -0.95 0.08
## V54       56 677   4.16  2.21      4    4.20  2.97   1   9     8 -0.11    -1.43 0.08
## V55       57 677   5.07  1.81      6    5.25  1.48   1   9     8 -0.58    -0.75 0.07
## V56       58 677   2.49  1.83      2    2.20  1.48   1   9     8  1.02    -0.14 0.07
## V57       59 677   3.79  2.19      4    3.74  2.97   1   9     8  0.13    -1.40 0.08
## V58       60 677   4.27  1.76      4    4.30  1.48   1   9     8 -0.17    -0.87 0.07
## V59       61 677   3.82  1.99      4    3.77  2.97   1   9     8  0.13    -1.20 0.08
## V60       62 677   3.77  1.93      4    3.71  2.97   1   9     8  0.12    -1.09 0.07
## V61       63 677   2.05  1.88      1    1.61  0.00   1   9     8  1.68     1.42 0.07
## V62       64 677   4.95  1.64      5    5.08  1.48   1   9     8 -0.52    -0.39 0.06
## V63       65 677   3.29  2.24      3    3.10  2.97   1   9     8  0.43    -1.29 0.09
## V64       66 677   4.56  1.78      5    4.66  1.48   1   7     6 -0.35    -0.79 0.07
## V65       67 677   5.19  1.77      6    5.42  1.48   1   7     6 -0.82    -0.31 0.07
## V66       68 677   2.80  1.87      2    2.57  1.48   1   9     8  0.86    -0.44 0.07
## V67       69 677   4.15  2.09      4    4.16  2.97   1   9     8 -0.09    -1.09 0.08
## V68       70 677   3.96  2.68      4    3.86  2.97   1  44    43  5.07    72.33 0.10
## V69       71 677   4.95  2.00      5    5.16  2.97   1   7     6 -0.64    -0.87 0.08
## V70       72 677   3.72  2.18      4    3.65  2.97   1   7     6  0.14    -1.40 0.08
## V71       73 677   3.55  2.08      3    3.44  2.97   1   7     6  0.32    -1.21 0.08
## V72       74 677   3.60  2.38      3    3.49  2.97   1   9     8  0.29    -1.52 0.09
## V73       75 677   4.28  2.40      5    4.34  2.97   1   9     8 -0.18    -1.57 0.09
## V74       76 677   3.17  2.50      2    2.96  1.48   1   9     8  0.55    -1.44 0.10
## MMINUS1   77 677   2.73  1.67      2    2.50  1.48   1   9     8  1.59     3.41 0.06
## FMINUS1   78 677   2.71  1.79      2    2.46  1.48   1   9     8  1.36     2.07 0.07
## MPLUS1    79 677   4.45  1.49      5    4.49  1.48   1   9     8  0.19     1.15 0.06
## FPLUS1    80 677   4.70  1.48      5    4.76  1.48   1   9     8  0.07     1.05 0.06
## MMINUS2   81 677   2.33  1.52      2    2.09  1.48   1   9     8  1.76     4.40 0.06
## MPLUS2    82 677   4.57  1.27      5    4.62  1.48   1   9     8  0.06     1.55 0.05
## MMINUS3   83 677   2.36  1.43      2    2.17  1.48   1   9     8  1.66     4.52 0.05
## FPLUS2    84 677   5.09  1.25      5    5.28  1.48   1   9     8 -0.92     2.23 0.05
## FPLUS3    85 677   4.38  1.24      4    4.36  1.48   1   9     8  0.40     2.36 0.05
## FMINUS2   86 677   3.48  1.44      3    3.39  1.48   1   9     8  0.93     2.10 0.06
## FPLUS4    87 677   4.99  1.02      5    5.04  1.48   1   9     8 -0.01     3.08 0.04
## FMINUS3   88 677   3.23  1.38      3    3.11  1.48   1   9     8  1.31     3.64 0.05
## MMINUS4   89 677   2.68  1.41      2    2.56  1.48   1   9     8  0.69     0.55 0.05
## FPLUS5    90 677   4.96  0.95      5    5.04  1.48   1   9     8 -0.62     1.55 0.04
## MMINUS5   91 677   2.63  1.66      2    2.40  1.48   1   9     8  1.58     3.53 0.06
## FMINUS4   92 677   3.58  1.31      4    3.55  1.48   1   9     8  0.27     0.22 0.05
## FPLUS6    93 677   4.69  1.15      5    4.80  1.48   1   9     8 -0.66     1.20 0.04
## MPLUS3    94 677   3.52  1.58      3    3.51  1.48   1   9     8  0.05    -0.82 0.06
## FMINUS5   95 677   3.17  1.47      3    3.13  1.48   1   9     8  0.24    -0.69 0.06
## MPLUS4    96 677   4.63  1.33      5    4.78  1.48   1   9     8 -0.73     0.43 0.05
## MMINUS6   97 677   3.51  1.58      4    3.51  1.48   1   9     8 -0.06    -0.80 0.06
## MPLUS5    98 677   4.21  1.23      4    4.28  1.48   1   9     8 -0.45     0.32 0.05
## MMINUS7   99 677   2.38  1.21      2    2.24  1.48   1   9     8  1.05     1.28 0.05
## MPLUS6   100 677   3.89  1.09      4    3.90  1.48   1   9     8  0.39     3.10 0.04
## MMINUS8  101 677   2.10  1.24      2    1.92  1.48   1   9     8  1.32     2.34 0.05
## FPLUS7   102 677   4.92  0.98      5    5.01  1.48   1   9     8 -0.61     2.20 0.04
## FPLUS8   103 677   4.46  1.31      5    4.58  1.48   1   9     8 -0.52     0.38 0.05
## FMINUS6  104 677   2.28  1.16      2    2.16  1.48   1   9     8  0.93     1.28 0.04
## FMINUS7  105 677   2.58  1.40      2    2.43  1.48   1   9     8  0.88     0.89 0.05
## MPLUS7   106 677   4.52  1.15      5    4.62  1.48   1   9     8 -0.76     0.67 0.04
## MMINUS9  107 677   2.51  1.23      2    2.41  1.48   1   9     8  0.73     0.49 0.05
## NGRO     108 657  90.12 27.05     86   88.49 28.17  32 186   154  0.56    -0.02 1.06
## FMINUS   109 677  21.02  5.74     20   20.69  5.93   8  42    34  0.57     0.32 0.22
## FPLUS    110 677  38.19  5.87     39   38.38  5.93  13  57    44 -0.34     1.10 0.23
## MMINUS   111 677  20.84  6.74     20   20.51  5.93   8  59    51  0.69     1.49 0.26
## MPLUS    112 677  29.79  6.07     30   30.01  5.93   8  48    40 -0.35     0.10 0.23
## FBEHAV   113 677 122.92 30.16    124  122.95 35.58  50 192   142 -0.03    -0.88 1.16
## MBEHAV   114 677  95.33 24.76     96   95.38 28.17  36 159   123 -0.01    -0.68 0.95

Cleaning up the data

We see several things from the description of the file. Although the items are supposed to range from 1 to 7, many of them include 9, one even includes 43. The items are in columns 3 - 76, with some scale information after that.

We will ‘scrub’ the data to convert all missing values to NA and then describe the data again. We do this by specifying that the maximum value we want is 7.

We want to select ‘complete.cases’ (no missing values). We do this by finding which subjects are complete, and then making up the new data set with just complete cases.

cleaned <- scrub(ursala,where= 3:107, max=7 )
complete <-complete.cases(cleaned)
cleaned <- cleaned[complete,]  #just those with complete cases
dim(cleaned)
## [1] 570 114
table(cleaned[,2]) #how many cases?
## 
##   1   2 
## 305 265

We seem to have few subjects than Athenstaedt reported (310 females, 266 males). Perhaps we should clean somewhat fewer variables?

(After several attempts, the right value seems to be columns 1-92).

cleaned <- scrub(ursala,where= 3:92, max=7 )
complete <-complete.cases(cleaned)
cleaned <- cleaned[complete,]  #just those with complete cases
dim(cleaned)
## [1] 576 114
table(cleaned[,2]) #how many cases?
## 
##   1   2 
## 310 266
ursala.clean <- cleaned

Making a dictionary

Rather than refer to the data as merely items V1 .. V76, it would be nice to know the items. We create a csv file in our friendly text editor, and the read this in as a dictionary.

fn  <- "https://personality-project.org/courses/350/Athenstaedt.dictionary.csv"
ursala.dictionary <- read.file(fn) #automatically reads csv
## Data from the .csv file https://personality-project.org/courses/350/Athenstaedt.dictionary.csv has been loaded.
rownames(ursala.dictionary) <- ursala.dictionary[,1]
headTail(ursala.dictionary, top=8,bottom=8)
##                  Item                                           Content
## Sex               Sex                                            Gender
## V1                 V1 To pay attention to ones appearance in the office
## V2                 V2                            Offer fire to somebody
## V3                 V3                                Paint an Apartment
## V4                 V4                                      Mow the Lawn
## V5                 V5                                      Make the Bed
## V6                 V6               Hold the Door Open for your Partner
## V7                 V7                                     Do the Dishes
## ...              <NA>                                              <NA>
## V72               V72                                    Do the Ironing
## V73               V73                                    Do the Laundry
## V74               V74                                    Put on Make-up
## MR1               MR1                                  Femininity Scale
## MR2               MR2                                 Masculinity Scale
## Femininity Femininity                                  Femininity Scale
## Masulinity Masulinity                                 Masculinity Scale
## MF                 MF                                      Pooled Scale

Although Athenstaedt gave 76 items, her subsequent analysis just used 53 of these. We select those items and then do some basic analysis.

One of those items “put on make up” shows a much bigger effect size than any of the others, and we drop it to make the data more reasonable.

select <- c("V1", "V2", "V10", "V12", "V15", "V17", "V18", "V19", "V20", 
"V24", "V25", "V27", "V37", "V50", "V53", "V58", "V60", "V62", 
"V66", "V67", "V68")

 sel <- which(colnames(ursala.clean) %in% select)

ursala.small <- ursala.clean[-sel]

cd.ursala <- cohen.d(ursala.small[2:55],group= "GESCHL",dictionary=ursala.dictionary)
cd.ursala
## Call: cohen.d(x = ursala.small[2:55], group = "GESCHL", dictionary = ursala.dictionary)
## Cohen d statistic of difference between two means
##     lower effect upper Item                                  Content
## V3   0.04   0.21  0.37   V3                       Paint an Apartment
## V4   0.45   0.62  0.78   V4                             Mow the Lawn
## V5  -0.65  -0.49 -0.32   V5                             Make the Bed
## V6   0.34   0.51  0.67   V6      Hold the Door Open for your Partner
## V7  -0.84  -0.67 -0.51   V7                            Do the Dishes
## V8   0.31   0.47  0.64   V8                        Do Extreme Sports
## V9   0.78   0.95  1.13   V9                      Tinker with the Car
## V11  0.29   0.45  0.62  V11         Assemble Prefabricated Furniture
## V13 -0.75  -0.59 -0.42  V13             Listen Attentively to Others
## V14 -0.91  -0.74 -0.57  V14 Tell your Partner about Problems at Work
## V16 -0.95  -0.78 -0.61  V16                            Set the Table
## V21 -0.97  -0.80 -0.63  V21                        Watch Soap Operas
## V22 -0.60  -0.44 -0.27  V22                       Take a Friends Arm
## V23 -1.45  -1.27 -1.09  V23                Wrap Presents Beautifully
## V26  0.01   0.17  0.33  V26                            Work Overtime
## V28 -0.51  -0.34 -0.18  V28                                  Babysit
## V29  1.03   1.21  1.39  V29                             Change Fuses
## V30  0.39   0.55  0.72  V30                            Clean a Drain
## V31 -0.69  -0.53 -0.36  V31                    Take Care of Somebody
## V32  0.90   1.07  1.25  V32                           Do Repair Work
## V33  0.43   0.59  0.76  V33                       Change Light Bulbs
## V34  0.12   0.29  0.45  V34                             Wash the Car
## V35  0.20   0.37  0.53  V35                        Ride a Motorcycle
## V36  0.36   0.53  0.69  V36                   Cook Meat on the Grill
## V38 -1.11  -0.93 -0.76  V38                       Dust the Furniture
## V39  0.46   0.63  0.79  V39                  Buy Electric Appliances
## V40 -0.72  -0.55 -0.38  V40                               Go Dancing
## V41 -0.83  -0.66 -0.49  V41               Go for a Walk through Town
## V42 -0.74  -0.57 -0.41  V42                         Go to the Ballet
## V43 -0.86  -0.69 -0.52  V43                             Hug a Friend
## V44 -1.07  -0.90 -0.73  V44             Do Handiwork (e.g. Knitting)
## V45 -1.10  -0.92 -0.75  V45                        Change Bed Sheets
## V46 -1.34  -1.16 -0.99  V46                          Sew on a Button
## V47 -1.28  -1.10 -0.93  V47                              Do Aerobics
## V48  0.56   0.73  0.89  V48               Watch Sports on Television
## V49 -0.79  -0.63 -0.46  V49                      Talk about Problems
## V51  0.28   0.45  0.61  V51                      Talk about Politics
## V52 -1.00  -0.83 -0.66  V52                     Take Care of Flowers
## V54  0.64   0.81  0.98  V54                              Shovel Snow
## V55  0.14   0.31  0.47  V55                   Read non-Fiction Books
## V56 -0.07   0.09  0.26  V56                 Organize Company Parties
## V57  0.58   0.75  0.92  V57                 Do Home Improvement Jobs
## V59 -0.69  -0.52 -0.36  V59            Buy a Present for a Colleague
## V61 -0.88  -0.72 -0.55  V61                                 Make Jam
## V63 -0.96  -0.79 -0.62  V63         Decorate the Office with Flowers
## V64  0.44   0.61  0.78  V64                  Pick up the Dinner Bill
## V65 -0.55  -0.38 -0.22  V65                      Shop for the Family
## V69 -0.69  -0.53 -0.36  V69                                     Cook
## V70  0.83   1.00  1.17  V70 Help your Partner Put on His or Her Coat
## V71 -0.91  -0.74 -0.57  V71                             Wash Windows
## V72 -1.42  -1.24 -1.06  V72                           Do the Ironing
## V73 -1.27  -1.10 -0.92  V73                           Do the Laundry
## V74 -2.52  -2.31 -2.10  V74                           Put on Make-up
## 
## Multivariate (Mahalanobis) distance between groups
## [1] 4
## r equivalent of difference between two means
##    V3    V4    V5    V6    V7    V8    V9   V11   V13   V14   V16   V21   V22   V23   V26   V28 
##  0.10  0.29 -0.24  0.24 -0.32  0.23  0.43  0.22 -0.28 -0.35 -0.36 -0.37 -0.21 -0.53  0.08 -0.17 
##   V29   V30   V31   V32   V33   V34   V35   V36   V38   V39   V40   V41   V42   V43   V44   V45 
##  0.52  0.27 -0.25  0.47  0.28  0.14  0.18  0.25 -0.42  0.30 -0.26 -0.31 -0.28 -0.33 -0.41 -0.42 
##   V46   V47   V48   V49   V51   V52   V54   V55   V56   V57   V59   V61   V63   V64   V65   V69 
## -0.50 -0.48  0.34 -0.30  0.22 -0.38  0.38  0.15  0.05  0.35 -0.25 -0.34 -0.36  0.29 -0.19 -0.25 
##   V70   V71   V72   V73   V74 
##  0.45 -0.35 -0.53 -0.48 -0.76
#note that we just want column 2
cd.ursala1 <- cohen.d(ursala.small[2:54],group= "GESCHL",dictionary=ursala.dictionary[,2, drop=FALSE], sort="descending")
## Warning in xtfrm.data.frame(x): cannot xtfrm data frames
cd.ursala1
## Call: cohen.d(x = ursala.small[2:54], group = "GESCHL", sort = "descending", 
##     dictionary = ursala.dictionary[, 2, drop = FALSE])
## Cohen d statistic of difference between two means
##     lower effect upper                                  Content
## V29  1.03   1.21  1.39                             Change Fuses
## V32  0.90   1.07  1.25                           Do Repair Work
## V70  0.83   1.00  1.17 Help your Partner Put on His or Her Coat
## V9   0.78   0.95  1.13                      Tinker with the Car
## V54  0.64   0.81  0.98                              Shovel Snow
## V57  0.58   0.75  0.92                 Do Home Improvement Jobs
## V48  0.56   0.73  0.89               Watch Sports on Television
## V39  0.46   0.63  0.79                  Buy Electric Appliances
## V4   0.45   0.62  0.78                             Mow the Lawn
## V64  0.44   0.61  0.78                  Pick up the Dinner Bill
## V33  0.43   0.59  0.76                       Change Light Bulbs
## V30  0.39   0.55  0.72                            Clean a Drain
## V36  0.36   0.53  0.69                   Cook Meat on the Grill
## V6   0.34   0.51  0.67      Hold the Door Open for your Partner
## V8   0.31   0.47  0.64                        Do Extreme Sports
## V11  0.29   0.45  0.62         Assemble Prefabricated Furniture
## V51  0.28   0.45  0.61                      Talk about Politics
## V35  0.20   0.37  0.53                        Ride a Motorcycle
## V55  0.14   0.31  0.47                   Read non-Fiction Books
## V34  0.12   0.29  0.45                             Wash the Car
## V3   0.04   0.21  0.37                       Paint an Apartment
## V26  0.01   0.17  0.33                            Work Overtime
## V56 -0.07   0.09  0.26                 Organize Company Parties
## V28 -0.51  -0.34 -0.18                                  Babysit
## V65 -0.55  -0.38 -0.22                      Shop for the Family
## V22 -0.60  -0.44 -0.27                       Take a Friends Arm
## V5  -0.65  -0.49 -0.32                             Make the Bed
## V59 -0.69  -0.52 -0.36            Buy a Present for a Colleague
## V31 -0.69  -0.53 -0.36                    Take Care of Somebody
## V69 -0.69  -0.53 -0.36                                     Cook
## V40 -0.72  -0.55 -0.38                               Go Dancing
## V42 -0.74  -0.57 -0.41                         Go to the Ballet
## V13 -0.75  -0.59 -0.42             Listen Attentively to Others
## V49 -0.79  -0.63 -0.46                      Talk about Problems
## V41 -0.83  -0.66 -0.49               Go for a Walk through Town
## V7  -0.84  -0.67 -0.51                            Do the Dishes
## V43 -0.86  -0.69 -0.52                             Hug a Friend
## V61 -0.88  -0.72 -0.55                                 Make Jam
## V14 -0.91  -0.74 -0.57 Tell your Partner about Problems at Work
## V71 -0.91  -0.74 -0.57                             Wash Windows
## V16 -0.95  -0.78 -0.61                            Set the Table
## V63 -0.96  -0.79 -0.62         Decorate the Office with Flowers
## V21 -0.97  -0.80 -0.63                        Watch Soap Operas
## V52 -1.00  -0.83 -0.66                     Take Care of Flowers
## V44 -1.07  -0.90 -0.73             Do Handiwork (e.g. Knitting)
## V45 -1.10  -0.92 -0.75                        Change Bed Sheets
## V38 -1.11  -0.93 -0.76                       Dust the Furniture
## V73 -1.27  -1.10 -0.92                           Do the Laundry
## V47 -1.28  -1.10 -0.93                              Do Aerobics
## V46 -1.34  -1.16 -0.99                          Sew on a Button
## V72 -1.42  -1.24 -1.06                           Do the Ironing
## V23 -1.45  -1.27 -1.09                Wrap Presents Beautifully
## 
## Multivariate (Mahalanobis) distance between groups
## [1] 3.6
## r equivalent of difference between two means
##    V3    V4    V5    V6    V7    V8    V9   V11   V13   V14   V16   V21   V22   V23   V26   V28 
##  0.10  0.29 -0.24  0.24 -0.32  0.23  0.43  0.22 -0.28 -0.35 -0.36 -0.37 -0.21 -0.53  0.08 -0.17 
##   V29   V30   V31   V32   V33   V34   V35   V36   V38   V39   V40   V41   V42   V43   V44   V45 
##  0.52  0.27 -0.25  0.47  0.28  0.14  0.18  0.25 -0.42  0.30 -0.26 -0.31 -0.28 -0.33 -0.41 -0.42 
##   V46   V47   V48   V49   V51   V52   V54   V55   V56   V57   V59   V61   V63   V64   V65   V69 
## -0.50 -0.48  0.34 -0.30  0.22 -0.38  0.38  0.15  0.05  0.35 -0.25 -0.34 -0.36  0.29 -0.19 -0.25 
##   V70   V71   V72   V73 
##  0.45 -0.35 -0.53 -0.48
error.dots(cd.ursala1,head=26,tail=26,main="Athenstaedt's Behavioral Data - Effect sizes and standard errors")
abline(v=0)

Identify two dimensions of the scales

Do a factor analysis, show the items, then choose those items that have their highest loadings on each factor.

We need to hand fix these because one item is mis-classified.

f2 <- fa(ursala.small[3:54],2)   #this drops the make up item
## Loading required namespace: GPArotation
 fa.lookup(f2, dictionary=ursala.dictionary)
##       MR1   MR2  com   h2 Item                                  Content
## V46  0.72  0.01 1.00 0.52  V46                          Sew on a Button
## V45  0.71 -0.02 1.00 0.51  V45                        Change Bed Sheets
## V72  0.68 -0.08 1.03 0.48  V72                           Do the Ironing
## V38  0.66 -0.01 1.00 0.44  V38                       Dust the Furniture
## V71  0.65  0.15 1.10 0.43  V71                             Wash Windows
## V16  0.65  0.07 1.02 0.41  V16                            Set the Table
## V73  0.64 -0.07 1.02 0.42  V73                           Do the Laundry
## V52  0.60  0.06 1.02 0.36  V52                     Take Care of Flowers
## V7   0.56 -0.03 1.01 0.32   V7                            Do the Dishes
## V23  0.53 -0.21 1.30 0.34  V23                Wrap Presents Beautifully
## V5   0.52  0.07 1.04 0.27   V5                             Make the Bed
## V69  0.51  0.00 1.00 0.26  V69                                     Cook
## V61  0.49  0.10 1.08 0.24  V61                                 Make Jam
## V65  0.49  0.21 1.37 0.27  V65                      Shop for the Family
## V31  0.49  0.11 1.10 0.24  V31                    Take Care of Somebody
## V63  0.47  0.00 1.00 0.23  V63         Decorate the Office with Flowers
## V44  0.46 -0.10 1.09 0.23  V44             Do Handiwork (e.g. Knitting)
## V47  0.45 -0.19 1.36 0.25  V47                              Do Aerobics
## V43  0.41 -0.08 1.08 0.18  V43                             Hug a Friend
## V41  0.39 -0.12 1.19 0.17  V41               Go for a Walk through Town
## V14  0.39 -0.12 1.20 0.17  V14 Tell your Partner about Problems at Work
## V28  0.38  0.12 1.21 0.15  V28                                  Babysit
## V49  0.34 -0.13 1.28 0.14  V49                      Talk about Problems
## V59  0.34  0.02 1.01 0.11  V59            Buy a Present for a Colleague
## V42  0.34 -0.04 1.03 0.12  V42                         Go to the Ballet
## V13  0.33 -0.13 1.29 0.13  V13             Listen Attentively to Others
## V22  0.29 -0.04 1.04 0.09  V22                       Take a Friends Arm
## V40  0.23 -0.07 1.19 0.06  V40                               Go Dancing
## V32 -0.09  0.77 1.03 0.62  V32                           Do Repair Work
## V29 -0.11  0.74 1.04 0.58  V29                             Change Fuses
## V54  0.02  0.66 1.00 0.43  V54                              Shovel Snow
## V57  0.00  0.65 1.00 0.42  V57                 Do Home Improvement Jobs
## V30  0.10  0.63 1.05 0.40  V30                            Clean a Drain
## V4   0.06  0.62 1.02 0.38   V4                             Mow the Lawn
## V39  0.05  0.59 1.01 0.34  V39                  Buy Electric Appliances
## V33  0.06  0.58 1.02 0.33  V33                       Change Light Bulbs
## V9  -0.22  0.57 1.28 0.40   V9                      Tinker with the Car
## V36  0.12  0.54 1.10 0.30  V36                   Cook Meat on the Grill
## V11  0.03  0.54 1.01 0.29  V11         Assemble Prefabricated Furniture
## V70 -0.02  0.51 1.00 0.26  V70 Help your Partner Put on His or Her Coat
## V3   0.23  0.51 1.39 0.29   V3                       Paint an Apartment
## V34  0.11  0.48 1.11 0.24  V34                             Wash the Car
## V64 -0.05  0.38 1.03 0.15  V64                  Pick up the Dinner Bill
## V6   0.08  0.36 1.10 0.14   V6      Hold the Door Open for your Partner
## V26  0.10  0.31 1.22 0.10  V26                            Work Overtime
## V48 -0.12  0.31 1.30 0.11  V48               Watch Sports on Television
## V21  0.27 -0.30 1.98 0.17  V21                        Watch Soap Operas
## V35 -0.09  0.28 1.22 0.09  V35                        Ride a Motorcycle
## V56  0.15  0.27 1.53 0.09  V56                 Organize Company Parties
## V8  -0.10  0.27 1.25 0.09   V8                        Do Extreme Sports
## V55  0.05  0.27 1.06 0.07  V55                   Read non-Fiction Books
## V51  0.02  0.26 1.01 0.07  V51                      Talk about Politics
 summary(f2)
## 
## Factor analysis with Call: fa(r = ursala.small[3:54], nfactors = 2)
## 
## Test of the hypothesis that 2 factors are sufficient.
## The degrees of freedom for the model is 1223  and the objective function was  7.23 
## The number of observations was  576  with Chi Square =  4014.92  with prob <  1.9e-293 
## 
## The root mean square of the residuals (RMSA) is  0.06 
## The df corrected root mean square of the residuals is  0.06 
## 
## Tucker Lewis Index of factoring reliability =  0.683
## RMSEA index =  0.063  and the 10 % confidence intervals are  0.061 0.065
## BIC =  -3758.6
##  With factor correlations of 
##       MR1   MR2
## MR1  1.00 -0.08
## MR2 -0.08  1.00
 ursala.keys <- factor2cluster(f2)
 
 
 ursala.keys <- cbind(ursala.keys,ursala.keys[,1] - ursala.keys[,2])  #add a total
 ursala.keys["V21",] <- c(1,0,1)  # a hard patch
 urs.keys <- keys2list(ursala.keys)
 

 names(urs.keys)[3] <- "F+M behavior"
 
  urs.keys  # show them 
## $MR1
##  [1] "V5"  "V7"  "V13" "V14" "V16" "V21" "V22" "V23" "V28" "V31" "V38" "V40" "V41" "V42" "V43" "V44"
## [17] "V45" "V46" "V47" "V49" "V52" "V59" "V61" "V63" "V65" "V69" "V71" "V72" "V73"
## 
## $MR2
##  [1] "V3"  "V4"  "V6"  "V8"  "V9"  "V11" "V26" "V29" "V30" "V32" "V33" "V34" "V35" "V36" "V39" "V48"
## [17] "V51" "V54" "V55" "V56" "V57" "V64" "V70"
## 
## $`F+M behavior`
##  [1] "-V3"  "-V4"  "V5"   "-V6"  "V7"   "-V8"  "-V9"  "-V11" "V13"  "V14"  "V16"  "V21"  "V22" 
## [14] "V23"  "-V26" "V28"  "-V29" "-V30" "V31"  "-V32" "-V33" "-V34" "-V35" "-V36" "V38"  "-V39"
## [27] "V40"  "V41"  "V42"  "V43"  "V44"  "V45"  "V46"  "V47"  "-V48" "V49"  "-V51" "V52"  "-V54"
## [40] "-V55" "-V56" "-V57" "V59"  "V61"  "V63"  "-V64" "V65"  "V69"  "-V70" "V71"  "V72"  "V73"
 urs.scales <- scoreItems(urs.keys,ursala.small)
 #show the basic statistics
 urs.scales
## Call: scoreItems(keys = urs.keys, items = ursala.small)
## 
## (Unstandardized) Alpha:
##       MR1  MR2 F+M behavior
## alpha 0.9 0.88         0.88
## 
## Standard errors of unstandardized Alpha:
##          MR1    MR2 F+M behavior
## ASE   0.0081 0.0099        0.008
## 
## Average item correlation:
##            MR1  MR2 F+M behavior
## average.r 0.24 0.24         0.13
## 
## Median item correlation:
##          MR1          MR2 F+M behavior 
##         0.22         0.21         0.11 
## 
##  Guttman 6* reliability: 
##           MR1  MR2 F+M behavior
## Lambda.6 0.93 0.91         0.92
## 
## Signal/Noise based upon av.r : 
##              MR1 MR2 F+M behavior
## Signal/Noise   9 7.2          7.6
## 
## Scale intercorrelations corrected for attenuation 
##  raw correlations below the diagonal, alpha on the diagonal 
##  corrected correlations above the diagonal:
##                 MR1    MR2 F+M behavior
## MR1           0.900 -0.092         0.89
## MR2          -0.082  0.877        -0.77
## F+M behavior  0.789 -0.677         0.88
## 
##  In order to see the item by scale loadings and frequency counts of the data
##  print with the short option = FALSE
 expand.ursala <- data.frame(ursala.small[2:54],urs.scales$scores)

What are the Cohen.d values for our scales?

Use the ’cohen.d function for just those scale values.

cd.scales <- cohen.d(expand.ursala[c(1,54,55,56)],"GESCHL")
cd.scales
## Call: cohen.d(x = expand.ursala[c(1, 54, 55, 56)], group = "GESCHL")
## Cohen d statistic of difference between two means
##              lower effect upper
## MR1          -2.02  -1.82 -1.63
## MR2           1.06   1.24  1.42
## F.M.behavior -3.12  -2.89 -2.65
## 
## Multivariate (Mahalanobis) distance between groups
## [1] 2.9
## r equivalent of difference between two means
##          MR1          MR2 F.M.behavior 
##        -0.67         0.53        -0.82

Some basic psychometrics

We want to find the reliabilities of our new scales. We will call the ‘reliability’ function which in turn calls multiple reliability functions (omega, splitHalf). Note that the ‘alpha’ values match what we found when we used ‘scoreItems’.

rel <- reliability(urs.keys,expand.ursala)


ursala.average.cd <- cd.validity(cd.ursala,urs.keys)

ursala.validity <- cor(expand.ursala[c(1,54:56)])[1,2:4]
 ursala.item.validity <-  item.validity(expand.ursala,expand.ursala[,"GESCHL"],urs.keys)
 
 ursala.validity <- cor(expand.ursala[c(1,54:56)])[1,2:4]
 
 
  rel
## Measures of reliability 
## reliability(keys = urs.keys, items = expand.ursala)
##              omega_h alpha omega.tot  Uni r.fit fa.fit max.split min.split mean.r med.r n.items
## MR1             0.57  0.90      0.91 0.74  0.81   0.91      0.94      0.78   0.24  0.22      29
## MR2             0.70  0.87      0.89 0.73  0.78   0.94      0.92      0.78   0.23  0.21      23
## F+M behavior    0.13  0.88      0.90 0.22  0.39   0.56      0.93      0.66   0.13  0.11      52
 ursala.average.cd  #in d units
##                    [,1]
## MR1          -0.7453770
## MR2           0.5815288
## F+M behavior -0.6729057
 ursala.item.validity # in r units
##                    [,1]
## MR1          -0.3422164
## MR2           0.2713089
## F+M behavior -0.3108535

Predicted validity

Eagly and Revelle (2022) suggest that the predicted validity of a scale is the average item validity/sqrt(average within scale correlation)

The ‘predicted.validity’ function does this.

predicted <- predicted.validity(expand.ursala,expand.ursala[,"GESCHL"],urs.keys)
predicted   #asymptotic values are the most we can expect 
## Call: predicted.validity(x = expand.ursala, criteria = expand.ursala[, 
##     "GESCHL"], keys = urs.keys)
## 
## Predicted Asymptotic Scale Validity:
##               [,1]
## MR1          -0.70
## MR2           0.56
## F+M behavior -0.88
## 
##  For predicted scale validities, average item validities, or scale reliabilities, print the separate objects
predicted$predicted  # compare these with what we actually observed
##                    [,1]
## MR1          -0.6675261
## MR2           0.5253957
## F+M behavior -0.8226188
ursala.validity  #the correlations with the criterion
##          MR1          MR2 F.M.behavior 
##   -0.6722222    0.5270454   -0.8213784

Organize a data frame of results

This is the table to put into the manuscript. It is interesting to compare the average absolute effect size (.67) with what we get for the pooled values (2.89).

table.df <- data.frame(k=rel$result.df[,11],
      rel$result.df[,c(1:3,9)], item.val=ursala.item.validity,   scale=ursala.validity,
      predicted = predicted$predicted, average.cd = ursala.average.cd, cd=cd.scales$cohen.d[,"effect"] )
  round(table.df,2)
##               k omega_h alpha omega.tot mean.r item.val scale predicted average.cd    cd
## MR1          29    0.57  0.90      0.91   0.24    -0.34 -0.67     -0.67      -0.75 -1.82
## MR2          23    0.70  0.87      0.89   0.23     0.27  0.53      0.53       0.58  1.24
## F+M behavior 52    0.13  0.88      0.90   0.13    -0.31 -0.82     -0.82      -0.67 -2.89
mean(abs(cd.ursala1$cohen.d[,"effect"]))  #how big is the average absolute effect size?
## [1] 0.6729057

Now do the final graphics

cd.items <- cohen.d(expand.ursala[-56] , group = "GESCHL",dictionary=ursala.dictionary[,2,drop=FALSE])

 error.dots(cd.items,head=30,tail=30, main="Athenstaedt’s Behavioral Data \n Items and Scales",
    select=2:53)
 error.dots(cd.items,head=30,tail=30, main="Athenstaedt’s Behavioral Data \n Items and Scales",
    select=c(1,54), color='red', fg="red", add=TRUE)
abline(v=0)

As well as the scatter histogram

scatterHist(MR1~  MR2 + GESCHL, data=expand.ursala[1:55],cex.point=.4,smooth=FALSE,
       xlab="Masculine Scale",ylab="Feminine Scale",
                      correl=FALSE,d.arrow=TRUE,col=c("red","blue"), lwd=4,
                      cex.main=1.5,main="Scatter Plot and Density",cex.axis=2)