Purpose

This document describes analyses and visualizations of the hobby-choices data from the sex differences in vision project.

Setup

This section loads the R packages needed to support the following sections.

knitr::opts_chunk$set(echo = TRUE)

# Source packages
library(tidyverse)
## ── Attaching packages ───────────────────────────────────────────────────────── tidyverse 1.3.0 ──
## ✓ ggplot2 3.3.2     ✓ purrr   0.3.4
## ✓ tibble  3.0.3     ✓ dplyr   1.0.2
## ✓ tidyr   1.1.2     ✓ stringr 1.4.0
## ✓ readr   1.3.1     ✓ forcats 0.5.0
## ── Conflicts ──────────────────────────────────────────────────────────── tidyverse_conflicts() ──
## x dplyr::filter() masks stats::filter()
## x dplyr::lag()    masks stats::lag()
library(parameters)
library(sjPlot)
library(expss)
## 
## Attaching package: 'expss'
## The following objects are masked from 'package:stringr':
## 
##     fixed, regex
## The following objects are masked from 'package:dplyr':
## 
##     between, compute, contains, first, last, na_if, recode, vars
## The following objects are masked from 'package:purrr':
## 
##     keep, modify, modify_if, transpose, when
## The following objects are masked from 'package:tidyr':
## 
##     contains, nest
## The following object is masked from 'package:ggplot2':
## 
##     vars
library(pwr)
library(ggpubr)
## Registered S3 methods overwritten by 'car':
##   method                          from
##   influence.merMod                lme4
##   cooks.distance.influence.merMod lme4
##   dfbeta.influence.merMod         lme4
##   dfbetas.influence.merMod        lme4
## 
## Attaching package: 'ggpubr'
## The following object is masked from 'package:expss':
## 
##     compare_means
library(parameters)

Import and clean

The hobbies data are embedded in a much larger Qualtrics data file.

data_fn <- file.path(file.path(params$data_path, params$csv_fn))
if (!file.exists(data_fn)) {
  stop('Data file cannot be found: `', data_fn, '`.')
}
surveys_df <- readr::read_csv(data_fn)
## Parsed with column specification:
## cols(
##   .default = col_double(),
##   StartDate = col_character(),
##   EndDate = col_character(),
##   IPAddress = col_character(),
##   RecordedDate = col_character(),
##   ResponseId = col_character(),
##   RecipientLastName = col_logical(),
##   RecipientFirstName = col_logical(),
##   RecipientEmail = col_logical(),
##   ExternalReference = col_logical(),
##   DistributionChannel = col_character(),
##   UserLanguage = col_character(),
##   participant = col_character(),
##   major = col_character(),
##   race_5 = col_logical(),
##   experimenter = col_character(),
##   note = col_character()
## )
## See spec(...) for full column specifications.

Let’s look at the data using the str() or ‘structure’ function.

