Codebook tutorial

Ruben Arslan

2019-05-21

This is the practical part of a tutorial manuscript for this package, which you can find in full on PsyArXiv.

Using the codebook package locally in RStudio

knit_by_pkgdown <- !is.null(knitr::opts_chunk$get("fig.retina"))
knitr::opts_chunk$set(
  warning = TRUE, # show warnings during codebook generation
  message = TRUE, # show messages during codebook generation
  error = TRUE, # do not interrupt codebook generation in case of errors,
                # usually better for debugging
  echo = TRUE  # show R code
)
ggplot2::theme_set(ggplot2::theme_bw())
pander::panderOptions("table.split.table", Inf)

Loading data

It is time to load some data. In this Tutorial, I will walk you through the process by using the “bfi” dataset made available in the psych package (Goldberg, 1999; Revelle et al., 2016; Revelle, Wilt, & Rosenthal, 2010). The bfi dataset is already very well documented in the psych R package, but using the codebook package, we can add automatically computed reliabilities, graphs, and machine-readable metadata to the mix. The dataset is available within R, but this will not usually be the case; I have therefore uploaded it to the OSF, which also features many other publicly available datasets. A new package in R, rio (Chan & Leeper, 2018), makes loading data from websites in almost any format as easy as loading local data. You can import the dataset directly from the OSF by replacing the line

library(codebook)
codebook_data <- codebook::bfi

with

codebook_data <- rio::import("https://osf.io/s87kd/download", "csv")

on line 34. R Markdown documents have to be reproducible and self-contained, so it is not enough for a dataset to be loaded locally; you must load the dataset at the beginning of the document. You can also use the document interactively, although this will not work seamlessly for the codebook package. To see how this works, execute the line you just added by pressing Command + Enter (for a Mac) or Ctrl + Enter (for other platforms).

RStudio has a convenient data viewer you can use to check whether your command worked. In the environment tab on the top right, you should see “codebook_data”. Click that row to open a spreadsheet view of the dataset in RStudio. As you can see, it is not particularly informative. Just long columns of numbers with variable names like A4. Are we talking aggressiveness, agreeableness, or the German industrial norm for paper size? The lack of useful metadata is palpable. Click “Knit” again to see what the codebook package can do with this. This time, it will take longer. Once the result is shown in the viewer tab, scroll through it. You can see a few warnings stating that the package saw items that might form part of a scale, but there was no aggregated scale. You will also see graphs of the distribution for each item and summary statistics.

Adding and changing metadata

Variable labels

The last codebook you generated could already be useful if the variables had meaningful names and self-explanatory values. Unfortunately, this is rarely the case. Generally, you will need more metadata: labels for variables and values, a dataset description, and so on. The codebook package can use metadata that are stored in R attributes. Attributes in R are most commonly used to store the type of a variable; for instance, datetime in R is just a number with two attributes (a time zone and a class). However, they can just as easily store other metadata; the Hmisc (Harrell, 2018), haven (Wickham & Miller, 2018), and rio (Chan & Leeper, 2018) packages, for example, use attributes to store labels. The benefit of storing variable metadata in attributes is that even datasets that are the product of merging and processing raw data retain the necessary metadata. The haven and rio packages set these attributes when importing data from SPSS or Stata files. However, it is also easy to add metadata yourself:

You have just assigned a new label to a variable. Because it is inconvenient to do this over and over again, the labelled package (Larmarange, 2018) adds a few convenience functions. Load the labelled package by writing the following in your codebook.Rmd

Now label the C5 item.

You can also label values in this manner (label in quotes before the equal sign, value after):

Write these labelling commands after loading the dataset and click “Knit” again. As you can see in the viewer pane, the graph for the C1 variable now has a label at the top and the lowest and highest values on the X axis are labelled. If the prospect of adding labels for every single variable seems tedious, do not fear. Many researchers already have a codebook in the form of a spreadsheet that they want to import in order to avoid entering labels one-by-one. The bfi dataset in the psych package is a good example of this, because it comes with a tabular dictionary. On the line after loading the bfi data, type the following to import this data dictionary:

