if (!require(haven)){
install.packages("haven", dependencies = TRUE)
library(haven)
}Loading required package: haven
Haven enables R to read and write various data formats used by other statistical packages by wrapping the fantastic ReadStat C library written by Evan Miller.
https://www.rdocumentation.org/packages/haven/versions/2.5.1
if (!require(haven)){
install.packages("haven", dependencies = TRUE)
library(haven)
}Loading required package: haven
The tidyverse makes it easy for us to tidy, clean, manipulate and rearrange our data.
https://www.rdocumentation.org/packages/tidyverse/versions/1.3.2
if (!require(tidyverse)){
install.packages("tidyverse", dependencies = TRUE)
library(tidyverse)
}Loading required package: tidyverse
── Attaching packages ─────────────────────────────────────── tidyverse 1.3.2 ──
✔ ggplot2 3.4.0 ✔ purrr 1.0.1
✔ tibble 3.1.8 ✔ dplyr 1.0.10
✔ tidyr 1.2.1 ✔ stringr 1.5.0
✔ readr 2.1.3 ✔ forcats 0.5.2
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag() masks stats::lag()
dataset <- read_sav("https://osf.io/download/kd4ej/")t.test(formula = FFM_1 ~ CoinFlip,
data = dataset,
var.equal = FALSE)
Welch Two Sample t-test
data: FFM_1 by CoinFlip
t = -2.419, df = 76.753, p-value = 0.01793
alternative hypothesis: true difference in means between group 1 and group 2 is not equal to 0
95 percent confidence interval:
-1.0412385 -0.1009527
sample estimates:
mean in group 1 mean in group 2
3.307692 3.878788