Load libraries and data

library(tidyverse) 
## ── 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
data <- read.csv("~/Google Drive/My Drive/YEAR 2/PROJECTS/DEREK/Tipping points/Pilot/tippingpoint_pilotdata.csv") %>% 
  slice(-c(1:2)) %>% 
  filter(attn_check == 2) %>% 
  mutate(pass = ifelse((Condition == "man" & mani_check == 1), 1,
                       ifelse((Condition == "woman" & mani_check == 2), 2, NA))) %>% 
  filter(!is.na(pass)) %>% 
  filter(reflect_1 == 1)

Clean data

# Make a DF for each tipping point

data_analysis_1 <- data %>% 
  mutate(tipping_point = ifelse(neutral_1 == 1, 1, 0)) %>% 
  filter(tipping_point == 1) 

data_analysis_2 <- data %>% 
  mutate(tipping_point = ifelse((neutral_2 == 1 & neutral_1 == 2), 2, 0)) %>% 
  filter(tipping_point == 2) 

data_analysis_3 <- data %>% 
  mutate(tipping_point = ifelse((neutral_3 == 1 & neutral_2 == 2 & neutral_1 == 2), 3, 0)) %>% 
  filter(tipping_point == 3)

data_analysis_4 <- data %>% 
  mutate(tipping_point = ifelse((neutral_4 == 1 & neutral_3 == 2 & neutral_2 == 2 & neutral_1 == 2), 4, 0)) %>% 
  filter(tipping_point == 4)

data_analysis_5 <- data %>% 
  mutate(tipping_point = ifelse((neutral_5 == 1 & neutral_4 == 2 & neutral_3 == 2 & neutral_2 == 2 & neutral_1 == 2), 5, 0)) %>% 
  filter(tipping_point == 5)

data_analysis_6 <- data %>% 
  mutate(tipping_point = ifelse((neutral_6 == 1 & neutral_5 == 2 & neutral_4 == 2 & neutral_3 == 2 & neutral_2 == 2 & neutral_1 == 2), 6, 0)) %>% 
  filter(tipping_point == 6)

data_analysis_7 <- data %>% 
  mutate(tipping_point = ifelse((neutral_7 == 1 & neutral_6 == 2 & neutral_5 == 2 & neutral_4 == 2 & neutral_3 == 2 & neutral_2 == 2 & neutral_1 == 2), 7, 0)) %>% 
  filter(tipping_point == 7)

data_analysis_8 <- data %>% 
  mutate(tipping_point = ifelse((neutral_8 == 1 & neutral_7 == 2 & neutral_6 == 2 & neutral_5 == 2 & neutral_4 == 2 & neutral_3 == 2 & neutral_2 == 2 & neutral_1 == 2), 8, 0)) %>% 
  filter(tipping_point == 8)

data_analysis_9 <- data %>% 
  mutate(tipping_point = ifelse((neutral_9 == 1 & neutral_8 == 2 & neutral_7 == 2 & neutral_6 == 2 & neutral_5 == 2 & neutral_4 == 2 & neutral_3 == 2 & neutral_2 == 2 & neutral_1 == 2), 9, 0)) %>% 
  filter(tipping_point == 9)

data_analysis_10 <- data %>% 
  mutate(tipping_point = ifelse((neutral_10 == 1 & neutral_9 == 2 & neutral_8 == 2 & neutral_7 == 2 & neutral_6 == 2 & neutral_5 == 2 & neutral_4 == 2 & neutral_3 == 2 & neutral_2 == 2 & neutral_1 == 2), 10, 0)) %>% 
  filter(tipping_point == 10)

data_analysis_never <- data %>% 
  mutate(tipping_point = ifelse((neutral_10 == 2 & neutral_9 == 2 & neutral_8 == 2 & neutral_7 == 2 & neutral_6 == 2 & neutral_5 == 2 & neutral_4 == 2 & neutral_3 == 2 & neutral_2 == 2 & neutral_1 == 2), 11, NA)) %>% 
  filter(tipping_point == 11)