To see what you just loaded, click the “dict” row in the environment tab in the top right panel. As you can see, the dictionary has information on the constructs on which this item loads and on the direction with which it should load on the construct. You can make these metadata usable through the codebook package. You will often need to work on the data frames to help you do this; to make this easier, use the dplyr package (Wickham, François, Henry, & Müller, 2018). Load it by typing the following

Your next goal is to use the variable labels that are already in the dictionary. Because you want to label many variables at once, you need a list of variable labels. Instead of assigning one label to one variable as you just did, you can assign many labels to the whole dataset from a named list. Here, each element of the list is one item that you want to label.

There are already a list of variables and labels in your data dictionary that you can use, so you do not have to perform the tedious task of writing out the list. You do have to reshape it slightly though, because it is currently in the form of a rectangular data frame, not a named list. To do so, use a convenience function from the codebook function called dict_to_list. This function expects to receive a data frame with two columns: the first should be the variable names, the second the variable labels. To select these columns, use the select function from the dplyr package. You will also need to use a special operator, called a pipe, which looks like this %>% and allows you to read and write R code from left to right, almost like an English sentence. First, you need to take the dict dataset, then select the variable and label columns, then use the dict_to_list function. You also need to assign the result of this operation to become the variable labels of codebook_data. You can do all this in a single line using pipes. Add the following line after importing the dictionary.

Click “codebook_data” in the Environment tab again. You should now see the variable labels below the variable names. If you click “Knit” again, you will see that your codebook now contains the variable labels. They are both part of the plots and part of the codebook table at the end. They are also part of the metadata that can be found using, for example, Google Dataset Search, but this will not be visible to you.

Value labels

So far, so good. But you may have noticed that education is shown as a number. Does this indicate years of education? The average is 3, so that seems unlikely. In fact, these numbers signify levels of education. In the dict data frame, you can see that there are are value labels for the levels of this variable. However, these levels of education are abbreviated, and you can probably imagine that it would be difficult for an automated program to understand how these map to the values in your dataset. You can do better, using another function from the labelled package: not var_label this time, but val_labels. Unlike var_label, val_labels expects not just one label, but a named vector, with a name for each value that you want to label. You do not need to label all values. Named vectors are created using the c() function. Add the following lines right after the last one.

Click the “Knit” button. The bars in the graphs for education and gender should now be labelled. Now, on to the many Likert items, which all have the same value labels. You could assign them in the same way you did for gender and education, entering the lines for each variable over and over, or you could let a function do the job for you instead. Creating a function is actually very simple. Just pick a name, ideally one to remember it by—I chose add_likert_labels—and assign the keyword function followed by two different kinds of brackets. Round brackets surround the variable x. The x here is a placeholder for the many variables you will use this function for in the next step. Curly braces show that you intend to write out what you plan to do with the variable x. Inside the curly braces, use the val_labels function from above and assign a named vector.

A function is just a tool and does nothing on its own; you have not used it yet. To use it only on the Likert items, you need a list of them. An easy way to achieve this is to subset the dict dataframe to only take those variables that are part of the Big Six. To do so, use the filter and pull functions from the dplyr package.

To apply your new function to these items, use another function from the dplyr package called mutate_at. It expects a list of variables and a function to apply to each. You have both! You can now add value labels to all Likert items in the codebook_data.

Click “Knit” again. All items should now have value labels. However, this display is quite repetitive. How about grouping the items by the factor that they are supposed to load on? And while you are at it, how can the metadata about keying (or reverse-coded items) in your dictionary become part of the dataset?

Adding scales

The codebook package relies on a simple convention to be able to summarise psychological scales, such as the Big Five dimension extraversion, which are aggregates across several items. Your next step will be to assign a new variable, extraversion, to the result of selecting all extraversion items in the data and passing them to the aggregate_and_document_scale function. This function takes the mean of its inputs and assigns a label to the result, so that you can still tell which variables it is an aggregate of.

