Registered S3 method overwritten by 'GGally':
method from
+.gg ggplot2
Gathering
Next, we download the data from the Google Sheet where it is collected. Dr. Gilmore has stored his Google account credentials in a special environment file that can be accessed by the R command Sys.getenv("GMAIL_SURVEY").
if (!dir.exists('csv')) {message("Creating missing `csv/`.")dir.create("csv")}if (params$update_data) {options(gargle_oauth_email =Sys.getenv("GMAIL_SURVEY")) googledrive::drive_auth() googledrive::drive_download("Openness and Trust in Science (Responses)",path ="csv/survey-01-openness-trust.csv",type ="csv",overwrite =TRUE )messsage("Data updated.")} else {message("Using stored data.")}
The data file has been saved as a comma-separated value (CSV) format data file in a special directory called csv/.
Note
Because these data might contain sensitive or identifiable information, we only keep a local copy and do not share it publicly via GitHub. This is achieved by adding the name of the data directory to a special .gitignore file.
Cleaning
Next we load the data file and clean it.
survey_01 <- readr::read_csv("csv/survey-01-openness-trust.csv", show_col_types =FALSE)# Google Forms puts the full question in the top row of the data file.# We use the names() function to extract and print the original questions.survey_01_qs <-names(survey_01)survey_01_qs
[1] "Timestamp"
[2] "I have at times changed opinions that were important to me, when someone showed me I was wrong."
[3] "I am willing to change my position on an important issue in the face of good reasons."
[4] "I am open to revising my important beliefs in the face of new information."
[5] "I am willing to change my opinions on the basis of compelling reason."
[6] "I’m willing to change my mind once it’s made up about an important topic."
[7] "Scientists ignore evidence that contradicts their work."
[8] "Scientific theories are weak explanations."
[9] "Scientists intentionally keep their work secret."
[10] "Scientists don't value the ideas of others."
[11] "Scientists don't care if laypersons understand their work."
[12] "We should trust the work of scientists."
[13] "We should trust that scientists are being honest in their work."
[14] "We should trust that scientists are being ethical in their work."
[15] "People who understand science more have more trust in science."
[16] "We can trust science to find the answers that explain the natural world."
[17] "We cannot trust scientists because they are biased in their perspectives."
[18] "Scientists will protect each other even when they are wrong."
[19] "We cannot trust scientists to consider ideas that contradict their own."
[20] "Today's scientists will sacrifice the well being of others to advance their research."
[21] "We cannot trust science because it moves too slowly."
[22] "When scientists change their mind about a scientific idea it diminishes my trust in their work."
[23] "We can trust scientists to share their discoveries even if they don't like their findings."
[24] "I trust that the work of scientists is to make life better for people."
[25] "Scientific theories are trustworthy."
[26] "When scientists form a hypothesis they are just guessing."
[27] "I trust scientists can find solutions to our major technological problems."
[28] "If you wish to comment about the questions in this survey, you may do so here. You are not required to comment. Your comments might be seen by others."
For plotting and analyses, it’s usually easier to shorten the questions by creating a short name that reflects the underlying idea or construct. We’ll use the rename() function from the dplyr package for this.
We first rename the variables from the “Openness to Revising One’s Viewpoint” subscale from the Comprehensive Intellectual Humility Scale (Krumrei-Mancuso & Rouse, 2016).
survey_01_clean <- survey_01 |> dplyr::rename(timestamp ="Timestamp",when_shown_wrong ="I have at times changed opinions that were important to me, when someone showed me I was wrong.",good_reason ="I am willing to change my position on an important issue in the face of good reasons." ,new_info ="I am open to revising my important beliefs in the face of new information.",compelling_reason ="I am willing to change my opinions on the basis of compelling reason.",mind_made_up ="I’m willing to change my mind once it’s made up about an important topic.",comments ="If you wish to comment about the questions in this survey, you may do so here. You are not required to comment. Your comments might be seen by others." )
Now, we rename the variables from the (Nadelson et al., 2014) trust in science and scientists survey.
survey_01_clean <- survey_01_clean |> dplyr::rename(ignore_contradictory_evidence ="Scientists ignore evidence that contradicts their work.",theories_are_weak ="Scientific theories are weak explanations.",keep_work_secret ="Scientists intentionally keep their work secret.",dont_value_others_ideas ="Scientists don't value the ideas of others.",dont_care_laypeople_understand ="Scientists don't care if laypersons understand their work.",should_trust_work ="We should trust the work of scientists.",should_trust_honesty ="We should trust that scientists are being honest in their work.",should_trust_ethical ="We should trust that scientists are being ethical in their work.",more_understanding_more_trust ="People who understand science more have more trust in science.",trust_explain_natural_world ="We can trust science to find the answers that explain the natural world.",cant_trust_biased ="We cannot trust scientists because they are biased in their perspectives.",protect_each_other_when_wrong ="Scientists will protect each other even when they are wrong.",wont_consider_contradictory_ideas ="We cannot trust scientists to consider ideas that contradict their own.",sacrifice_others_to_advance ="Today's scientists will sacrifice the well being of others to advance their research.",cant_trust_moves_slowly ="We cannot trust science because it moves too slowly.",change_minds_undermines_trust ="When scientists change their mind about a scientific idea it diminishes my trust in their work.",share_findings_dont_like ="We can trust scientists to share their discoveries even if they don't like their findings.",make_life_better ="I trust that the work of scientists is to make life better for people.",theories_trustworthy ="Scientific theories are trustworthy.",hypotheses_just_guesses ="When scientists form a hypothesis they are just guessing.",trust_find_tech_solutions ="I trust scientists can find solutions to our major technological problems." )
Now, let’s look at the names to confirm they all got changed.
It would be even better to create a function that generates the plot and shows the long and short question names. Any time I repeat myself, I should remember this acronym:
Don’t Repeat Yourself
Write It Down
There are a number of these, so we break them into smaller groups for visualization.
For some of them I put 3 because they are very contextual and it felt wrong to ascribe a quality to the group when I feel only a few outliers would fit the criteria for the question
The more that people are not in agreement over a topic the more testing that both sides will perform. Which could ultimately give the real solution
Aggregate openness and trust questions
Next, we calculate aggregate “openness” and “trust” scores to look at the relationship between these variables.
Some of the “trust” variables are reverse-coded, so we have to address that. We’ll start by adding a variable to our data dictionary that indicates the “sign” of the weight we should apply to that variable. If the sign is negative then \(1\rightarrow5\), \(2\rightarrow4\), \(3\rightarrow3\), \(4\rightarrow5\), and \(5\rightarrow1\).
I have at times changed opinions that were important to me, when someone showed me I was wrong.
when_shown_wrong
1
I am willing to change my position on an important issue in the face of good reasons.
good_reason
1
I am open to revising my important beliefs in the face of new information.
new_info
1
I am willing to change my opinions on the basis of compelling reason.
compelling_reason
1
I’m willing to change my mind once it’s made up about an important topic.
mind_made_up
1
Scientists ignore evidence that contradicts their work.
ignore_contradictory_evidence
-1
Scientific theories are weak explanations.
theories_are_weak
-1
Scientists intentionally keep their work secret.
keep_work_secret
-1
Scientists don't value the ideas of others.
dont_value_others_ideas
-1
Scientists don't care if laypersons understand their work.
dont_care_laypeople_understand
-1
We should trust the work of scientists.
should_trust_work
1
We should trust that scientists are being honest in their work.
should_trust_honesty
1
We should trust that scientists are being ethical in their work.
should_trust_ethical
1
People who understand science more have more trust in science.
more_understanding_more_trust
1
We can trust science to find the answers that explain the natural world.
trust_explain_natural_world
1
We cannot trust scientists because they are biased in their perspectives.
cant_trust_biased
-1
Scientists will protect each other even when they are wrong.
protect_each_other_when_wrong
-1
We cannot trust scientists to consider ideas that contradict their own.
wont_consider_contradictory_ideas
-1
Today's scientists will sacrifice the well being of others to advance their research.
sacrifice_others_to_advance
-1
We cannot trust science because it moves too slowly.
cant_trust_moves_slowly
-1
When scientists change their mind about a scientific idea it diminishes my trust in their work.
change_minds_undermines_trust
-1
We can trust scientists to share their discoveries even if they don't like their findings.
share_findings_dont_like
1
I trust that the work of scientists is to make life better for people.
make_life_better
1
Scientific theories are trustworthy.
theories_trustworthy
1
When scientists form a hypothesis they are just guessing.
hypotheses_just_guesses
-1
I trust scientists can find solutions to our major technological problems.
trust_find_tech_solutions
1
If you wish to comment about the questions in this survey, you may do so here. You are not required to comment. Your comments might be seen by others.
comments
0
# Recode variables with "reverse" indicator (sign_x == -1)recode_reverse_vars <-function(x, sign_x) {if (sign_x ==-1) {switch(x,5,4,3,2,1) } else { x }}# Recode a specific variable based on its column indexrecode_var <-function(var_i, df_vars = survey_01_clean, df_dict = survey_01_data_dictionary) { vals <-unname(unlist(df_vars[, var_i])) wts <-unname(unlist(rep(df_dict[var_i, 4], length(vals)))) purrr::map2(vals, wts, recode_reverse_vars) |>unlist()}# Recode the entire dataset and create a new data frame/tibblerecode_survey_01 <-function() { x <- purrr::map(1:28, recode_var) var_names <- survey_01_data_dictionary[,2] |>unlist() |>unname()names(x) <- var_namesas_tibble(x)}# Run the recode_survey_01() functionsurvey_01_recoded <-recode_survey_01()# Calculate the composite scores as mean values across rows (within participants)survey_01_recoded <- survey_01_recoded |> dplyr::mutate(openness_comp =rowMeans(survey_01_recoded[, 2:6]),trust_comp =rowMeans(survey_01_recoded[, 7:27]))
Pearson's product-moment correlation
data: openness_comp and trust_comp
t = 0.35104, df = 9, p-value = 0.7336
alternative hypothesis: true correlation is not equal to 0
95 percent confidence interval:
-0.5199005 0.6694250
sample estimates:
cor
0.116221
References
Krumrei-Mancuso, E. J., & Rouse, S. V. (2016). The development and validation of the comprehensive intellectual humility scale. Journal of Personality Assessment, 98(2), 209–221. https://doi.org/10.1080/00223891.2015.1068174
Nadelson, L., Jorcyk, C., Yang, D., Jarratt Smith, M., Matson, S., Cornell, K., & Husting, V. (2014). I just don’t trust them: The development and validation of an assessment instrument to measure trust in science and scientists. School Science and Mathematics, 114(2), 76–86. https://doi.org/10.1111/ssm.12051
Plohl, N., & Musil, B. (2023). Assessing the incremental value of intellectual humility and cognitive reflection in predicting trust in science. Personality and Individual Differences, 214, 112340. https://doi.org/10.1016/j.paid.2023.112340
Comments