str(surveys_df)
## tibble [155 × 277] (S3: spec_tbl_df/tbl_df/tbl/data.frame)
##  $ StartDate          : chr [1:155] "11/19/2019 17:56" "11/21/2019 10:26" "11/21/2019 11:41" "11/21/2019 12:56" ...
##  $ EndDate            : chr [1:155] "11/20/2019 17:07" "11/21/2019 11:14" "11/21/2019 12:17" "11/21/2019 13:54" ...
##  $ Status             : num [1:155] 0 0 0 0 0 0 0 0 0 0 ...
##  $ IPAddress          : chr [1:155] "12.197.38.68" "104.39.151.107" "104.39.151.107" "104.39.151.107" ...
##  $ Progress           : num [1:155] 100 100 100 100 100 100 100 100 100 5 ...
##  $ Durationinseconds  : num [1:155] 83459 2896 2121 3442 2806 ...
##  $ Finished           : num [1:155] 1 1 1 1 1 1 1 1 1 0 ...
##  $ RecordedDate       : chr [1:155] "11/20/2019 17:07" "11/21/2019 11:14" "11/21/2019 12:17" "11/21/2019 13:54" ...
##  $ ResponseId         : chr [1:155] "R_BzgKLvgJHfK6sAF" "R_2CqzWHTk9D22NNV" "R_1QJz8HuWn4ccG0c" "R_8nN75seDcCU8ZH3" ...
##  $ RecipientLastName  : logi [1:155] NA NA NA NA NA NA ...
##  $ RecipientFirstName : logi [1:155] NA NA NA NA NA NA ...
##  $ RecipientEmail     : logi [1:155] NA NA NA NA NA NA ...
##  $ ExternalReference  : logi [1:155] NA NA NA NA NA NA ...
##  $ LocationLatitude   : num [1:155] 40.8 40.8 40.8 40.8 40.8 ...
##  $ LocationLongitude  : num [1:155] -77.9 -77.9 -77.9 -77.9 -77.9 ...
##  $ DistributionChannel: chr [1:155] "anonymous" "anonymous" "anonymous" "anonymous" ...
##  $ UserLanguage       : chr [1:155] "EN" "EN" "EN" "EN" ...
##  $ participant        : chr [1:155] NA NA NA NA ...
##  $ glasses            : num [1:155] NA NA NA NA NA NA NA NA NA NA ...
##  $ sex                : num [1:155] 2 2 2 1 2 2 2 2 2 NA ...
##  $ age                : num [1:155] 1 1 1 1 2 1 2 1 2 NA ...
##  $ schoolyear         : num [1:155] 1 1 1 1 2 1 3 1 3 NA ...
##  $ major              : chr [1:155] "test" "Political Science" "Psychology and BioBehavioral Health" "Supply Chain Management" ...
##  $ race_1             : num [1:155] NA NA NA NA NA NA NA NA NA NA ...
##  $ race_2             : num [1:155] NA NA 1 NA NA NA NA NA NA NA ...
##  $ race_3             : num [1:155] NA 1 NA 1 1 1 1 1 1 NA ...
##  $ race_4             : num [1:155] NA NA NA NA NA NA NA NA NA NA ...
##  $ race_5             : logi [1:155] NA NA NA NA NA NA ...
##  $ race_6             : num [1:155] NA NA NA NA NA NA NA NA NA NA ...
##  $ race_7             : num [1:155] NA NA NA NA NA NA NA NA NA NA ...
##  $ handedness         : num [1:155] NA 2 1 2 2 2 2 2 2 NA ...
##  $ Q7                 : num [1:155] 5 5 3 5 5 5 5 5 5 NA ...
##  $ Q9_FirstClick      : num [1:155] 0 3.51 2.61 3 1.46 ...
##  $ Q9_LastClick       : num [1:155] 0 151 62.5 220.8 139.5 ...
##  $ advoc_time1        : num [1:155] 21.1 151.8 64 222.1 140.8 ...
##  $ Q9_ClickCount      : num [1:155] 0 27 13 20 19 17 19 18 19 NA ...
##  $ advoc1             : num [1:155] NA 1 1 1 1 1 1 1 1 NA ...
##  $ advoc2             : num [1:155] NA 2 1 2 2 2 2 5 2 NA ...
##  $ advoc3             : num [1:155] NA 1 2 2 2 1 1 2 1 NA ...
##  $ advoc4             : num [1:155] NA 4 NA 4 4 4 4 4 4 NA ...
##  $ advoc5             : num [1:155] NA 1 4 4 5 5 2 NA 2 NA ...
##  $ advoc6             : num [1:155] NA 3 3 1 3 3 3 3 3 NA ...
##  $ advoc7             : num [1:155] NA 1 1 1 1 4 1 1 1 NA ...
##  $ advoc8             : num [1:155] NA 5 NA 1 1 1 5 NA 1 NA ...
##  $ advoc9             : num [1:155] NA 1 NA 5 1 2 2 NA 3 NA ...
##  $ advoc10            : num [1:155] NA 5 3 4 5 3 2 NA 2 NA ...
##  $ advoc11            : num [1:155] NA 2 2 2 1 1 2 2 2 NA ...
##  $ advoc12            : num [1:155] NA 2 3 2 2 2 2 4 3 NA ...
##  $ advoc13            : num [1:155] NA 5 4 3 5 4 4 NA 4 NA ...
##  $ advoc14            : num [1:155] NA 3 2 4 1 4 5 NA 4 NA ...
##  $ advoc15            : num [1:155] NA 2 NA 2 2 2 2 NA 2 NA ...
##  $ advoc16            : num [1:155] NA 5 1 5 5 NA 5 5 1 NA ...
##  $ advoc17            : num [1:155] NA 1 NA 3 1 3 3 NA 1 NA ...
##  $ advoc18            : num [1:155] NA 4 4 3 5 2 1 4 2 NA ...
##  $ Q28_FirstClick     : num [1:155] 0 21.79 2.9 2.75 5.73 ...
##  $ Q28_LastClick      : num [1:155] 0 136 45 182 130 ...
##  $ advoc_time2        : num [1:155] 21.7 137.7 46.5 182.8 132 ...
##  $ Q28_ClickCount     : num [1:155] 0 22 13 20 22 23 19 8 19 NA ...
##  $ advoc19            : num [1:155] NA 5 2 4 5 2 2 5 2 NA ...
##  $ advoc20            : num [1:155] NA 3 3 3 3 3 3 3 3 NA ...
##  $ advoc21            : num [1:155] NA 4 4 4 4 4 4 4 4 NA ...
##  $ advoc22            : num [1:155] NA 1 2 4 2 1 1 2 1 NA ...
##  $ advoc23            : num [1:155] NA 5 NA 5 5 5 5 5 2 NA ...
##  $ advoc24            : num [1:155] NA 2 4 4 5 5 2 NA 1 NA ...
##  $ advoc25            : num [1:155] NA 3 1 1 3 4 4 NA 3 NA ...
##  $ advoc26            : num [1:155] NA 4 1 3 1 4 4 NA 5 NA ...
##  $ advoc27            : num [1:155] NA 2 2 5 2 2 2 2 5 NA ...
##  $ advoc28            : num [1:155] NA 4 NA 1 3 3 2 3 2 NA ...
##  $ advoc29            : num [1:155] NA 3 5 3 1 3 4 NA NA NA ...
##  $ advoc30            : num [1:155] NA 5 4 3 1 3 3 NA 1 NA ...
##  $ advoc31            : num [1:155] NA 5 2 3 5 3 1 5 4 NA ...
##  $ advoc32            : num [1:155] NA 2 2 2 2 2 1 NA 2 NA ...
##  $ advoc33            : num [1:155] NA 5 NA 3 3 4 2 NA 4 NA ...
##  $ advoc34            : num [1:155] NA 2 NA 1 5 3 1 NA 2 NA ...
##  $ advoc35            : num [1:155] NA 1 NA 3 4 4 4 NA 4 NA ...
##  $ advoc36            : num [1:155] NA 1 3 2 2 2 1 NA 2 NA ...
##  $ Q50_1_1            : num [1:155] 1 1 1 1 1 NA 1 1 1 NA ...
##  $ Q50_1_2            : num [1:155] NA NA 1 NA NA 1 NA NA NA NA ...
##  $ Q50_1_3            : num [1:155] 1 1 NA 1 1 NA 1 1 1 NA ...
##  $ Q50_1_4            : num [1:155] NA NA NA NA NA 1 NA NA NA NA ...
##  $ Q51_1_1            : num [1:155] 1 1 NA 1 1 1 1 1 1 NA ...
##  $ Q51_1_2            : num [1:155] 1 1 1 1 1 NA 1 1 1 NA ...
##  $ Q51_1_3            : num [1:155] NA NA 1 NA NA 1 NA NA NA NA ...
##  $ Q51_1_4            : num [1:155] NA NA NA NA NA NA NA NA NA NA ...
##  $ Q52_1_1            : num [1:155] NA 1 NA 1 1 NA 1 1 1 NA ...
##  $ Q52_1_2            : num [1:155] 1 NA 1 NA NA 1 NA NA NA NA ...
##  $ Q52_1_3            : num [1:155] NA 1 1 1 1 1 1 1 1 NA ...
##  $ Q52_1_4            : num [1:155] 1 NA NA NA NA NA NA NA NA NA ...
##  $ Q54_FirstClick     : num [1:155] 0 13.49 9.23 10.43 10.65 ...
##  $ Q54_LastClick      : num [1:155] 0 513 111 571 580 ...
##  $ MRT_time           : num [1:155] 44.8 514.4 111.5 571.2 600.1 ...
##  $ Q54_ClickCount     : num [1:155] 0 45 37 47 38 51 47 37 48 NA ...
##  $ MRT1A              : num [1:155] NA NA NA NA 1 NA 1 1 1 NA ...
##  $ MRT1B              : num [1:155] NA NA 1 1 NA 1 NA NA NA NA ...
##  $ MRT1C              : num [1:155] NA 1 NA 1 1 1 1 1 1 NA ...
##  $ MRT1D              : num [1:155] NA 1 1 NA NA NA NA NA NA NA ...
##  $ MRT2A              : num [1:155] NA NA NA NA 1 1 1 1 NA NA ...
##  $ MRT2B              : num [1:155] NA 1 NA NA NA NA 1 NA 1 NA ...
##  $ MRT2C              : num [1:155] NA NA 1 NA NA 1 NA NA 1 NA ...
##   [list output truncated]
##  - attr(*, "spec")=
##   .. cols(
##   ..   StartDate = col_character(),
##   ..   EndDate = col_character(),
##   ..   Status = col_double(),
##   ..   IPAddress = col_character(),
##   ..   Progress = col_double(),
##   ..   Durationinseconds = col_double(),
##   ..   Finished = col_double(),
##   ..   RecordedDate = col_character(),
##   ..   ResponseId = col_character(),
##   ..   RecipientLastName = col_logical(),
##   ..   RecipientFirstName = col_logical(),
##   ..   RecipientEmail = col_logical(),
##   ..   ExternalReference = col_logical(),
##   ..   LocationLatitude = col_double(),
##   ..   LocationLongitude = col_double(),
##   ..   DistributionChannel = col_character(),
##   ..   UserLanguage = col_character(),
##   ..   participant = col_character(),
##   ..   glasses = col_double(),
##   ..   sex = col_double(),
##   ..   age = col_double(),
##   ..   schoolyear = col_double(),
##   ..   major = col_character(),
##   ..   race_1 = col_double(),
##   ..   race_2 = col_double(),
##   ..   race_3 = col_double(),
##   ..   race_4 = col_double(),
##   ..   race_5 = col_logical(),
##   ..   race_6 = col_double(),
##   ..   race_7 = col_double(),
##   ..   handedness = col_double(),
##   ..   Q7 = col_double(),
##   ..   Q9_FirstClick = col_double(),
##   ..   Q9_LastClick = col_double(),
##   ..   advoc_time1 = col_double(),
##   ..   Q9_ClickCount = col_double(),
##   ..   advoc1 = col_double(),
##   ..   advoc2 = col_double(),
##   ..   advoc3 = col_double(),
##   ..   advoc4 = col_double(),
##   ..   advoc5 = col_double(),
##   ..   advoc6 = col_double(),
##   ..   advoc7 = col_double(),
##   ..   advoc8 = col_double(),
##   ..   advoc9 = col_double(),
##   ..   advoc10 = col_double(),
##   ..   advoc11 = col_double(),
##   ..   advoc12 = col_double(),
##   ..   advoc13 = col_double(),
##   ..   advoc14 = col_double(),
##   ..   advoc15 = col_double(),
##   ..   advoc16 = col_double(),
##   ..   advoc17 = col_double(),
##   ..   advoc18 = col_double(),
##   ..   Q28_FirstClick = col_double(),
##   ..   Q28_LastClick = col_double(),
##   ..   advoc_time2 = col_double(),
##   ..   Q28_ClickCount = col_double(),
##   ..   advoc19 = col_double(),
##   ..   advoc20 = col_double(),
##   ..   advoc21 = col_double(),
##   ..   advoc22 = col_double(),
##   ..   advoc23 = col_double(),
##   ..   advoc24 = col_double(),
##   ..   advoc25 = col_double(),
##   ..   advoc26 = col_double(),
##   ..   advoc27 = col_double(),
##   ..   advoc28 = col_double(),
##   ..   advoc29 = col_double(),
##   ..   advoc30 = col_double(),
##   ..   advoc31 = col_double(),
##   ..   advoc32 = col_double(),
##   ..   advoc33 = col_double(),
##   ..   advoc34 = col_double(),
##   ..   advoc35 = col_double(),
##   ..   advoc36 = col_double(),
##   ..   Q50_1_1 = col_double(),
##   ..   Q50_1_2 = col_double(),
##   ..   Q50_1_3 = col_double(),
##   ..   Q50_1_4 = col_double(),
##   ..   Q51_1_1 = col_double(),
##   ..   Q51_1_2 = col_double(),
##   ..   Q51_1_3 = col_double(),
##   ..   Q51_1_4 = col_double(),
##   ..   Q52_1_1 = col_double(),
##   ..   Q52_1_2 = col_double(),
##   ..   Q52_1_3 = col_double(),
##   ..   Q52_1_4 = col_double(),
##   ..   Q54_FirstClick = col_double(),
##   ..   Q54_LastClick = col_double(),
##   ..   MRT_time = col_double(),
##   ..   Q54_ClickCount = col_double(),
##   ..   MRT1A = col_double(),
##   ..   MRT1B = col_double(),
##   ..   MRT1C = col_double(),
##   ..   MRT1D = col_double(),
##   ..   MRT2A = col_double(),
##   ..   MRT2B = col_double(),
##   ..   MRT2C = col_double(),
##   ..   MRT2D = col_double(),
##   ..   MRT3A = col_double(),
##   ..   MRT3B = col_double(),
##   ..   MRT3C = col_double(),
##   ..   MRT3D = col_double(),
##   ..   MRT4A = col_double(),
##   ..   MRT4B = col_double(),
##   ..   MRT4C = col_double(),
##   ..   MRT4D = col_double(),
##   ..   MRT5A = col_double(),
##   ..   MRT5B = col_double(),
##   ..   MRT5C = col_double(),
##   ..   MRT5D = col_double(),
##   ..   MRT6A = col_double(),
##   ..   MRT6B = col_double(),
##   ..   MRT6C = col_double(),
##   ..   MRT6D = col_double(),
##   ..   MRT7A = col_double(),
##   ..   MRT7B = col_double(),
##   ..   MRT7C = col_double(),
##   ..   MRT7D = col_double(),
##   ..   MRT8A = col_double(),
##   ..   MRT8B = col_double(),
##   ..   MRT8C = col_double(),
##   ..   MRT8D = col_double(),
##   ..   MRT9A = col_double(),
##   ..   MRT9B = col_double(),
##   ..   MRT9C = col_double(),
##   ..   MRT9D = col_double(),
##   ..   MRT10A = col_double(),
##   ..   MRT10B = col_double(),
##   ..   MRT10C = col_double(),
##   ..   MRT10D = col_double(),
##   ..   MRT11A = col_double(),
##   ..   MRT11B = col_double(),
##   ..   MRT11C = col_double(),
##   ..   MRT11D = col_double(),
##   ..   MRT12A = col_double(),
##   ..   MRT12B = col_double(),
##   ..   MRT12C = col_double(),
##   ..   MRT12D = col_double(),
##   ..   MRT13A = col_double(),
##   ..   MRT13B = col_double(),
##   ..   MRT13C = col_double(),
##   ..   MRT13D = col_double(),
##   ..   MRT14A = col_double(),
##   ..   MRT14B = col_double(),
##   ..   MRT14C = col_double(),
##   ..   MRT14D = col_double(),
##   ..   MRT15A = col_double(),
##   ..   MRT15B = col_double(),
##   ..   MRT15C = col_double(),
##   ..   MRT15D = col_double(),
##   ..   MRT16A = col_double(),
##   ..   MRT16B = col_double(),
##   ..   MRT16C = col_double(),
##   ..   MRT16D = col_double(),
##   ..   MRT17A = col_double(),
##   ..   MRT17B = col_double(),
##   ..   MRT17C = col_double(),
##   ..   MRT17D = col_double(),
##   ..   MRT18A = col_double(),
##   ..   MRT18B = col_double(),
##   ..   MRT18C = col_double(),
##   ..   MRT18D = col_double(),
##   ..   MRT19A = col_double(),
##   ..   MRT19B = col_double(),
##   ..   MRT19C = col_double(),
##   ..   MRT19D = col_double(),
##   ..   MRT20A = col_double(),
##   ..   MRT20B = col_double(),
##   ..   MRT20C = col_double(),
##   ..   MRT20D = col_double(),
##   ..   Q76_FirstClick = col_double(),
##   ..   Q76_LastClick = col_double(),
##   ..   Q76_PageSubmit = col_double(),
##   ..   Q76_ClickCount = col_double(),
##   ..   h1 = col_double(),
##   ..   h2 = col_double(),
##   ..   h3 = col_double(),
##   ..   h4 = col_double(),
##   ..   h5 = col_double(),
##   ..   h6 = col_double(),
##   ..   h7 = col_double(),
##   ..   h8 = col_double(),
##   ..   h9 = col_double(),
##   ..   h10 = col_double(),
##   ..   h11 = col_double(),
##   ..   h12 = col_double(),
##   ..   h13 = col_double(),
##   ..   h14 = col_double(),
##   ..   h15 = col_double(),
##   ..   h16 = col_double(),
##   ..   h17 = col_double(),
##   ..   h18 = col_double(),
##   ..   h19 = col_double(),
##   ..   h20 = col_double(),
##   ..   h21 = col_double(),
##   ..   h22 = col_double(),
##   ..   h23 = col_double(),
##   ..   h24 = col_double(),
##   ..   h25 = col_double(),
##   ..   h26 = col_double(),
##   ..   h27 = col_double(),
##   ..   h28 = col_double(),
##   ..   h29 = col_double(),
##   ..   h30 = col_double(),
##   ..   h31 = col_double(),
##   ..   h32 = col_double(),
##   ..   h33 = col_double(),
##   ..   h34 = col_double(),
##   ..   h35 = col_double(),
##   ..   h36 = col_double(),
##   ..   h37 = col_double(),
##   ..   h38 = col_double(),
##   ..   h39 = col_double(),
##   ..   h40 = col_double(),
##   ..   h41 = col_double(),
##   ..   h42 = col_double(),
##   ..   h43 = col_double(),
##   ..   h44 = col_double(),
##   ..   h45 = col_double(),
##   ..   h46 = col_double(),
##   ..   h47 = col_double(),
##   ..   h48 = col_double(),
##   ..   h49 = col_double(),
##   ..   h50 = col_double(),
##   ..   h51 = col_double(),
##   ..   h52 = col_double(),
##   ..   h53 = col_double(),
##   ..   h54 = col_double(),
##   ..   h55 = col_double(),
##   ..   h56 = col_double(),
##   ..   h57 = col_double(),
##   ..   h58 = col_double(),
##   ..   h59 = col_double(),
##   ..   h60 = col_double(),
##   ..   acuity = col_double(),
##   ..   color_vision1_4 = col_double(),
##   ..   color_vision1_5 = col_double(),
##   ..   color_vision2_1 = col_double(),
##   ..   color_vision2_2 = col_double(),
##   ..   color_vision2_3 = col_double(),
##   ..   stereo = col_double(),
##   ..   experimenter = col_character(),
##   ..   note = col_character(),
##   ..   advoc_num_cor = col_double(),
##   ..   advoc_num_err = col_double(),
##   ..   advoc_total_score = col_double(),
##   ..   MRT_cor = col_double(),
##   ..   MRT_err = col_double(),
##   ..   MRT1 = col_double(),
##   ..   MRT2 = col_double(),
##   ..   MRT3 = col_double(),
##   ..   MRT4 = col_double(),
##   ..   MRT5 = col_double(),
##   ..   MRT6 = col_double(),
##   ..   MRT7 = col_double(),
##   ..   MRT8 = col_double(),
##   ..   MRT9 = col_double(),
##   ..   MRT10 = col_double(),
##   ..   MRT11 = col_double(),
##   ..   MRT12 = col_double(),
##   ..   MRT13 = col_double(),
##   ..   MRT14 = col_double(),
##   ..   MRT15 = col_double(),
##   ..   MRT16 = col_double(),
##   ..   MRT17 = col_double(),
##   ..   MRT18 = col_double(),
##   ..   MRT19 = col_double(),
##   ..   MRT20 = col_double(),
##   ..   MRT_cor_both = col_double(),
##   ..   MRT_check = col_double(),
##   ..   Flag_MRT = col_double(),
##   ..   hobfem_pres = col_double(),
##   ..   hobmas_pres = col_double(),
##   ..   hobfem = col_double(),
##   ..   hobmas = col_double()
##   .. )