Try knitting now. In the resulting codebook, the items for extraversion have been grouped in one graph. In addition, several internal consistency coefficients have been calculated. However, they are oddly low. You need to reverse items which negatively load on the extraversion factor, such as “Don’t talk a lot.” To do so, I suggest following a simple convention early on, when you come up with names for your items—namely the format scale_numberR (e.g., bfi_extra_1R for a reverse-coded extraversion item, bfi_neuro_2 for a neuroticism item). That way, the analyst always knows how an item relates to a scale. This information is encoded in the data dictionary from the data you just imported. Rename the reverse-coded items so that you cannot forget about its direction. First, you need to grab all items with a negative keying from your dictionary. Add the following three lines above the aggregate_and_document_scale() line from above.

You can see in your Environment tab that names such as A1, C4, and C5 are now stored in the reversed_items vector. You can now refer to this vector using the rename_at function, which applies a function to all variables you list. Use the very simple function add_R, which does exactly what its name indicates.

Click “codebook_data” in the Environment tab and you will see that some variables have been renamed: A1R, C4R, and C5R, and so on. This could lead to an ambiguity: Does the suffix R means “should be reversed before aggregation” or “has already been reversed”? With the help of metadata in the form of labelled values, there is no potential for confusion. You can reverse the underlying values, but keep the value labels right. So, if somebody responded “Very accurate,” that remains the case, but the underlying value will switch from 6 to 1 for a reversed item. The data you generally import will rarely include labels that remain correct regardless of whether underlying values are reversed, but the codebook package makes it easy to bring the data into this shape. A command using dplyr functions and the reverse_labelled_values function can easily remedy this.

All this statement does is find variable names which end with a number (\d is the regular expression codeword for a number; a dollar sign denotes the end of the string) and R and reverse them. Because the extraversion items have been renamed, we have to amend our scale aggregation line slightly.

Try knitting again. The reliability for the extraversion scale should be much higher and all items should load positively. Adding further scales is easy: Just repeat the above line, changing the names of the scale and the items. Adding scales that integrate smaller scales is also straightforward. The data dictionary mentions the Giant Three—try adding one, Plasticity, which subsumes Extraversion and Openness.

Note that writing E1R:E5 only works if the items are all in order in your dataset. If you mixed items across constructs, you will need a different way to select them. One option is to list all items, writing select(E1R, E2R, E3, E4, E5). This can get tedious when listing many items. Another solution is to write select(starts_with("E")). Although this is quite elegant, it will not work in this case because you have more than one variable that starts with E; this command would include education items along with the extraversion items you want. This is a good reason to give items descriptive stems such as extraversion_ or bfik_extra. Longer stems not only make confusion less likely, they also make it possible for you to refer to groups of items by their stems, and ideally to their aggregates by only the stem. If you have already named your item too minimally, another solution is to use a regular expression, as I introduced above for matching reversed items. In this scenario, select(matches("^E\\dR?$")) would work.

Metadata about the entire dataset

Finally, you might want to sign your work and add a few descriptive words about the entire dataset. If you simply edit the R Markdown document to add a description, this information would not become part of the machine-readable metadata. Metadata (or attributes) of the dataset as a whole are a lot less persistent than metadata about variables. Hence, you should add your description right before calling the codebook function. Adding metadata about the dataset is very simple: Just wrap the metadata function around codebook_data and assign a value to a field. The fields “name” and “description” are required. If you do not edit them, they will be automatically generated based on the data frame name and its contents. To overwrite them, enter the following lines above the call codebook(codebook_data):

metadata(codebook_data)$name <- "25 Personality items representing 5 factors"
metadata(codebook_data)$description <- "25 personality self report items taken from the International Personality Item Pool (ipip.ori.org)[...]"

It is good practice to give datasets a canonical identifier. This way, if a dataset is described in multiple locations, it can still be identified as the same dataset. For instance, when I did this I did not want to use the URL of the R package from which I took the package because URLs can change; instead, I generated a persistent document object identifier (DOI) on the OSF and specified it here.

metadata(codebook_data)$identifier <- "https://dx.doi.org/10.17605/OSF.IO/K39BG"

In order to let others know who they can contact about the dataset, how to cite it, and where to find more information, I set the attributes creator, citation, and URL below.

metadata(codebook_data)$creator <- "William Revelle"
metadata(codebook_data)$citation <- "Revelle, W., Wilt, J., & Rosenthal, A. (2010). Individual differences in cognition: New methods for examining the personality-cognition link. In A. Gruszka, G. Matthews, & B. Szymura (Eds.), Handbook of individual differences in cognition: Attention, memory, and executive control (pp. 27–49). New York, NY: Springer."
metadata(codebook_data)$url <- "https://CRAN.R-project.org/package=psych"

