Labcoat Leni solutions Chapter 7

Labcoat Leni character from Discovering Statistics using R and RStudio

This document contains abridged sections from Discovering Statistics Using R and RStudio by Andy Field so there are some copyright considerations. You can use this material for teaching and non-profit activities but please do not meddle with it or claim it as your own work. See the full license terms at the bottom of the page.

Why do you like your lecturers?

We can run this analysis by loading the file and just pretty much selecting everything in the variable list and running a Pearson correlation.

Load the file

library(tidyverse)
chamorro_tib <- readr::read_csv("../data/chamorro_premuzic.csv") %>% 
  dplyr::mutate(
    sex = forcats::as_factor(sex)
  )

Alternative, load the data directly from the discovr package:

chamorro_tib <- discovr::chamorro_premuzic

Obtain correlations

To get the correlations using correlation() (note I have set p_adjust = "none" because they didn’t correct p-values for multiple tests in the paper):

chamorro_r <- chamorro_tib %>% 
  dplyr::select(-c(age, sex)) %>%
  correlation::correlation(p_adjust = "none")
chamorro_r %>% 
  knitr::kable(digits = 3)
Parameter1Parameter2rCI_lowCI_hightdfpMethodn_Obs
stu_neuroticstu_extro-0.336-0.419-0.249-7.2884160.000Pearson418
stu_neuroticstu_open-0.055-0.1500.041-1.1314160.259Pearson418
stu_neuroticstu_agree0.006-0.0910.1040.1314060.896Pearson408
stu_neuroticstu_consc-0.196-0.287-0.102-4.0674140.000Pearson416
stu_neuroticlec_neurotic0.007-0.0900.1030.1334110.895Pearson413
stu_neuroticlec_extro-0.081-0.1960.036-1.3582790.176Pearson281
stu_neuroticlec_open-0.018-0.1140.078-0.3694140.712Pearson416
stu_neuroticlec_agree0.1010.0040.1952.0504110.041Pearson413
stu_neuroticlec_consc0.003-0.0940.0990.0554110.956Pearson413
stu_extrostu_open0.069-0.0270.1641.4084140.160Pearson416
stu_extrostu_agree0.080-0.0170.1761.6224040.106Pearson406
stu_extrostu_consc0.1860.0920.2783.8524120.000Pearson414
stu_extrolec_neurotic-0.099-0.194-0.002-2.0124090.045Pearson411
stu_extrolec_extro0.1530.0370.2652.5862790.010Pearson281
stu_extrolec_open0.068-0.0280.1641.3894120.165Pearson414
stu_extrolec_agree0.004-0.0930.1010.0864090.932Pearson411
stu_extrolec_consc-0.010-0.1060.087-0.1974090.844Pearson411
stu_openstu_agree-0.037-0.1340.061-0.7374040.461Pearson406
stu_openstu_consc-0.091-0.1850.006-1.8464120.066Pearson414
stu_openlec_neurotic-0.101-0.196-0.004-2.0544090.041Pearson411
stu_openlec_extro0.041-0.0770.1570.6772790.499Pearson281
stu_openlec_open0.2010.1070.2924.1624120.000Pearson414
stu_openlec_agree-0.163-0.256-0.067-3.3404090.001Pearson411
stu_openlec_consc-0.034-0.1300.063-0.6844090.494Pearson411
stu_agreestu_consc0.5220.4480.59012.2864020.000Pearson404
stu_agreelec_neurotic-0.021-0.1180.076-0.4314040.667Pearson406
stu_agreelec_extro0.050-0.0690.1670.8222740.412Pearson276
stu_agreelec_open0.1070.0100.2022.1584060.031Pearson408
stu_agreelec_agree0.1640.0670.2573.3314030.001Pearson405
stu_agreelec_consc0.1980.1020.2904.0504030.000Pearson405
stu_consclec_neurotic-0.140-0.234-0.043-2.8494070.005Pearson409
stu_consclec_extro0.102-0.0160.2161.7012780.090Pearson280
stu_consclec_open0.027-0.0700.1230.5504100.582Pearson412
stu_consclec_agree0.1330.0360.2272.7004070.007Pearson409
stu_consclec_consc0.2160.1220.3074.4684070.000Pearson409
lec_neuroticlec_extro-0.002-0.1190.116-0.0322770.975Pearson279
lec_neuroticlec_open0.037-0.0600.1320.7464130.456Pearson415
lec_neuroticlec_agree0.045-0.0520.1410.9144120.361Pearson414
lec_neuroticlec_consc-0.258-0.346-0.166-5.4224120.000Pearson414
lec_extrolec_open0.4920.3990.5769.4672800.000Pearson282
lec_extrolec_agree0.1180.0000.2321.9762780.049Pearson280
lec_extrolec_consc0.101-0.0170.2151.6882790.093Pearson281
lec_openlec_agree0.2420.1490.3305.0584130.000Pearson415
lec_openlec_consc0.1200.0240.2142.4584130.014Pearson415
lec_agreelec_consc0.2400.1470.3295.0224120.000Pearson414

