- [[240903_162316 effect size|effect size harris vote minus trump vote]]
Let $t_i p_i$ be trump vote and $(1-t_i)p_i$ be harris vote.
- $\text{diff}_{pre} = ((1-t_i)p_i)_{pre} - (t_i p_i)_{pre}$
- `harris_trump_vote_1` in code
- $\text{diff}_{post} = ((1-t_i)p_i)_{post} - (t_i p_i)_{post}$
- `harris_trump_vote_2` in code
- $\text{diff harris trump vote} = \text{diff}_{post} - \text{diff}_{pre}$
- `diff_harris_trump_vote` in code below
```r
# separate models for each condition
> d1[, summ(lm(diff_harris_trump_vote ~ 1)), by = .(condition)]
condition term result
<char> <char> <char>
1: persuadeHarris (Intercept) b = 0.03 (0.01) [0.02, 0.04] p < .001
2: persuadeTrump (Intercept) b = -0.03 (0.01) [-0.04, -0.02] p < .001
# separate models for each condition and topic
> d1[, summ(lm(diff_harris_trump_vote ~ 1)), by = .(condition, topic)]
condition topic term result
<char> <char> <char> <char>
1: persuadeHarris policy (Intercept) b = 0.04 (0.01) [0.02, 0.05] p < .001
2: persuadeHarris personality (Intercept) b = 0.02 (0.01) [0.00, 0.04] p = .047
3: persuadeTrump policy (Intercept) b = -0.03 (0.01) [-0.05, -0.02] p < .001
4: persuadeTrump personality (Intercept) b = -0.03 (0.01) [-0.04, -0.01] p < .001
# extra stuff (other model specifications)
# diff ~ pre * condition
> d1[, summ(lm(diff_harris_trump_vote ~ condition * topicZ * harris_trump_vote_1Z))]
term result
<char> <char>
1: (Intercept) b = 0.03 (0.01) [0.02, 0.04] p < .001
2: conditionpersuadeTrump b = -0.06 (0.01) [-0.07, -0.04] p < .001
3: topicZ b = 0.01 (0.01) [0.00, 0.02] p = .108
4: harris_trump_vote_1Z b = -0.01 (0.01) [-0.03, 0.00] p = .010
5: conditionpersuadeTrump × topicZ b = -0.01 (0.01) [-0.03, 0.00] p = .114
6: conditionpersuadeTrump × harris_trump_vote_1Z b = 0.01 (0.01) [0.00, 0.03] p = .145
7: topicZ × harris_trump_vote_1Z b = 0.00 (0.01) [-0.01, 0.01] p = .772
8: conditionpersuadeTrump × topicZ × harris_trump_vote_1Z b = 0.00 (0.01) [-0.02, 0.01] p = .646
# diff ~ pre * condition + 0 (remove intercept)
> d1[, summ(lm(diff_harris_trump_vote ~ 0 + condition * topicZ * harris_trump_vote_1Z))]
term result
<char> <char>
1: conditionpersuadeHarris b = 0.03 (0.01) [0.02, 0.04] p < .001
2: conditionpersuadeTrump b = -0.03 (0.01) [-0.04, -0.02] p < .001
3: topicZ b = 0.01 (0.01) [0.00, 0.02] p = .108
4: harris_trump_vote_1Z b = -0.01 (0.01) [-0.03, 0.00] p = .010
5: conditionpersuadeTrump × topicZ b = -0.01 (0.01) [-0.03, 0.00] p = .114
6: conditionpersuadeTrump × harris_trump_vote_1Z b = 0.01 (0.01) [0.00, 0.03] p = .145
7: topicZ × harris_trump_vote_1Z b = 0.00 (0.01) [-0.01, 0.01] p = .772
8: conditionpersuadeTrump × topicZ × harris_trump_vote_1Z b = 0.00 (0.01) [-0.02, 0.01] p = .646
# post ~ pre * condition
> summ(lm(harris_trump_vote_2 ~ condition * topicZ * harris_trump_vote_1Z, d1))
term result
<char> <char>
1: (Intercept) b = 0.16 (0.01) [0.15, 0.17] p < .001
2: conditionpersuadeTrump b = -0.06 (0.01) [-0.07, -0.04] p < .001
3: topicZ b = 0.01 (0.01) [0.00, 0.02] p = .108
4: harris_trump_vote_1Z b = 0.78 (0.01) [0.77, 0.79] p < .001
5: conditionpersuadeTrump × topicZ b = -0.01 (0.01) [-0.03, 0.00] p = .114
6: conditionpersuadeTrump × harris_trump_vote_1Z b = 0.01 (0.01) [0.00, 0.03] p = .145
7: topicZ × harris_trump_vote_1Z b = 0.00 (0.01) [-0.01, 0.01] p = .772
8: conditionpersuadeTrump × topicZ × harris_trump_vote_1Z b = 0.00 (0.01) [-0.02, 0.01] p = .646
```
# previous calculations
Let $t_i p_i$ (trump vote) and $(1-t_i)p_i$ (harris vote).
- $\text{diff trump vote} = (t_i p_i)_{post} - (t_i p_i)_{pre}$
- $\text{diff harris vote} = ((1-t_i)p_i)_{post} - ((1-t_i)p_i)_{pre}$
```r
> summ(feols(diff_harris_vote ~ condition, d1))
term result
<char> <char>
1: (Intercept) b = 0.02 (0.00) [0.02, 0.03] p < .001
2: conditionpersuadeTrump b = -0.03 (0.00) [-0.04, -0.02] p < .001
> summ(feols(diff_trump_vote ~ condition, d1))
term result
<char> <char>
1: (Intercept) b = -0.01 (0.00) [-0.01, 0.00] p = .020
2: conditionpersuadeTrump b = 0.03 (0.00) [0.02, 0.04] p < .001
> summ(feols(diff_harris_vote ~ condition * topicZ, d1))
term result
<char> <char>
1: (Intercept) b = 0.02 (0.00) [0.02, 0.03] p < .001
2: conditionpersuadeTrump b = -0.03 (0.00) [-0.04, -0.02] p < .001
3: topicZ b = 0.00 (0.00) [0.00, 0.01] p = .360
4: conditionpersuadeTrump × topicZ b = -0.01 (0.00) [-0.01, 0.00] p = .262
> summ(feols(diff_trump_vote ~ condition * topicZ, d1))
term result
<char> <char>
1: (Intercept) b = -0.01 (0.00) [-0.01, 0.00] p = .021
2: conditionpersuadeTrump b = 0.03 (0.00) [0.02, 0.04] p < .001
3: topicZ b = -0.01 (0.00) [-0.01, 0.00] p = .065
4: conditionpersuadeTrump × topicZ b = 0.01 (0.00) [0.00, 0.02] p = .106
# maybe the models below aren't as kosher since initial lean was used to calculate the outcome itself
> summ(feols(diff_harris_vote ~ condition * topicZ * lean_bidentrump_1Z, d1))
term result
<char> <char>
1: (Intercept) b = 0.02 (0.00) [0.02, 0.03] p < .001
2: conditionpersuadeTrump b = -0.03 (0.00) [-0.04, -0.02] p < .001
3: topicZ b = 0.00 (0.00) [0.00, 0.01] p = .357
4: lean_bidentrump_1Z b = 0.00 (0.00) [0.00, 0.01] p = .552
5: conditionpersuadeTrump × topicZ b = -0.01 (0.00) [-0.01, 0.00] p = .263
6: conditionpersuadeTrump × lean_bidentrump_1Z b = 0.00 (0.00) [0.00, 0.01] p = .379
7: topicZ × lean_bidentrump_1Z b = 0.00 (0.00) [-0.01, 0.01] p = .918
8: conditionpersuadeTrump × topicZ × lean_bidentrump_1Z b = 0.00 (0.00) [-0.01, 0.01] p = .689
> summ(feols(diff_trump_vote ~ condition * topicZ * lean_bidentrump_1Z, d1))
term result
<char> <char>
1: (Intercept) b = -0.01 (0.00) [-0.01, 0.00] p = .023
2: conditionpersuadeTrump b = 0.03 (0.00) [0.02, 0.04] p < .001
3: topicZ b = -0.01 (0.00) [-0.01, 0.00] p = .063
4: lean_bidentrump_1Z b = -0.01 (0.00) [-0.01, 0.00] p = .010
5: conditionpersuadeTrump × topicZ b = 0.01 (0.00) [0.00, 0.02] p = .106
6: conditionpersuadeTrump × lean_bidentrump_1Z b = 0.02 (0.00) [0.01, 0.02] p = .001
7: topicZ × lean_bidentrump_1Z b = 0.00 (0.00) [-0.01, 0.01] p = .951
8: conditionpersuadeTrump × topicZ × lean_bidentrump_1Z b = 0.00 (0.00) [-0.01, 0.01] p = .697
```