Lastly, it is useful to note when and where the data was collected, as well as when it was published. Ideally, you would make more specific information available here, but this is all I know about the BFI dataset.

metadata(codebook_data)$datePublished <- "2010-01-01"
metadata(codebook_data)$temporalCoverage <- "Spring 2010" 
metadata(codebook_data)$spatialCoverage <- "Online" 

These attributes are documented in more depth on https://schema.org/Dataset. You can also add attributes that are not documented there, but they will not become part of the machine-readable metadata. Click “Knit” again. In the viewer tab, you can see that the metadata section of the codebook has been populated with your additions.

Exporting and sharing the data with metadata

Having added all the variable-level metadata, you might want to re-use the marked-up data elsewhere or share it with collaborators or the public. You can most easily export it using the rio package (Chan & Leeper, 2018), which permits embedding the variable metadata in the dataset file for those formats that support it. The only way to keep all metadata in one file is by staying in R:

rio::export(codebook_data, "bfi.rds") # to R data structure file

The variable-level metadata can also be transferred to SPSS and Stata files. Please note that this export is based on reverse-engineering the SPSS and Stata file structure, so the resulting files should be tested before sharing.

rio::export(codebook_data, "bfi.sav") # to SPSS file
rio::export(codebook_data, "bfi.dta") # to Stata file

Releasing the codebook publicly

If you want to share your codebook with others, there is a codebook.html file in the project folder you created at the start. You can email it to collaborators or upload it to the OSF file storage. However, if you want Google Dataset Search to index your dataset, this is not sufficient. The OSF will not render your HTML files for security reasons and Google will not index the content of your emails (at least not publicly). You need to post your codebook online. If you are familiar with Github or already have your own website, uploading the html file to your own website should be easy. The simplest way I found for publishing the HTML for the codebook is as follows. First, rename the codebook.html to index.html. Then create an account on netlify.com. Once you’re signed in, drag and drop the folder containing the codebook to the Netlify web page (make sure the folder does not contain anything you do not want to share, such as raw data). Netlify will upload the files and create a random URL like estranged-armadillo.netlify.com. You can change this to something more meaningful, like bfi-study.netlify.com, in the settings. Next, visit the URL to check that you can see the codebook. The last step is to publicly share a link to the codebook so that search engines can discover it; for instance, you could tweet the link with the hashtag #codebook2—ideally with a link from the repository where you are sharing the raw data or the related study’s supplementary material. For instance, I added a link to the bfi-study codebook on the OSF (https://osf.io/k39bg/), where I had also shared the data. Depending on the speed of the search engine crawler, the dataset should be findable on Google Dataset Search in anywhere from three to 21 days.

The Codebook

Metadata

Description

Dataset name: 25 Personality items representing 5 factors

25 personality self report items taken from the International Personality Item Pool (ipip.ori.org)[…]

Metadata for search engines

  • Temporal Coverage: Spring 2010
  • Spatial Coverage: Online
  • Citation: Revelle, W., Wilt, J., & Rosenthal, A. (2010). Individual differences in cognition: New methods for examining the personality-cognition link. In A. Gruszka, G. Matthews, & B. Szymura (Eds.), Handbook of individual differences in cognition: Attention, memory, and executive control (pp. 27–49). New York, NY: Springer.
  • URL: https://CRAN.R-project.org/package=psych
  • Identifier: https://dx.doi.org/10.17605/OSF.IO/K39BG
  • Date published: 2010-01-01

  • Creator:William Revelle

    • keywords: A1R, A2, A3, A4, A5, C1, C2, C3, C4R, C5R, E1R, E2R, E3, E4, E5, N1R, N2R, N3R, N4R, N5R, O1, O2R, O3, O4, O5R, gender, education, age, extraversion and plasticity

Variables

A1R

Am indifferent to the feelings of others.

Distribution

16 missing values.