We need to work with Yiming to determine what rows to select. For now, let’s keep sex, age, schoolyear, major, race_1:race_7, handedness, the hobbies questions h1:h60, acuity, color_vision1_4:color_vision_2_3, stereo, and hobfem and hobmas.

hobbies_df <- surveys_df %>%
  dplyr::select(., 
                StartDate,
                participant,
                sex,
                age,
                schoolyear,
                major,
                race_1:race_7,
                handedness,
                h1:h60,
                acuity,
                color_vision1_4:color_vision2_3,
                stereo,
                hobfem,
                hobmas
                )

str(hobbies_df)
## tibble [155 × 83] (S3: tbl_df/tbl/data.frame)
##  $ StartDate      : chr [1:155] "11/19/2019 17:56" "11/21/2019 10:26" "11/21/2019 11:41" "11/21/2019 12:56" ...
##  $ participant    : chr [1:155] NA NA NA NA ...
##  $ sex            : num [1:155] 2 2 2 1 2 2 2 2 2 NA ...
##  $ age            : num [1:155] 1 1 1 1 2 1 2 1 2 NA ...
##  $ schoolyear     : num [1:155] 1 1 1 1 2 1 3 1 3 NA ...
##  $ major          : chr [1:155] "test" "Political Science" "Psychology and BioBehavioral Health" "Supply Chain Management" ...
##  $ race_1         : num [1:155] NA NA NA NA NA NA NA NA NA NA ...
##  $ race_2         : num [1:155] NA NA 1 NA NA NA NA NA NA NA ...
##  $ race_3         : num [1:155] NA 1 NA 1 1 1 1 1 1 NA ...
##  $ race_4         : num [1:155] NA NA NA NA NA NA NA NA NA NA ...
##  $ race_5         : logi [1:155] NA NA NA NA NA NA ...
##  $ race_6         : num [1:155] NA NA NA NA NA NA NA NA NA NA ...
##  $ race_7         : num [1:155] NA NA NA NA NA NA NA NA NA NA ...
##  $ handedness     : num [1:155] NA 2 1 2 2 2 2 2 2 NA ...
##  $ h1             : num [1:155] 99 3 2 5 2 4 1 2 5 99 ...
##  $ h2             : num [1:155] 99 5 4 2 4 4 2 5 5 99 ...
##  $ h3             : num [1:155] 99 5 5 1 4 4 4 5 2 99 ...
##  $ h4             : num [1:155] 99 2 2 2 4 2 1 5 4 99 ...
##  $ h5             : num [1:155] 99 5 5 5 5 5 4 5 4 99 ...
##  $ h6             : num [1:155] 99 5 4 5 5 3 4 4 4 99 ...
##  $ h7             : num [1:155] 99 4 5 5 5 4 5 5 4 99 ...
##  $ h8             : num [1:155] 99 4 4 3 3 2 3 4 4 99 ...
##  $ h9             : num [1:155] 99 3 1 4 3 4 2 4 1 99 ...
##  $ h10            : num [1:155] 99 2 3 1 2 3 1 2 1 99 ...
##  $ h11            : num [1:155] 99 4 3 5 3 4 3 3 1 99 ...
##  $ h12            : num [1:155] 99 4 5 5 5 4 4 2 2 99 ...
##  $ h13            : num [1:155] 99 5 5 5 5 5 4 5 2 99 ...
##  $ h14            : num [1:155] 99 5 5 4 4 5 4 5 2 99 ...
##  $ h15            : num [1:155] 99 4 4 5 3 5 5 4 2 99 ...
##  $ h16            : num [1:155] 99 5 5 5 5 2 5 5 5 99 ...
##  $ h17            : num [1:155] 99 5 5 4 4 3 3 5 5 99 ...
##  $ h18            : num [1:155] 99 4 5 4 3 2 2 3 3 99 ...
##  $ h19            : num [1:155] 99 5 5 5 4 3 2 4 5 99 ...
##  $ h20            : num [1:155] 99 5 5 5 5 4 4 4 4 99 ...
##  $ h21            : num [1:155] 99 4 4 1 4 3 1 4 1 99 ...
##  $ h22            : num [1:155] 99 1 3 2 3 1 1 1 1 99 ...
##  $ h23            : num [1:155] 99 2 4 4 2 1 5 4 5 99 ...
##  $ h24            : num [1:155] 99 5 3 5 3 3 5 3 1 99 ...
##  $ h25            : num [1:155] 99 1 3 5 2 2 2 2 1 99 ...
##  $ h26            : num [1:155] 99 3 4 1 3 4 2 5 1 99 ...
##  $ h27            : num [1:155] 99 5 5 5 2 5 4 4 5 99 ...
##  $ h28            : num [1:155] 99 2 3 1 1 1 1 1 1 99 ...
##  $ h29            : num [1:155] 99 1 3 1 1 1 1 1 1 99 ...
##  $ h30            : num [1:155] 99 4 5 5 4 4 3 5 5 99 ...
##  $ h31            : num [1:155] 99 1 3 5 4 3 4 1 2 99 ...
##  $ h32            : num [1:155] 99 4 4 3 3 5 2 1 1 99 ...
##  $ h33            : num [1:155] 99 3 5 5 5 5 5 5 5 99 ...
##  $ h34            : num [1:155] 99 4 3 5 3 3 3 1 4 99 ...
##  $ h35            : num [1:155] 99 4 5 5 2 3 3 1 1 99 ...
##  $ h36            : num [1:155] 99 2 3 4 1 4 2 4 1 99 ...
##  $ h37            : num [1:155] 99 4 4 4 4 4 5 4 1 99 ...
##  $ h38            : num [1:155] 99 4 5 5 4 3 5 4 4 99 ...
##  $ h39            : num [1:155] 99 4 5 5 4 4 5 3 2 99 ...
##  $ h40            : num [1:155] 99 4 3 5 3 1 3 1 1 99 ...
##  $ h41            : num [1:155] 99 4 5 5 3 5 5 5 1 99 ...
##  $ h42            : num [1:155] 99 2 3 5 4 1 3 3 1 99 ...
##  $ h43            : num [1:155] 99 3 5 4 5 5 4 5 5 99 ...
##  $ h44            : num [1:155] 99 2 2 5 2 4 5 3 1 99 ...
##  $ h45            : num [1:155] 99 4 5 5 4 4 2 5 5 99 ...
##  $ h46            : num [1:155] 99 3 2 3 3 5 3 4 5 99 ...
##  $ h47            : num [1:155] 99 4 2 5 5 5 5 5 1 99 ...
##  $ h48            : num [1:155] 99 2 2 5 1 1 3 2 1 99 ...
##  $ h49            : num [1:155] 99 4 5 3 4 4 3 5 5 99 ...
##  $ h50            : num [1:155] 99 2 2 1 2 2 2 2 1 99 ...
##  $ h51            : num [1:155] 99 5 4 5 5 4 5 4 5 99 ...
##  $ h52            : num [1:155] 99 4 5 5 1 2 5 5 5 99 ...
##  $ h53            : num [1:155] 99 5 5 4 5 3 5 5 5 99 ...
##  $ h54            : num [1:155] 99 5 5 5 5 5 5 5 5 99 ...
##  $ h55            : num [1:155] 99 5 4 3 3 1 4 4 5 99 ...
##  $ h56            : num [1:155] 99 5 3 3 3 2 4 4 5 99 ...
##  $ h57            : num [1:155] 99 3 3 5 1 1 2 1 2 99 ...
##  $ h58            : num [1:155] 99 2 2 3 1 1 1 1 1 99 ...
##  $ h59            : num [1:155] 99 4 4 1 1 2 1 1 1 99 ...
##  $ h60            : num [1:155] 99 5 5 5 5 5 4 5 1 99 ...
##  $ acuity         : num [1:155] NA 21 21 21 21 21 21 21 21 21 ...
##  $ color_vision1_4: num [1:155] NA 1 1 1 1 1 1 1 1 NA ...
##  $ color_vision1_5: num [1:155] NA 1 1 1 1 1 1 1 1 NA ...
##  $ color_vision2_1: num [1:155] NA 4 4 4 4 4 4 4 4 NA ...
##  $ color_vision2_2: num [1:155] NA 4 4 4 4 4 4 4 4 NA ...
##  $ color_vision2_3: num [1:155] NA 4 4 4 4 4 4 4 4 NA ...
##  $ stereo         : num [1:155] NA 12 12 12 12 12 12 12 12 NA ...
##  $ hobfem         : num [1:155] 99 4.16 4.11 3.37 3.63 ...
##  $ hobmas         : num [1:155] 99 3 3.48 4.43 2.76 ...

Clean

We’ll need to clean the major variable, the race_ variables, the color_vision variables, rename the hobby variables to reflect the actual hobby asked about, and we’ll also want to label the hobbies as male- or female-typed.

Export cleaned file for use on RStudio Server Pro

To facilitate students’ use of RStudio Server Pro, here is code to export this trimmed dataset.

readr::write_csv(hobbies_df, 'csv/hobbies_sex_diff.csv')