data_full <- data_analysis_1 %>% 
  rbind(data_analysis_2, data_analysis_3, data_analysis_4, data_analysis_5, data_analysis_6, data_analysis_7, data_analysis_8, data_analysis_9, data_analysis_10, data_analysis_never)

Look at variation in tipping points based on condition assignment

Condition assignment = gender of the deviant (man / woman)

table(data_full$Condition, data_full$tipping_point)
##        
##          1  2  3  4  5  6  7  8  9 10 11
##   man   15  8 30 15 11  3  2  1  1  2  9
##   woman  7  6 24 15 11  4  7  1  0  3 15

11 means that the participants never indicated a tip

ggplot(data = data_full, 
       aes(x = Condition, y = tipping_point)) +
  geom_point(alpha = 0.1,
             size = 2,
             position = position_jitter(0.1)) +
  stat_summary(fun.data = "mean_cl_boot",
               size = 1,
               geom = "linerange",
               color = "grey50")+
  stat_summary(fun = "mean",
               size = 0.3)+
  theme_bw() 
## Warning: Using `size` aesthetic for lines was deprecated in ggplot2 3.4.0.
## ℹ Please use `linewidth` instead.
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
## generated.
## Warning: Removed 2 rows containing missing values or values outside the scale range
## (`geom_segment()`).

t.test(tipping_point ~ Condition, data = data_full, var.equal = F)
## 
##  Welch Two Sample t-test
## 
## data:  tipping_point by Condition
## t = -2.3142, df = 184.13, p-value = 0.02176
## alternative hypothesis: true difference in means between group man and group woman is not equal to 0
## 95 percent confidence interval:
##  -1.8856033 -0.1500912
## sample estimates:
##   mean in group man mean in group woman 
##            4.164948            5.182796

Looks like the tipping point for women deviants is higher: it takes more evidence to be convinced that the norm has changed based on a woman’s behavior

Is helpfulness typed?

data_full$perceived_type_numeric = as.numeric(data_full$perceived_type)

mean(data_full$perceived_type_numeric)
## [1] 4.631579

Self interest is slightly more male-typed

On the scale: 1 = Strongly associated with women, 4 = equally associated with men and women, 7 = Strongly associated with men

Would want to measure this in a pilot where there is no manipulation though.

Does the gender of participants matter?

# Fit model
model <- data_full %>% 
  filter(gender == 1 | gender == 2) %>% 
  lm(tipping_point ~ Condition * gender, .)

# Display model summary
summary(model)
## 
## Call:
## lm(formula = tipping_point ~ Condition * gender, data = .)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -4.6744 -1.9200 -0.9200  0.7111  7.0800 
## 
## Coefficients:
##                        Estimate Std. Error t value Pr(>|t|)    
## (Intercept)              3.9200     0.4263   9.194   <2e-16 ***
## Conditionwoman           1.7544     0.6270   2.798   0.0057 ** 
## gender2                  0.3689     0.6195   0.595   0.5523    
## Conditionwoman:gender2  -1.2135     0.8880  -1.367   0.1734    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 3.015 on 181 degrees of freedom
## Multiple R-squared:  0.04591,    Adjusted R-squared:  0.0301 
## F-statistic: 2.903 on 3 and 181 DF,  p-value: 0.03624

Doesn’t seem like there’s an interaction.

How should we power a full study?

library(pwr)
library(rstatix)
## 
## Attaching package: 'rstatix'
## The following object is masked from 'package:stats':
## 
##     filter
data_full %>% 
  cohens_d(tipping_point ~ Condition, var.equal = F)
## # A tibble: 1 × 7
##   .y.           group1 group2 effsize    n1    n2 magnitude
## * <chr>         <chr>  <chr>    <dbl> <int> <int> <ord>    
## 1 tipping_point man    woman   -0.336    97    93 small
pwr.t.test(d = .33, sig.level = 0.05, power = 0.8)
## 
##      Two-sample t test power calculation 
## 
##               n = 145.1147
##               d = 0.33
##       sig.level = 0.05
##           power = 0.8
##     alternative = two.sided
## 
## NOTE: n is number in *each* group

Need a sample of 300. We had 200 here.