Summary statistics
name label data_type value_labels missing complete n mean sd p0 p25 p50 p75 p100 hist
A1R Am indifferent to the feelings of others. numeric 6. Very Inaccurate,
5. Moderately Inaccurate,
4. Slightly Inaccurate,
3. Slightly Accurate,
2. Moderately Accurate,
1. Very Accurate
16 2784 2800 4.59 1.41 1 4 5 6 6 ▁▂▁▃▃▁▇▇
Value labels
  • Very Inaccurate: 6
  • Moderately Inaccurate: 5
  • Slightly Inaccurate: 4
  • Slightly Accurate: 3
  • Moderately Accurate: 2
  • Very Accurate: 1

A2

Inquire about others’ well-being.

Distribution

27 missing values.

Summary statistics
name label data_type value_labels missing complete n mean sd p0 p25 p50 p75 p100 hist
A2 Inquire about others’ well-being. integer 1. Very Inaccurate,
2. Moderately Inaccurate,
3. Slightly Inaccurate,
4. Slightly Accurate,
5. Moderately Accurate,
6. Very Accurate
27 2773 2800 4.8 1.17 1 4 5 6 6 ▁▁▁▁▅▁▇▇
Value labels
  • Very Inaccurate: 1
  • Moderately Inaccurate: 2
  • Slightly Inaccurate: 3
  • Slightly Accurate: 4
  • Moderately Accurate: 5
  • Very Accurate: 6

A3

Know how to comfort others.

Distribution

26 missing values.

Summary statistics
name label data_type value_labels missing complete n mean sd p0 p25 p50 p75 p100 hist
A3 Know how to comfort others. integer 1. Very Inaccurate,
2. Moderately Inaccurate,
3. Slightly Inaccurate,
4. Slightly Accurate,
5. Moderately Accurate,
6. Very Accurate
26 2774 2800 4.6 1.3 1 4 5 6 6 ▁▂▁▂▅▁▇▆
Value labels
  • Very Inaccurate: 1
  • Moderately Inaccurate: 2
  • Slightly Inaccurate: 3
  • Slightly Accurate: 4
  • Moderately Accurate: 5
  • Very Accurate: 6

A4

Love children.

Distribution

19 missing values.

Summary statistics
name label data_type value_labels missing complete n mean sd p0 p25 p50 p75 p100 hist
A4 Love children. integer 1. Very Inaccurate,
2. Moderately Inaccurate,
3. Slightly Inaccurate,
4. Slightly Accurate,
5. Moderately Accurate,
6. Very Accurate
19 2781 2800 4.7 1.48 1 4 5 6 6 ▁▂▁▁▃▁▅▇
Value labels
  • Very Inaccurate: 1
  • Moderately Inaccurate: 2
  • Slightly Inaccurate: 3
  • Slightly Accurate: 4
  • Moderately Accurate: 5
  • Very Accurate: 6

A5

Make people feel at ease.

Distribution

16 missing values.

Summary statistics
name label data_type value_labels missing complete n mean sd p0 p25 p50 p75 p100 hist
A5 Make people feel at ease. integer 1. Very Inaccurate,
2. Moderately Inaccurate,
3. Slightly Inaccurate,
4. Slightly Accurate,
5. Moderately Accurate,
6. Very Accurate
16 2784 2800 4.56 1.26 1 4 5 5 6 ▁▂▁▂▅▁▇▆
Value labels
  • Very Inaccurate: 1
  • Moderately Inaccurate: 2
  • Slightly Inaccurate: 3
  • Slightly Accurate: 4
  • Moderately Accurate: 5
  • Very Accurate: 6

C1

Am exacting in my work.

Distribution

21 missing values.

Summary statistics
name label data_type value_labels missing complete n mean sd p0 p25 p50 p75 p100 hist
C1 Am exacting in my work. integer 1. Very Inaccurate,
2. Moderately Inaccurate,
3. Slightly Inaccurate,
4. Slightly Accurate,
5. Moderately Accurate,
6. Very Accurate
21 2779 2800 4.5 1.24 1 4 5 5 6 ▁▁▁▂▅▁▇▅
Value labels
  • Very Inaccurate: 1
  • Moderately Inaccurate: 2
  • Slightly Inaccurate: 3
  • Slightly Accurate: 4
  • Moderately Accurate: 5
  • Very Accurate: 6

