Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,4 @@ VignetteBuilder: knitr
Roxygen: list(markdown = TRUE)
Config/testthat/edition: 3
Config/roxygen2/version: 8.0.0
RoxygenNote: 7.3.3
8 changes: 8 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# Developmental

* Added new datasets:
* `county_2023`, `EVs_region`, `generation_climate_action` added by [@npaterno](https://github.com/npaterno)
* `sdea` added by William Krenzer & Siobhán Griffin
* `Brazil_death_anxiety` added by Isaac Handley-Miner, Yuichi Shoda and Christian Unkelbach
* `skill_aquisition` added by Y. Andre Wang, Gareth Yu and Julia, G. Bottesini

# openintro 2.5.1

* Added new datasets:
Expand Down
44 changes: 44 additions & 0 deletions R/data-Brazil_death_anxiety.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#' Brazil death anxiety
#'
#' The dataset consists of responses from 200 individuals from Brazil.
#' The main measure is the DAQ, a 15-item multidimensional scale that
#' measures fears related to suffering, loneliness, the unknown, and
#' personal extinction (see Variable Description). The scale measures
#' range from 0 (“not at all”) to 8 (“very much”). In addition, the
#' file contains a free-list measure of participants’ fears and worries,
#' which may be coded, and several demographic variables.
#'
#' @format A data frame with 200 rows and 28 variables.
#' \describe{
#' \item{participant}{Participant id}
#' \item{gender}{Gender of pariticipant.}
#' \item{year_born}{Year participant was born.}
#' \item{age_in_2015}{Age of participant when data was collected.}
#' \item{ethnicity}{Ethnicity of participant.}
#' \item{marital_status}{Marital status of participant.}
#' \item{employment}{Employment status of participant.}
#' \item{occupation}{Occupation of participant.}
#' \item{fivefears_1}{The first entry in a free list of participants’ fears and worries.}
#' \item{fivefears_2}{The second entry in a free list of participants’ fears and worries.}
#' \item{fivefears_3}{The third entry in a free list of participants’ fears and worries.}
#' \item{fivefears_4}{The fourth entry in a free list of participants’ fears and worries.}
#' \item{fivefears_5}{The fifth entry in a free list of participants’ fears and worries.}
#' \item{worry_death}{Do you worry about dying?}
#' \item{incomplete_bucket_list}{Does it bother you that you may die before you have done everything you wanted to?}
#' \item{deathly_ill}{Do you worry that you may be very ill for a long time before you die?}
#' \item{concern_for_others}{Does it upset you to think that others may see you suffering when you die?}
#' \item{painful_death}{Do you worry that dying may be very painful?}
#' \item{loved_ones}{Do you worry that the persons most close to you won’t be with you when you are dying?}
#' \item{die_alone}{Do you worry that you may be alone when you are dying?}
#' \item{cognitive_function}{Does the thought bother you that you might lose control of your mind before death?}
#' \item{expenses_burden}{Do you worry that expenses connected with your dying will be a burden for other people?}
#' \item{as_you_wish}{Does it worry you that your instructions or will about your belongings may not be carried out after you die?}
#' \item{buried_alive}{Are you afraid that you may be buried before you are really dead?}
#' \item{left_behind}{Does the thought of leaving loved ones behind you when you die disturb you?}
#' \item{remembered}{Do you worry that those you care about may not remember you after your death?}
#' \item{permenant}{Does the thought worry you that with death you may be gone forever?}
#' \item{after_death}{Are you worried about not knowing what to expect after death?}
#' }
#' @source Jong, J., Halberstadt, J., Bluemke, M. et al. Death anxiety, exposure to death, mortuary preferences, and religiosity in five countries. Sci Data 6, 154 (2019). [Link to doi](https://doi.org/10.1038/s41597-019-0163-x)
#'
"Brazil_death_anxiety"
12 changes: 12 additions & 0 deletions R/data-EVs_region.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#' Electric vehicles
#'
#' Pew research results regarding consideration of buying electric vehicle.
#'
#' @format A data frame with 5085 observations on the following 2 variables.
#' \describe{
#' \item{\code{region}}{a factor with levels \code{Urban, Suburban} and \code{Rural}}
#' \item{\code{consideration}}{a factor with levels \code{Not too or not at all likely}, \code{Very or somewhat likely} and \code{Do not expect to buy a vehicle}}
#' }
#'
#' @source Pew Research Center, Survey of U.S. adults conducted April 28-May 4, 2025. "Americans' Views on Energy at the Start of Trump's Second Term"
"EVs_region"
55 changes: 55 additions & 0 deletions R/data-county_2023.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#' county_2023
#'
#' County level data from the US Census American Community Survey 2023 5-year estimates.
#'
#' @name county_2023
#' @docType data
#' @format A data frame with 3144 rows and 43 columns.
#' \describe{
#' \item{\code{geoid}}{Unique numeric code used by the U.S. Census Bureau to identify specific geographic areas.}
#' \item{\code{county_state}}{Name of county and state.}
#' \item{\code{name}}{Name of county.}
#' \item{\code{state}}{Name of state.}
#' \item{\code{individual_income}}{Median individual income for the county, measure in 2018 USD.}
#' \item{\code{population_size}}{Number of people residing in the county.}
#' \item{\code{white}}{Percent of the population who identified as only white.}
#' \item{\code{african_american}}{Percent of the population who identified as only Black or African American.}
#' \item{\code{age}}{Median age of those who live in the county, measured in years.}
#' \item{\code{age_under_5}}{Percent of the population under the age of 5.}
#' \item{\code{age_85_plus}}{Percent of the population age 85 and older.}
#' \item{\code{age_18_plus}}{Percent of the population age 18 and older.}
#' \item{\code{age_65_plus}}{Percent of the population age 65 and older.}
#' \item{\code{travel_time}}{Mean travel time to work, measured in minutes.}
#' \item{\code{household_size}}{Mean household size.}
#' \item{\code{family_size}}{Mean family size.}
#' \item{\code{one_unit_structure}}{Percent of properties with a residential building that contains a single housing dwelling unit.}
#' \item{\code{two_unit_structure}}{Percent of properties with a residential building that contains two or more separate housing units (such as a duplex or apartments).}
#' \item{\code{mobile_and_other}}{Percent of properties with mobile homes and all other types of housing structures.}
#' \item{\code{individual_income_25_plus}}{Median individual income for those age 25 or older.}
#' \item{\code{hs_grad}}{Percent of the population over the age 25 or older with at least a high school diploma.}
#' \item{\code{college_grad}}{Percent of the population over the age 25 or older with at least a Bachelor's Degree.}
#' \item{\code{total_households}}{Total number of households in the county.}
#' \item{\code{spanish_speaking}}{Percent of households that speak Spanish.}
#' \item{\code{indo_european_language}}{Percent of households that speak an Indo-European language other than English.}
#' \item{\code{api_language}}{Percent of households that speak an Asian and Pacific Islander language.}
#' \item{\code{non_euro_api}}{Percent of households speaking an non-European or Asian and Pacific Islander language.}
#' \item{\code{limited_english}}{Percent of households that speak limited English.}
#' \item{\code{poverty}}{Percent of population living below the poverty line.}
#' \item{\code{poverty_18}}{Percent of population under the age of 18 living below the poverty line.}
#' \item{\code{poverty_65}}{Percent of the population over the age of 65 living below the povery line.}
#' \item{\code{household_income_mean}}{Mean household income, measured in 2018 USD.}
#' \item{\code{household_income_median}}{Median household income, measured in 2018 USD.}
#' \item{\code{per_capita_income}}{Mean income per capita, measured in 2018 USD.}
#' \item{\code{veterans}}{Percent of the civilian population age 18 or older who served in the military.}
#' \item{\code{unemployment_20_64}}{Unemployment rate for those age 20 to 64.}
#' \item{\code{uninsured}}{Percent of the civilian population who is uninsured.}
#' \item{\code{uninsured_6}}{Percent of population under the age of 6 who are uninsured.}
#' \item{\code{uninsured_19}}{Percent of the population under the age of 19 who are uninsured.}
#' \item{\code{uninsured_65}}{Percent of the population age 65 and older who are uninsured.}
#' \item{\code{computers}}{Percent of households that have a laptop or desktop computer.}
#' \item{\code{smartphones}}{Percent of households that have a smartphone.}
#' \item{\code{broadband}}{Percent of households with computers that have access to broadband internet.}
#' }
#' @source \url{https://www.census.gov/programs-surveys/acs/data.html} collected using the `tidycensus` package.
#'
"county_2023"
12 changes: 12 additions & 0 deletions R/data-generation_climate_action.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#' Poll on climate change activism
#'
#' A Pew Research poll published in May of 2021 looks at how Americans' attitudes about climate change differ by generation, party and other factors.
#'
#' @format A data frame with 13664 observations on the following 2 variables.
#' \describe{
#' \item{\code{generation}}{a factor with levels \code{Gen Z, Millenial, Gen X} and \code{Boomer & older}}
#' \item{\code{response}}{a factor with levels \code{Took action} and \code{Did not take action}}
#' }
#'
#' @source Pew Research Center, American Trends Panel. Survey conducted April 20 - 29, 2021. "Gen Z, Millennials Stand Out for Climate Change Activism, Social Media Engagement With Issue"
"generation_climate_action"
36 changes: 36 additions & 0 deletions R/data-sdea.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#' Spatial distancing, emotional arousal
#'
#' This dataset is from a published research paper examining the effects of
#' spatial distancing on emotional arousal to reactivated memories. It contains
#' data on gender, age, trait reappraisal and suppression, desirability, and
#' self-reported distress before and after experimental sessions (across three
#' days). Participants underwent an experimental session, where they viewed images
#' from the IAPs. For day 2, participants were spilt into four groups:
#' reactivation + regulation, no regulation, no reactivation, no regulation.
#' The reactivation & regulation group viewed emotional objects cut from the
#' pictures and were asked to regulate them. When they saw the word "far" they
#' had to imagine the object was far away from them.
#'
#' @format A data frame with 175 rows and 14 variables.
#' \describe{
#' \item{id}{Subject ID number.}
#' \item{gender}{M = Male; F = Female.}
#' \item{age}{Age of the participants.}
#' \item{condition}{1 = Reactivation + Regulation; 2= No Regulation; 3 = No Reactivation; 4 = Neither.}
#' \item{sds_17}{Social desirability scale.}
#' \item{erq_reappraisal}{motion Regulation Questionnaire - Reappraisal Subscale.}
#' \item{erq_suppression}{Emotion Regulation Questionnaire - Suppression Subscale.}
#' \item{day1_pre_suds}{Day 1 Subjective Units of Distress Scale Pre-Session.}
#' \item{day1_post_suds}{Day 1 Subjective Units of Distress Scale Post-Session.}
#' \item{day2_pre_suds}{Day 2 Subjective Units of Distress Scale Pre-Session.}
#' \item{day2_post_suds}{Day 2 Subjective Units of Distress Scale Post-Session.}
#' \item{day3_pre_suds}{Day 3 Subjective Units of Distress Scale Pre-Session.}
#' \item{day3_post_suds}{Day 3 Subjective Units of Distress Scale Post-Session.}
#' \item{race}{The self identified race of the participant.}
#' }
#'
#' @source Parikh, N., McGovern, B. & LaBar, K.S. Spatial distancing reduces emotional arousal to reactivated memories. Psychon Bull Rev 26, 1967–1973 (2019).[Link to doi](https://doi.org/10.3758/s13423-019-01648-z)
#'
#' Parikh, N., McGovern, B., & LaBar, K. S. (2023). Data from: Spatial distancing reduces emotional arousal to reactivated memories. Duke Research Data Repositor [Link to full dataset](y. https://doi.org/10.7924/r4z89f54)
#'
"sdea"
36 changes: 36 additions & 0 deletions R/data-skill_acquisition.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#' Skill Acquisition
#'
#' This data set contains 1,035 observations of 18 variables from Experiment 1
#' of Kardas and O’Brien (2018). In this experiment, the authors randomly assigned
#' participants to one of six between-subject conditions in a 3 (type of exposure:
#' watch, read, think) × 2 (amount of exposure: low, high) design. The key
#' dependent variable is perceived ability, operationalized as how much
#' participants believed they could pull off a “tablecloth trick” (removing the
#' tablecloth from a table without upsetting the dishes on the table) based on
#' the type of training they received.
#'
#' @format A data frame with 1035 rows and 18 variables.
#' \describe{
#' \item{p_number}{participant ID}
#' \item{heard_before}{Whether the participant knows what “the tablecloth trick” was before the beginning of the study with levels 1 = Yes and 2 = No. All participants completed the study but participants who indicated they did not know were excluded from the analysis.}
#' \item{type_of_info}{Experimental condition for type of exposure with levels 1 = Watching, 2 = Reading and 3 = Control.}
#' \item{amt_of_info}{Experimental condition for amount of exposure with levels 1 = Low Exposure and 2 = High Exposure.}
#' \item{perceived_ability}{Dependent variable; “You jump in and give the trick ONE SHOT yourself. What do you feel are the chances that you’d successfully pull it off?” on a 1 to 7 scale where 1 = I feel there’s no chance at all I’d succeed on this attempt, 7 = I feel I’d definitely succeed without a doubt on this attempt.}
#' \item{manipulation_check}{Manipulation check for amount of information; “About how much of this ‘more information’ do you feel you were given?” on a 1 to 7 scale where 1 = very little/went by quickly, 7 = a lot/displayed for a while.}
#' \item{technical_difficulties}{Whether participants had any technical difficulties with levels 0 = No and 1 = Yes.}
#' \item{technical_difficulties_description}{Free text describing the technical difficulty.}
#' \item{gender}{Participant’s gender with levels 1 = Male, 2 = Female and 3 = Other.}
#' \item{ethnic_1}{Participant identified as Black with levels 0 = No, 1 = Yes.}
#' \item{ethnic_2}{Participant identified as Hispanic with levels 0 = No, 1 = Yes.}
#' \item{ethnic_3}{Participant identified as Asian with levels 0 = No, 1 = Yes.}
#' \item{ethnic_4}{Participant identified as American Indian with levels 0 = No, 1 = Yes.}
#' \item{ethnic_5}{Participant identified as White with levels 0 = No, 1 = Yes.}
#' \item{ethnic_6 }{Participant identified as Other with levels 0 = No, 1 = Yes.}
#' \item{age}{Participant’s age in years.}
#' \item{tried_before}{Whether participants had ever previously attempted a tablecloth trick in their everyday lives with levels 1 = Yes and 2 = No.}
#' \item{fail_ac}{Whether a participant failed an attention check with levels 0 = did not fail any attention checks and 1 = failed one or more attention checks.}
#' }
#'
#' @source Kardas, M., & O’Brien, E. (2018). Easier seen than done: Merely watching others perform can foster an illusion of skill acquisition. Psychological Science, 29(4), 521-536. [Link to doi](https://doi.org/10.1177/0956797617740646) [Link to full dataset](https://osf.io/u3byh/files/bfj8n)
#'
"skill_acquisition"
19 changes: 19 additions & 0 deletions data-raw/Brazil_death_anxiety/Brazil_death_anxiety-dataprep.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# load packages ----------------------------------------------------------------

library(tidyverse)
library(janitor)

# load data --------------------------------------------------------------------

Brazil_death_anxiety <- read_csv("data-raw/Brazil_death_anxiety/Brazil_death_anxiety.csv")

# cleaning: clean names --------------------------------------------------------

Brazil_death_anxiety <- Brazil_death_anxiety |>
clean_names() |>
select(-country) |>
rename(employment = employment_fulltime)

# save -------------------------------------------------------------------------

usethis::use_data(Brazil_death_anxiety, overwrite = TRUE)
Loading
Loading