This looks pretty horrendous, but there are a lot of correlations that we don’t need. We’re interested only in the correlations between students’ personality and what they want in lecturers. We’re not interested in how their own five personality traits correlate with each other (i.e. if a student is neurotic are they conscientious too?). Let’s focus in on these correlations by using filter and applying the function grepl(), which returns TRUE if it finds an expression. Within filter() we ask for cases where the pattern “stu” is found for the variable Parameter1 (this is what grepl("stu", Parameter1) == TRUE does) and where the pattern “lec” is found for the variable Parameter2 (this is what grepl("lec", Parameter2) == TRUE does). This has the effect of returning the 25 correlations between student personality traits and those desired in lecturers. I round of the code by rounding the values to two decimal places to match the paper:

chamorro_r_reduced <- chamorro_r %>% 
  dplyr::filter(grepl("stu", Parameter1) == TRUE & grepl("lec", Parameter2))
chamorro_r_reduced %>% 
  knitr::kable(digits = 3)
Parameter1Parameter2rCI_lowCI_hightdfpMethodn_Obs
stu_neuroticlec_neurotic0.007-0.0900.1030.1334110.895Pearson413
stu_neuroticlec_extro-0.081-0.1960.036-1.3582790.176Pearson281
stu_neuroticlec_open-0.018-0.1140.078-0.3694140.712Pearson416
stu_neuroticlec_agree0.1010.0040.1952.0504110.041Pearson413
stu_neuroticlec_consc0.003-0.0940.0990.0554110.956Pearson413
stu_extrolec_neurotic-0.099-0.194-0.002-2.0124090.045Pearson411
stu_extrolec_extro0.1530.0370.2652.5862790.010Pearson281
stu_extrolec_open0.068-0.0280.1641.3894120.165Pearson414
stu_extrolec_agree0.004-0.0930.1010.0864090.932Pearson411
stu_extrolec_consc-0.010-0.1060.087-0.1974090.844Pearson411
stu_openlec_neurotic-0.101-0.196-0.004-2.0544090.041Pearson411
stu_openlec_extro0.041-0.0770.1570.6772790.499Pearson281
stu_openlec_open0.2010.1070.2924.1624120.000Pearson414
stu_openlec_agree-0.163-0.256-0.067-3.3404090.001Pearson411
stu_openlec_consc-0.034-0.1300.063-0.6844090.494Pearson411
stu_agreelec_neurotic-0.021-0.1180.076-0.4314040.667Pearson406
stu_agreelec_extro0.050-0.0690.1670.8222740.412Pearson276
stu_agreelec_open0.1070.0100.2022.1584060.031Pearson408
stu_agreelec_agree0.1640.0670.2573.3314030.001Pearson405
stu_agreelec_consc0.1980.1020.2904.0504030.000Pearson405
stu_consclec_neurotic-0.140-0.234-0.043-2.8494070.005Pearson409
stu_consclec_extro0.102-0.0160.2161.7012780.090Pearson280
stu_consclec_open0.027-0.0700.1230.5504100.582Pearson412
stu_consclec_agree0.1330.0360.2272.7004070.007Pearson409
stu_consclec_consc0.2160.1220.3074.4684070.000Pearson409

These values replicate the values reported in the original research paper (part of the authors’ table is below so you can see how they reported these values – match these values to the values in your output):

Table from Chamorro-Premuzic et al. (2008)

As for what we can conclude, well, neurotic students tend to want agreeable lecturers, $ r = .10 $, $ p = .041$; extroverted students tend to want extroverted lecturers, $ r = .15$, $ p = .010 $; students who are open to experience tend to want lecturers who are open to experience, $ r = .20$, $ p < .001$, and don’t want agreeable lecturers, $ r = -.16$, $ p < .001$; agreeable students want every sort of lecturer apart from neurotic. Finally, conscientious students tend to want conscientious lecturers, $ r = .22$, $ p < .001$, and extroverted ones, $ r = .10$, $ p = .09$ (note that the authors report the one-tailed p-value), but don’t want neurotic ones, $ r = -.14$, $ p = .005$.

Previous
Next