C2

Continue until everything is perfect.

Distribution

24 missing values.

Summary statistics
name label data_type value_labels missing complete n mean sd p0 p25 p50 p75 p100 hist
C2 Continue until everything is perfect. integer 1. Very Inaccurate,
2. Moderately Inaccurate,
3. Slightly Inaccurate,
4. Slightly Accurate,
5. Moderately Accurate,
6. Very Accurate
24 2776 2800 4.37 1.32 1 4 5 5 6 ▁▂▁▂▆▁▇▅
Value labels
  • Very Inaccurate: 1
  • Moderately Inaccurate: 2
  • Slightly Inaccurate: 3
  • Slightly Accurate: 4
  • Moderately Accurate: 5
  • Very Accurate: 6

C3

Do things according to a plan.

Distribution

20 missing values.

Summary statistics
name label data_type value_labels missing complete n mean sd p0 p25 p50 p75 p100 hist
C3 Do things according to a plan. integer 1. Very Inaccurate,
2. Moderately Inaccurate,
3. Slightly Inaccurate,
4. Slightly Accurate,
5. Moderately Accurate,
6. Very Accurate
20 2780 2800 4.3 1.29 1 4 5 5 6 ▁▂▁▂▆▁▇▅
Value labels
  • Very Inaccurate: 1
  • Moderately Inaccurate: 2
  • Slightly Inaccurate: 3
  • Slightly Accurate: 4
  • Moderately Accurate: 5
  • Very Accurate: 6

C4R

Do things in a half-way manner.

Distribution

26 missing values.

Summary statistics
name label data_type value_labels missing complete n mean sd p0 p25 p50 p75 p100 hist
C4R Do things in a half-way manner. numeric 6. Very Inaccurate,
5. Moderately Inaccurate,
4. Slightly Inaccurate,
3. Slightly Accurate,
2. Moderately Accurate,
1. Very Accurate
26 2774 2800 4.45 1.38 1 3 5 6 6 ▁▂▁▅▅▁▇▇
Value labels
  • Very Inaccurate: 6
  • Moderately Inaccurate: 5
  • Slightly Inaccurate: 4
  • Slightly Accurate: 3
  • Moderately Accurate: 2
  • Very Accurate: 1

C5R

Waste my time.

Distribution

16 missing values.

Summary statistics
name label data_type value_labels missing complete n mean sd p0 p25 p50 p75 p100 hist
C5R Waste my time. numeric 6. Very Inaccurate,
5. Moderately Inaccurate,
4. Slightly Inaccurate,
3. Slightly Accurate,
2. Moderately Accurate,
1. Very Accurate
16 2784 2800 3.7 1.63 1 2 4 5 6 ▃▆▁▇▅▁▇▆
Value labels
  • Very Inaccurate: 6
  • Moderately Inaccurate: 5
  • Slightly Inaccurate: 4
  • Slightly Accurate: 3
  • Moderately Accurate: 2
  • Very Accurate: 1

N1R

Get angry easily.

Distribution

22 missing values.

Summary statistics
name label data_type value_labels missing complete n mean sd p0 p25 p50 p75 p100 hist
N1R Get angry easily. numeric 6. Very Inaccurate,
5. Moderately Inaccurate,
4. Slightly Inaccurate,
3. Slightly Accurate,
2. Moderately Accurate,
1. Very Accurate
22 2778 2800 4.07 1.57 1 3 4 5 6 ▂▅▁▆▅▁▇▇
Value labels
  • Very Inaccurate: 6
  • Moderately Inaccurate: 5
  • Slightly Inaccurate: 4
  • Slightly Accurate: 3
  • Moderately Accurate: 2
  • Very Accurate: 1

N2R

Get irritated easily.

Distribution

21 missing values.

Summary statistics
name label data_type value_labels missing complete n mean sd p0 p25 p50 p75 p100 hist
N2R Get irritated easily. numeric 6. Very Inaccurate,
5. Moderately Inaccurate,
4. Slightly Inaccurate,
3. Slightly Accurate,
2. Moderately Accurate,
1. Very Accurate
21 2779 2800 3.49 1.53 1 2 3 5 6 ▃▆▁▇▅▁▆▃
Value labels
  • Very Inaccurate: 6
  • Moderately Inaccurate: 5
  • Slightly Inaccurate: 4
  • Slightly Accurate: 3
  • Moderately Accurate: 2
  • Very Accurate: 1

