── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
✔ dplyr 1.1.4 ✔ readr 2.1.5
✔ forcats 1.0.0 ✔ stringr 1.5.1
✔ ggplot2 3.5.1 ✔ tibble 3.2.1
✔ lubridate 1.9.3 ✔ tidyr 1.3.1
✔ purrr 1.0.2
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag() masks stats::lag()
ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(readr)library(readxl)library(here)
here() starts at /Users/ethanmilne/Documents/GitHub/ApproachingSignificance
library(reshape2)
Attaching package: 'reshape2'
The following object is masked from 'package:tidyr':
smiths
library(ggtext)library(ggpubr)
Load Data
raw <-read_csv(here(getwd(), "Data", "qualtrics_clean.csv")) |>rename()
Rows: 200 Columns: 40
── Column specification ────────────────────────────────────────────────────────
Delimiter: ","
chr (40): participantId, Politics, donate, donate_foreign, animal_welfare, c...
ℹ Use `spec()` to retrieve the full column specification for this data.
ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
We fitted a linear model (estimated using OLS) to predict avg_valence with
count_of_stimuli (formula: avg_valence ~ count_of_stimuli). The model explains
a statistically not significant and very weak proportion of variance (R2 =
0.02, F(1, 97) = 1.64, p = 0.203, adj. R2 = 6.52e-03). The model's intercept,
corresponding to count_of_stimuli = 0, is at 3.65 (95% CI [3.55, 3.75], t(97) =
70.34, p < .001). Within this model:
- The effect of count of stimuli is statistically non-significant and negative
(beta = -0.01, 95% CI [-0.03, 6.47e-03], t(97) = -1.28, p = 0.203; Std. beta =
-0.13, 95% CI [-0.33, 0.07])
Standardized parameters were obtained by fitting the model on a standardized
version of the dataset. 95% Confidence Intervals (CIs) and p-values were
computed using a Wald t-distribution approximation.
overall_ttest <-t.test(overall_avg_data$overall_politics, mu =4)study1_results[["overall_ttest"]] <- overall_ttestoverall_ttest
One Sample t-test
data: overall_avg_data$overall_politics
t = -20.905, df = 463, p-value < 2.2e-16
alternative hypothesis: true mean is not equal to 4
95 percent confidence interval:
3.531445 3.611965
sample estimates:
mean of x
3.571705
Welch Two Sample t-test
data: overall_avg_data$dem_politics and overall_avg_data$rep_politics
t = -20.367, df = 906.01, p-value < 2.2e-16
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
-0.6740599 -0.5555704
sample estimates:
mean of x mean of y
3.255110 3.869925
overall_rep_ttest <-t.test(overall_avg_data$rep_politics, mu =4)study1_results[["overall_rep_ttest"]] <- overall_rep_ttestoverall_rep_ttest
One Sample t-test
data: overall_avg_data$rep_politics
t = -5.6861, df = 463, p-value = 2.305e-08
alternative hypothesis: true mean is not equal to 4
95 percent confidence interval:
3.824972 3.914879
sample estimates:
mean of x
3.869925
overall_dem_ttest <-t.test(overall_avg_data$dem_politics, mu =4)study1_results[["overall_dem_ttest"]] <- overall_dem_ttestoverall_dem_ttest
One Sample t-test
data: overall_avg_data$dem_politics
t = -37.818, df = 463, p-value < 2.2e-16
alternative hypothesis: true mean is not equal to 4
95 percent confidence interval:
3.216405 3.293816
sample estimates:
mean of x
3.25511
Religion Analysis
Overall
religion_ttest <-t.test(clean$religion, mu =4)study1_results[["religion_ttest"]] <- religion_ttestreligion_ttest
One Sample t-test
data: clean$religion
t = 15.509, df = 199, p-value < 2.2e-16
alternative hypothesis: true mean is not equal to 4
95 percent confidence interval:
5.444575 5.865425
sample estimates:
mean of x
5.655
Democrats
dem_religion_ttest <-t.test(clean[clean$Politics=="Democrats",]$religion, mu =4)study1_results[["dem_religion_ttest"]] <- dem_religion_ttestdem_religion_ttest
One Sample t-test
data: clean[clean$Politics == "Democrats", ]$religion
t = 10.557, df = 96, p-value < 2.2e-16
alternative hypothesis: true mean is not equal to 4
95 percent confidence interval:
5.314226 5.922887
sample estimates:
mean of x
5.618557
Republicans
rep_religion_ttest <-t.test(clean[clean$Politics=="Republicans",]$religion, mu =4)study1_results[["rep_religion_ttest"]] <- rep_religion_ttestrep_religion_ttest
One Sample t-test
data: clean[clean$Politics == "Republicans", ]$religion
t = 11.318, df = 102, p-value < 2.2e-16
alternative hypothesis: true mean is not equal to 4
95 percent confidence interval:
5.393264 5.985377
sample estimates:
mean of x
5.68932