N3R

Have frequent mood swings.

Distribution

11 missing values.

Summary statistics
name label data_type value_labels missing complete n mean sd p0 p25 p50 p75 p100 hist
N3R Have frequent mood swings. numeric 6. Very Inaccurate,
5. Moderately Inaccurate,
4. Slightly Inaccurate,
3. Slightly Accurate,
2. Moderately Accurate,
1. Very Accurate
11 2789 2800 3.78 1.6 1 3 4 5 6 ▃▆▁▇▅▁▇▆
Value labels
  • Very Inaccurate: 6
  • Moderately Inaccurate: 5
  • Slightly Inaccurate: 4
  • Slightly Accurate: 3
  • Moderately Accurate: 2
  • Very Accurate: 1

N4R

Often feel blue.

Distribution

36 missing values.

Summary statistics
name label data_type value_labels missing complete n mean sd p0 p25 p50 p75 p100 hist
N4R Often feel blue. numeric 6. Very Inaccurate,
5. Moderately Inaccurate,
4. Slightly Inaccurate,
3. Slightly Accurate,
2. Moderately Accurate,
1. Very Accurate
36 2764 2800 3.81 1.57 1 3 4 5 6 ▃▅▁▇▅▁▇▆
Value labels
  • Very Inaccurate: 6
  • Moderately Inaccurate: 5
  • Slightly Inaccurate: 4
  • Slightly Accurate: 3
  • Moderately Accurate: 2
  • Very Accurate: 1

N5R

Panic easily.

Distribution

29 missing values.

Summary statistics
name label data_type value_labels missing complete n mean sd p0 p25 p50 p75 p100 hist
N5R Panic easily. numeric 6. Very Inaccurate,
5. Moderately Inaccurate,
4. Slightly Inaccurate,
3. Slightly Accurate,
2. Moderately Accurate,
1. Very Accurate
29 2771 2800 4.03 1.62 1 3 4 5 6 ▃▃▁▆▅▁▇▇
Value labels
  • Very Inaccurate: 6
  • Moderately Inaccurate: 5
  • Slightly Inaccurate: 4
  • Slightly Accurate: 3
  • Moderately Accurate: 2
  • Very Accurate: 1

gender

gender

Distribution

0 missing values.

Summary statistics
name label data_type value_labels missing complete n mean sd p0 p25 p50 p75 p100 hist
gender gender integer 1. male,
2. female
0 2800 2800 1.67 0.47 1 1 2 2 2 ▃▁▁▁▁▁▁▇
Value labels
  • male: 1
  • female: 2

education

education

Distribution

223 missing values.

Summary statistics
name label data_type value_labels missing complete n mean sd p0 p25 p50 p75 p100 hist
education education integer 1. in high school,
2. finished high school,
3. some college,
4. college graduate,
5. graduate degree
223 2577 2800 3.19 1.11 1 3 3 4 5 ▂▂▁▇▁▂▁▃
Value labels
  • in high school: 1
  • finished high school: 2
  • some college: 3
  • college graduate: 4
  • graduate degree: 5

age

age

Distribution

0 missing values.

Summary statistics
name label data_type missing complete n mean sd p0 p25 p50 p75 p100 hist
age age integer 0 2800 2800 28.78 11.13 3 20 26 35 86 ▁▇▆▃▂▁▁▁

Scale: extraversion

Overview

Reliability: ωordinal [95% CI] = 0.8 [0.78;0.81].

Missing: 87.

Reliability details
Reliability Indices
Index Estimate
Omega 0.7673
Omega Psych Tot 0.795
Omega Psych H 0.6522
Omega Ordinal 0.795
Cronbach Alpha 0.7609
Greatest Lower Bound 0.7978
Alpha Ordinal 0.7929

Positive correlations: 10 out of 10 (100%)

Scatter matrix

Detailed output

## 
## Information about this analysis:
## 
##                  Dataframe: res$dat
##                      Items: E1R, E2R, E3, E4, E5
##               Observations: 2713
##      Positive correlations: 10 out of 10 (100%)
## 
## Estimates assuming interval level:
## 
##              Omega (total): 0.77
##       Omega (hierarchical): 0.65
##    Revelle's omega (total): 0.8
## Greatest Lower Bound (GLB): 0.8
##              Coefficient H: 0.78
##           Cronbach's alpha: 0.76
## Confidence intervals:
##              Omega (total): [0.75, 0.78]
##           Cronbach's alpha: [0.75, 0.78]
## 
## Estimates assuming ordinal level:
## 
##      Ordinal Omega (total): 0.8
##  Ordinal Omega (hierarch.): 0.79
##   Ordinal Cronbach's alpha: 0.79
## Confidence intervals:
##      Ordinal Omega (total): [0.78, 0.81]
##   Ordinal Cronbach's alpha: [0.78, 0.81]
## 
## Note: the normal point estimate and confidence interval for omega are based on the procedure suggested by Dunn, Baguley & Brunsden (2013) using the MBESS function ci.reliability, whereas the psych package point estimate was suggested in Revelle & Zinbarg (2008). See the help ('?scaleStructure') for more information.
## 
## Eigen values: 2.565, 0.768, 0.643, 0.561, 0.464
## Loadings:
##     PC1  
## E1R 0.700
## E2R 0.780
## E3  0.691
## E4  0.758
## E5  0.644
## 
##                  PC1
## SS loadings    2.565
## Proportion Var 0.513
## 
##     vars    n mean   sd median trimmed  mad min max range  skew kurtosis
## E1R    1 2713 4.03 1.63      4    4.14 1.48   1   6     5 -0.38    -1.09
## E2R    2 2713 3.86 1.61      4    3.93 1.48   1   6     5 -0.22    -1.15
## E3     3 2713 4.00 1.35      4    4.07 1.48   1   6     5 -0.47    -0.46
## E4     4 2713 4.42 1.46      5    4.59 1.48   1   6     5 -0.83    -0.31
## E5     5 2713 4.42 1.34      5    4.57 1.48   1   6     5 -0.78    -0.09
##       se
## E1R 0.03
## E2R 0.03
## E3  0.03
## E4  0.03
## E5  0.03
Summary statistics
name label data_type value_labels missing complete n mean sd p0 p25 p50 p75 p100 hist
E1R Don’t talk a lot. numeric 6. Very Inaccurate,
5. Moderately Inaccurate,
4. Slightly Inaccurate,
3. Slightly Accurate,
2. Moderately Accurate,
1. Very Accurate
23 2777 2800 4.03 1.63 1 3 4 5 6 ▃▅▁▆▅▁▇▇
E2R Find it difficult to approach others. numeric 6. Very Inaccurate,
5. Moderately Inaccurate,
4. Slightly Inaccurate,
3. Slightly Accurate,
2. Moderately Accurate,
1. Very Accurate
16 2784 2800 3.86 1.61 1 3 4 5 6 ▃▅▁▇▅▁▇▆
E3 Know how to captivate people. integer 1. Very Inaccurate,
2. Moderately Inaccurate,
3. Slightly Inaccurate,
4. Slightly Accurate,
5. Moderately Accurate,
6. Very Accurate
25 2775 2800 4 1.35 1 3 4 5 6 ▂▃▁▃▇▁▇▃
E4 Make friends easily. integer 1. Very Inaccurate,
2. Moderately Inaccurate,
3. Slightly Inaccurate,
4. Slightly Accurate,
5. Moderately Accurate,
6. Very Accurate
9 2791 2800 4.42 1.46 1 4 5 6 6 ▁▂▁▂▃▁▇▆
E5 Take charge. integer 1. Very Inaccurate,
2. Moderately Inaccurate,
3. Slightly Inaccurate,
4. Slightly Accurate,
5. Moderately Accurate,
6. Very Accurate
21 2779 2800 4.42 1.33 1 4 5 5 6 ▁▂▁▂▅▁▇▅

Scale: plasticity

Overview

Reliability: ωordinal [95% CI] = 0.75 [0.73;0.76].

Missing: 149.