-
Notifications
You must be signed in to change notification settings - Fork 0
/
Robustness-Methods-and-Results.Rmd
1425 lines (1256 loc) · 64.4 KB
/
Robustness-Methods-and-Results.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
---
output: latex_fragment
editor_options:
chunk_output_type: console
bibliography: references.bib
csl: apa.csl
---
```{r}
#| label: setup
#| include: false
# R Studio Clean-Up
cat("\014") # clear console
# rm(list=ls()) # clear workspace - use restart R instead [cmd/alt + shift + F10]
gc() # garbage collector
# Install and Load Packages
# !IMPORTANT!
# BEFORE FIRST RENDER:
# To install all relevant packages please run "renv::restore()" (or renv::init() and then initiate from lockfile) in the console before the first use to ensure that all packages are using the correct version.
# to store the packages in a contained library within the project folder: renv::settings$use.cache(FALSE) and add 'RENV_CONFIG_SANDBOX_ENABLED = FALSE' to an '.Renviron' file
lib <- c(
"rmarkdown",
"knitr",
"berryFunctions",
"remedy",
"bookdown",
"brms",
"psych",
"ggplot2",
"ggthemes",
"purrr",
"haven",
"RColorBrewer",
"plotly",
"gridExtra",
"ggpattern",
"lme4",
"nlme",
"jtools",
"gtsummary",
"sessioninfo",
"tibble",
"pander",
"devtools",
"mada",
"data.table",
"plyr",
"dplyr",
"tidyr",
"Hmisc",
"kableExtra",
"papaja",
"stringr",
"stringi",
"reshape2",
"lubridate",
"misty",
"sjPlot",
"sjmisc",
"metafor"
)
invisible(lapply(lib, library, character.only = TRUE))
rm(lib)
# Load Custom Packages
source("./scripts/functions/fun.panel.R")
source("./scripts/functions/themes.R")
source("./scripts/functions/binaryCor.R")
source("./scripts/functions/MlCorMat.R")
source("./scripts/functions/MlTbl.R")
source("./scripts/functions/metaLmer.R")
# Markdown Options
knitr::opts_knit$set(root.dir = rprojroot::find_rstudio_root_file()) # set working directory
knitr::opts_knit$get("root.dir") # check working directory
options(
scipen = 999,
digits = 4,
width = 400
) # removes scientific quotation
# knitr::opts_chunk$set(echo = TRUE, cache = F, cache.path = rprojroot::find_rstudio_root_file('cache/')) # cache settings
# Global Chunk Options
knitr::opts_chunk$set(
fig.width = 12,
fig.height = 8,
fig.path = "Figures/",
echo = TRUE,
warning = FALSE,
message = FALSE
)
```
```{r}
#| label: import
#| include: false
load("data/wrangled.RData")
# remove accidental surplus to avoid conflicts
# rm(list = ls(pattern = "mdl|medicalSdtComp"))
```
As with the main analyses, full surveys are available in our OSF repository \citep{KreienkampMasked2022a} and the full data description is available in Online Supplementary Material A. Correlations and descriptive statistics of the included variables are available in \tblref{tab:descrFullWide} and \tblref{tab:descrOutWide}.
\subsection{Additional Materials}
In addition to the measurement of whether or not participants had an intergroup interaction and their situational core need fulfillment, we also included a number of variables that allowed us to assess the robustness of our results.
\subsubsection{Specific Psychological Needs} In addition to the intergroup contact dummy and situational core need reported in the main text, we included a common measure of three self-determination theory needs \citep[see][]{Downie2008}. The measurement was identical in all three studies. The items were introduced either by “\textit{During the interaction:}” or “\textit{This morning [/afternoon]:}” and measured autonomy (“\textit{I was myself.}”), competence (“\textit{I felt competent.}”), and relatedness (without intergroup contact “\textit{I had a strong need to belong}”; with intergroup contact: “\textit{I shared information about myself.}” and “\textit{The other(s) shared information about themselves.}”). All items were rated on a continuous slider scale from very little (-50) to a great deal (+50).
\subsubsection{Interaction Intent} To assess whether an interaction was accidental (vs. planned), we asked participants with a single item to report the extend to which "The interaction with -X- was accidental". The respondents were asked to report this context variable for all interactions they reported on using a continuous slider ranging from "not at all" (0), through "very little" (33) and "somewhat" (66), to "a great deal" (100). In all studies the scale showed a right skew (\textit{mean} = `r format(round(mean(dt_goal_directedness$InteractionAccidental, na.rm = TRUE), 2), nsmall = 2)`, \textit{sd} = `r format(round(sd(dt_goal_directedness$InteractionAccidental, na.rm = TRUE), 2), nsmall = 2)`).
\subsubsection{Goal-directedness}
```{r}
#| label: goal_directedness_descr
#| include: false
kappa.full <- function(x, name, ...){
xtab <- table(x)
diagonal.counts <- diag(xtab)
N <- sum(xtab)
row.marginal.props <- rowSums(xtab)/N
col.marginal.props <- colSums(xtab)/N
# Compute kappa (k)
Po <- sum(diagonal.counts)/N
Pe <- sum(row.marginal.props*col.marginal.props)
k <- (Po - Pe)/(1 - Pe)
se <- sqrt((Po*(1-Po))/(N*(1-Pe)^2)) # according to PMID: 23092060
lwr <- k-1.96*se
upr <- k+1.96*se
data.frame(name,Po,Pe,k,se,lwr,upr)
}
irr_practical <- dt_topic_coding %>%
select(practical_need_01,
practical_need_02) %>%
kappa.full(., "practical_need")
irr_practical_dum <- dt_topic_coding %>%
transmute(
practical_need_01_dum = ifelse(practical_need_01 == 2, 1, practical_need_01),
practical_need_02_dum = ifelse(practical_need_02 == 2, 1, practical_need_02)
) %>%
kappa.full(., "practical_need_dum")
irr_psychological <- dt_topic_coding %>%
select(psychological_need_01,
psychological_need_02) %>%
kappa.full(., "psychological_need")
irr_psychological_dum <- dt_topic_coding %>%
transmute(
practical_need_01_dum = ifelse(psychological_need_01 == 2, 1, psychological_need_01),
practical_need_02_dum = ifelse(psychological_need_02 == 2, 1, psychological_need_02)
) %>%
kappa.full(., "psychological_need_dum")
irr <- rbind(
irr_practical,
irr_practical_dum,
irr_psychological,
irr_psychological_dum
)
dt_topic_coding %>%
transmute(
practical_need_dum = ifelse(practical_need == 2, 1, practical_need),
psychological_need_dum = ifelse(psychological_need == 2, 1, psychological_need)
)
lab_mapping <- c("no need", "need")
goal_directedness_dist <- dt_goal_directedness %>%
transmute(
practical_need_dum = ifelse(practical_need == 2, 1, practical_need),
psychological_need_dum = ifelse(psychological_need == 2, 1, psychological_need)
) %>%
mutate(
practical_need_label = lab_mapping[match(practical_need_dum, c(0, 1))],
psychological_need_label = lab_mapping[match(psychological_need_dum, c(0, 1))]
) %>%
group_by(
practical_need_dum,
practical_need_label,
psychological_need_dum,
psychological_need_label
) %>%
summarise(count = n()) %>%
ungroup() %>%
na.omit %>%
mutate(
perc = count/sum(count)*100
)
ggplot(
goal_directedness_dist,
aes (
x = reorder(practical_need_label, practical_need_dum),
y = reorder(psychological_need_label, psychological_need_dum),
fill = count,
label = paste0(format(round(perc, 2), nsmall = 2), "%")
)) +
geom_tile() +
geom_text(col = "white") +
labs(x = "Practical Motive",
y = "Psychological Motive",
title = "Goal Directedness Coding") +
theme(legend.key.size = unit(0.75, "cm"))
```
To assess whether the need content (i.e., the motives) would impact the effect of the need fulfillment experiences, we manually coded the topics we extracted during the topic modeling on two dimensions of how much they reflect a practical and a psychological goal-directedness. We chose practical and psychological needs specifically as our dimensions to account for differences in the types of needs that participants commonly reported. With practical motives we refer to specific, tangible goals or tasks that participants aimed to accomplish during the interaction. These instrumental goals are usually observable, concrete, and often centered on external outcomes, such as acquiring resources, completing tasks, and addressing immediate challenges \citep[e.g.,][]{oduntan2019}. With psychological motives we refer to underlying motives or desires that are more abstract and relate to personal fulfillment and well-being. In contrast to practical needs, psychological needs delve into the subjective and internal aspects of human experiences. These needs pertain to emotions, social connections, and cognitive processes, reflecting individuals' quest for personal growth, well-being, and thriving in social relationships \citep[][]{dweck2017}. Note that with this approach any particular motive can include a practical and/or a psychological goal-directedness but can also be classified as not having any goal at all. The full coding protocol we developed with examples for each of the codes is available in our Online Supplemental Material D. After an initial training, each of the two coders independently coded the 47 topics on the two dimensions, using one of three options each (i.e., 0 = no goal, 1 = vague goal, 2 = clear goal). Inter-rater reliability assessments showed that for both the practical as well as the psychological needs, agreement was not optimal using the three answer options (agreement practical = `r irr$Po[irr$name == "practical_need"] %>% round(2) %>% format(nsmall = 2)`\%, agreement psychological = `r irr$Po[irr$name == "psychological_need"] %>% round(2) %>% format(nsmall = 2)`\%). However, most disagreements were, if a need was present, whether that need was vague (1) or concrete (2). We, thus, collapsed these two categories making the ratings binary (need absent vs. need present). With the simpler coding, inter-rater agreement for practical needs (`r irr$Po[irr$name == "practical_need_dum"] %>% round(2) %>% format(nsmall = 2)`\%) and the psychological need (`r irr$Po[irr$name == "psychological_need_dum"] %>% round(2) %>% format(nsmall = 2)`\%) were much more reliable. Using Cohen’s $\kappa$ as our measure of inter-rater reliability, we find that both the practical need coding (\textit{Cohen's} $\kappa$ = `r irr$k[irr$name == "practical_need_dum"] %>% round(2) %>% format(nsmall = 2)`, 95\%CI[`r irr$lwr[irr$name == "practical_need_dum"] %>% round(2) %>% format(nsmall = 2)`, `r ifelse(irr$upr[irr$name == "practical_need_dum"]>1, 1 %>% round(2) %>% format(nsmall = 2), irr$upr[irr$name == "practical_need_dum"] %>% round(2) %>% format(nsmall = 2))`]) as well as the psychological need coding (\textit{Cohen's} $\kappa$ = `r irr$k[irr$name == "psychological_need_dum"] %>% round(2) %>% format(nsmall = 2)`, 95\%CI[`r irr$lwr[irr$name == "psychological_need_dum"] %>% round(2) %>% format(nsmall = 2)`, `r ifelse(irr$upr[irr$name == "psychological_need_dum"]>1, 1 %>% round(2) %>% format(nsmall = 2), irr$upr[irr$name == "psychological_need_dum"] %>% round(2) %>% format(nsmall = 2))`]) were very good. We thus proceeded with this collapsed coding. After resolving coder disagreements and merging the codings back to the free-text responses, we found that a majority of responses showed both a practical as well as a psychological need (`r goal_directedness_dist$perc[goal_directedness_dist$practical_need_dum==1 & goal_directedness_dist$psychological_need_dum==1] %>% round(2) %>% format(nsmall=2)`\%) and only few responses had no goal at all (`r goal_directedness_dist$perc[goal_directedness_dist$practical_need_dum==0 & goal_directedness_dist$psychological_need_dum==0] %>% round(2) %>% format(nsmall=2)`\%) with the remaining `r goal_directedness_dist$perc[goal_directedness_dist$practical_need_dum+goal_directedness_dist$psychological_need_dum==1] %>% sum %>% round(2) %>% format(nsmall=2)`\% having either a practical or a psychological need only (see Online Supplemental Material A for more detailed tables and visualizations).
\subsubsection{Well-being} We measured experienced well-being using a visual analog scale adapted from \citet{davies2022}. Participants were asked to respond to the the question "How do you feel right now?" using a continuous visual slider ranging from "very sad"(-100) to "very happy" (100). The well-being ratings were generally normally distributed (\textit{mean} = `r format(round(mean(dt_goal_directedness$WellBeing, na.rm = TRUE), 2), nsmall = 2)`, \textit{sd} = `r format(round(sd(dt_goal_directedness$WellBeing, na.rm = TRUE), 2), nsmall = 2)`).
\subsection{Results}
To build further confidence in our results, we assessed a number of additional models that might offer alternative explanations. We will discuss the results in sequential order --- in every case first considering the a global test of the model across the three studies and only then assessing whether the global three-level regression model suppresses any important person-level variations within the studies.
\subsubsection{Contact specific}
```{r}
#| label: contact_overall
#| include: false
dt_exp_all <- dt_exp_all %>%
mutate(
OutgroupInteraction = (OutgroupInteraction-1.5)
)
contact_overall <- select_best_lmer_model(
data = dt_exp_all,
prediction_form = "CoreNeed * OutgroupInteraction",
structure = "study/PID",
dependent_var = "Attitude",
lmer_scale = TRUE
)
# contact_overall$anova
# contact_overall$choice
# contact_overall$lmer_model %>% summ(., confint = TRUE, digits = 3)
# contact_overall$lmer_model %>% summ(., confint = TRUE, digits = 3, scale = TRUE)
# interactions::sim_slopes(mdl_contact$lmerAttSlopeOverall, pred = CoreNeedC, modx = OutgroupInteraction, jnplot = TRUE)
# interactions::interact_plot(contact_overall$lmer_model, pred = CoreNeed, modx = OutgroupInteraction, interval = TRUE)
```
We begin our robustness analysis by testing whether the effect of core need fulfillment is specific to an actual outgroup contact, rather than need fulfillment in general. For this, we analyzed the generalized situational core need fulfillment (either during a contact or about the daytime in general) and tested whether the effect differed during experience sampling measurements with and without outgroup contacts. We start this test by assessing the effect across all three studies, using a three-level hierarchical model, where measurements are nested within participants, and participants are nested within studies. In this overall model, we found no main effect of core need fulfillment (random slopes model, grand-mean standardized to account for all levels of variance; `r get_latex_coef(contact_overall$lmer_coef, "CoreNeed")`) but a significant interaction effect of core need fulfillment and outgroup contact (`r get_latex_coef(contact_overall$lmer_coef, "CoreNeed:OutgroupInteraction")`; also see \tblref{tab:robustnessTblLong}). While the three-level hierarchical model can be sensitive to scaling issues, this already indicates that it is not key need fulfillment in general --- but only key need fulfillment during an outgroup contact that predicts more positive outgroup attitudes.
```{r}
#| label: contact_s1
#| include: false
contact_s1 <- select_best_lmer_model(
data = dt_exp_all %>% filter(study == 1),
prediction_form = "CoreNeedC * OutgroupInteraction",
structure = "PID",
dependent_var = "Attitude"
)
# contact_s1$anova
# contact_s1$choice
# contact_s1$lmer_model %>% summ(., confint = TRUE, digits = 3)
# contact_s1$lmer_model_z %>% summ(., confint = TRUE, digits = 3)
# interactions::sim_slopes(mdl_contact$lmerAttSlopeOverall, pred = CoreNeedC, modx = OutgroupInteraction, jnplot = TRUE)
# interactions::interact_plot(contact_s1$lmer_model, pred = CoreNeedC, modx = OutgroupInteraction, interval = TRUE)
```
```{r}
#| label: contact_s2
#| include: false
contact_s2 <- select_best_lmer_model(
data = dt_exp_all %>% filter(study == 2),
prediction_form = "CoreNeedC * OutgroupInteraction",
structure = "PID",
dependent_var = "Attitude"
)
# contact_s2$anova
# contact_s2$choice
# contact_s2$lmer_model %>% summ(., confint = TRUE, digits = 3)
# contact_s2$lmer_model_z %>% summ(., confint = TRUE, digits = 3)
# interactions::sim_slopes(mdl_contact$lmerAttSlopeOverall, pred = CoreNeedC, modx = OutgroupInteraction, jnplot = TRUE)
# interactions::interact_plot(contact_s2$lmer_model, pred = CoreNeedC, modx = OutgroupInteraction, interval = TRUE)
```
```{r}
#| label: contact_s3
#| include: false
contact_s3 <- select_best_lmer_model(
data = dt_exp_all %>% filter(study == 3),
prediction_form = "CoreNeedC * OutgroupInteraction",
structure = "PID",
dependent_var = "Attitude"
)
# contact_s3$anova
# contact_s3$choice
# contact_s3$lmer_model %>% summ(., confint = TRUE, digits = 3)
# contact_s3$lmer_model_z %>% summ(., confint = TRUE, digits = 3)
# interactions::sim_slopes(mdl_contact$lmerAttSlopeOverall, pred = CoreNeedC, modx = OutgroupInteraction, jnplot = TRUE)
# interactions::interact_plot(contact_s3$lmer_model, pred = CoreNeedC, modx = OutgroupInteraction, interval = TRUE)
```
```{r}
#| label: contact_study_coef
#| include: false
contact_study_coef <-
rbind(
contact_s1$lmer_coef %>% mutate(study = 1),
contact_s2$lmer_coef %>% mutate(study = 2),
contact_s3$lmer_coef %>% mutate(study = 3)
)
```
To ensure that the results are not affected by scaling issues (e.g., study-level variances suppressing person-level variances) or a similar Simpson's paradox, we additionally assess the model within each of the three studies. Within each of the three studies, the effects are more pronounced, so that we also see a significant effect of core need fulfillment (all \textit{b} > `r min(abs(contact_study_coef[contact_study_coef$coef == "CoreNeedC", "b"])) %>% round(2) %>% format(nsmall=2)`, all \textit{p} < `r max(contact_study_coef[contact_study_coef$coef == "CoreNeedC", "p"]) %>% round(3) %>% format(nsmall=3)`) as well as outgroup contact itself (all |\textit{b}| > `r min(abs(contact_study_coef[contact_study_coef$coef == "OutgroupInteraction", "b"])) %>% round(2) %>% format(nsmall=2)`, all \textit{p} < `r max(contact_study_coef[contact_study_coef$coef == "OutgroupInteraction", "p"]) %>% round(3) %>% format(nsmall=3)`) but the interaction effect consistently remains the most reliable predictor of outgroup attitudes (all |\textit{b}| > `r min(abs(contact_study_coef[contact_study_coef$coef == "CoreNeedC:OutgroupInteraction", "b"])) %>% round(2) %>% format(nsmall=2)`, all \textit{p} < `r max(contact_study_coef[contact_study_coef$coef == "CoreNeedC:OutgroupInteraction", "p"]) %>% round(3) %>% format(nsmall=3)`, also see \tblref{tab:robustnessTblLong}). There is thus consistent evidence that need fulfillment relates to outgroup attitudes for outgroup contacts in particular but not need fulfillment in general.
\subsubsection{Interaction intent}
```{r}
#| label: accidental_overall
#| include: false
accidental_overall <- select_best_lmer_model(
data = dt_exp_all %>% filter(OutgroupInteractionLab == "Yes"),
prediction_form = "CoreNeed * InteractionAccidental",
structure = "study/PID",
dependent_var = "Attitude",
lmer_scale = TRUE
)
# accidental_overall$anova
# accidental_overall$choice
# accidental_overall$lmer_model %>% summ(., confint = TRUE, digits = 3)
# accidental_overall$lmer_model %>% summ(., confint = TRUE, digits = 3, scale = TRUE)
```
Secondly, to assess whether the need fulfillment mechanism affected by whether the interaction was accidental or planned we ran an exploratory moderation analysis using the participants' ratings of how much they perceived the interaction as 'accidental'. It should be noted that we asked our participants to focus on most the important interaction (i.e., "\textit{The following questions will be about the interaction \underline{you consider most significant}.}"; emphasis as in original). We again start our analysis approach by assessing the model across all three studies, using a three-level hierarchical model. In this overall model, we retain the main effect of core need fulfillment (random slopes model, grand-mean standardized to account for all levels of variance; `r get_latex_coef(accidental_overall$lmer_coef, "CoreNeed")`) but neither contact intent nor the moderation effect affect the results (all |\textit{b}| < `r max(abs(accidental_overall$lmer_coef[accidental_overall$lmer_coef$coef != c("(Intercept)", "CoreNeed"), "b"])) %>% round(2) %>% format(nsmall=2)` and all \textit{p} > `r min(accidental_overall$lmer_coef[accidental_overall$lmer_coef$coef != c("(Intercept)", "CoreNeed"), "p"]) %>% round(3) %>% format(nsmall=3)`; see \tblref{tab:robustnessTblLong} for full results).
```{r}
#| label: accidental_s1
#| include: false
accidental_s1 <- select_best_lmer_model(
data = dt_exp_all %>% filter(study == 1, OutgroupInteractionLab == "Yes"),
prediction_form = "CoreNeedC * InteractionAccidentalC",
structure = "PID",
dependent_var = "Attitude"
)
# accidental_s1$anova
# accidental_s1$choice
# accidental_s1$lmer_model %>% summ(., confint = TRUE, digits = 3)
# accidental_s1$lmer_model_z %>% summ(., confint = TRUE, digits = 3)
# interactions::sim_slopes(accidental_s1$lmer_model, pred = CoreNeedC, modx = InteractionAccidentalC, jnplot = TRUE)
# interactions::interact_plot(accidental_s1$lmer_model, pred = CoreNeedC, modx = InteractionAccidentalC, interval = TRUE)
```
```{r}
#| label: accidental_s2
#| include: false
accidental_s2 <- select_best_lmer_model(
data = dt_exp_all %>% filter(study == 2, OutgroupInteractionLab == "Yes"),
prediction_form = "CoreNeedC * InteractionAccidentalC",
structure = "PID",
dependent_var = "Attitude",
return = "slope"
)
# accidental_s2$anova
# accidental_s2$choice
# accidental_s2$lmer_model %>% summ(., confint = TRUE, digits = 3)
# accidental_s2$lmer_model_z %>% summ(., confint = TRUE, digits = 3)
#
# interactions::sim_slopes(accidental_s2$lmer_model, pred = CoreNeedC, modx = InteractionAccidentalC, jnplot = TRUE)
# interactions::interact_plot(accidental_s2$lmer_model, pred = CoreNeedC, modx = InteractionAccidentalC, interval = TRUE)
```
```{r}
#| label: accidental_s3
#| include: false
accidental_s3 <- select_best_lmer_model(
data = dt_exp_all %>% filter(study == 3, OutgroupInteractionLab == "Yes"),
prediction_form = "CoreNeedC * InteractionAccidentalC",
structure = "PID",
dependent_var = "Attitude"
)
# accidental_s3$anova
# accidental_s3$choice
# accidental_s3$lmer_model %>% summ(., confint = TRUE, digits = 3)
# accidental_s3$lmer_model_z %>% summ(., confint = TRUE, digits = 3)
#
# interactions::sim_slopes(accidental_s3$lmer_model, pred = CoreNeedC, modx = InteractionAccidentalC, jnplot = TRUE)
# interactions::interact_plot(accidental_s3$lmer_model, pred = CoreNeedC, modx = InteractionAccidentalC, interval = TRUE)
```
```{r}
#| label: accidental_study_coef
#| include: false
accidental_study_coef <-
rbind(
accidental_s1$lmer_coef %>% mutate(study = 1),
accidental_s2$lmer_coef %>% mutate(study = 2),
accidental_s3$lmer_coef %>% mutate(study = 3)
)
```
We again sought to ensure that the results were not affected by scaling issues by additionally assessing the interaction intentionality model within each of the three studies. Within each of the three studies, the effect of core need fulfillment became even clearer (all |\textit{b}| > `r min(abs(accidental_study_coef[accidental_study_coef$coef == "CoreNeedC", "b"])) %>% round(2) %>% format(nsmall=2)`, all \textit{p} < `r ifelse(max(accidental_study_coef[accidental_study_coef$coef == "CoreNeedC", "p"]) %>% round(3) %>% format(nsmall=3)<.001, ".001", max(accidental_study_coef[accidental_study_coef$coef == "CoreNeedC", "p"]) %>% round(3) %>% format(nsmall=3))`). But in none of the studies neither outgroup contact intention nor the moderation effect explained a significant amount of variance in outgroup attitudes (all |\textit{b}| < `r max(abs(accidental_study_coef[accidental_study_coef$coef != c("(Intercept)", "CoreNeedC"), "b"])) %>% round(2) %>% format(nsmall=2)` and all \textit{p} > `r min(accidental_study_coef[accidental_study_coef$coef != c("(Intercept)", "CoreNeedC"), "p"]) %>% round(3) %>% format(nsmall=3)`; also see \tblref{tab:robustnessTblLong}). There is thus consistent evidence that need fulfillment is related to outgroup attitudes, even when taking the intentionality of the interaction into account --- at least in our three samples and with a focus on the most significant interactions.
\subsubsection{Well-being outcome}
```{r}
#| label: wellbeing_core_overall
#| include: false
wellbeing_core_overall <- select_best_lmer_model(
data = dt_exp_all %>% filter(OutgroupInteractionLab == "Yes"),
prediction_form = "CoreNeed",
structure = "study/PID",
dependent_var = "WellBeing",
lmer_scale = TRUE
)
# wellbeing_core_overall$anova
# wellbeing_core_overall$choice
# wellbeing_core_overall$lmer_model %>% summ(., confint = TRUE, digits = 3)
# wellbeing_core_overall$lmer_model %>% summ(., confint = TRUE, digits = 3, scale = TRUE)
```
```{r}
#| label: wellbeing_full_overall
#| include: false
wellbeing_full_overall <- select_best_lmer_model(
data = dt_exp_all %>% filter(OutgroupInteractionLab == "Yes"),
prediction_form = "CoreNeed + Quality",
structure = "study/PID",
dependent_var = "WellBeing",
lmer_scale = TRUE
)
# wellbeing_full_overall$anova
# wellbeing_full_overall$choice
# wellbeing_full_overall$lmer_model %>% summ(., confint = TRUE, digits = 3)
# wellbeing_full_overall$lmer_model %>% summ(., confint = TRUE, digits = 3, scale = TRUE)
```
```{r}
#| label: wellbeing_core_s1
#| include: false
wellbeing_core_s1 <- select_best_lmer_model(
data = dt_exp_all %>% filter(study == 1, OutgroupInteractionLab == "Yes"),
prediction_form = "CoreNeedC",
structure = "PID",
dependent_var = "WellBeing"
)
# wellbeing_core_s1$anova
# wellbeing_core_s1$choice
# wellbeing_core_s1$lmer_model %>% summ(., confint = TRUE, digits = 3)
# wellbeing_core_s1$lmer_model_z %>% summ(., confint = TRUE, digits = 3)
```
```{r}
#| label: wellbeing_full_s1
#| include: false
wellbeing_full_s1 <- select_best_lmer_model(
data = dt_exp_all %>% filter(study == 1, OutgroupInteractionLab == "Yes"),
prediction_form = "CoreNeedC + QualityC",
structure = "PID",
dependent_var = "WellBeing"
)
# wellbeing_full_s1$anova
# wellbeing_full_s1$choice
# wellbeing_full_s1$lmer_model %>% summ(., confint = TRUE, digits = 3)
# wellbeing_full_s1$lmer_model_z %>% summ(., confint = TRUE, digits = 3)
```
```{r}
#| label: wellbeing_core_s2
#| include: false
wellbeing_core_s2 <- select_best_lmer_model(
data = dt_exp_all %>% filter(study == 2, OutgroupInteractionLab == "Yes"),
prediction_form = "CoreNeedC",
structure = "PID",
dependent_var = "WellBeing"
)
# wellbeing_core_s2$anova
# wellbeing_core_s2$choice
# wellbeing_core_s2$lmer_model %>% summ(., confint = TRUE, digits = 3)
# wellbeing_core_s2$lmer_model_z %>% summ(., confint = TRUE, digits = 3)
```
```{r}
#| label: wellbeing_full_s2
#| include: false
wellbeing_full_s2 <- select_best_lmer_model(
data = dt_exp_all %>% filter(study == 2, OutgroupInteractionLab == "Yes"),
prediction_form = "CoreNeedC + QualityC",
structure = "PID",
dependent_var = "WellBeing"
)
# wellbeing_full_s2$anova
# wellbeing_full_s2$choice
# wellbeing_full_s2$lmer_model %>% summ(., confint = TRUE, digits = 3)
# wellbeing_full_s2$lmer_model_z %>% summ(., confint = TRUE, digits = 3)
```
```{r}
#| label: wellbeing_core_s3
#| include: false
wellbeing_core_s3 <- select_best_lmer_model(
data = dt_exp_all %>% filter(study == 3, OutgroupInteractionLab == "Yes"),
prediction_form = "CoreNeedC",
structure = "PID",
dependent_var = "WellBeing"
)
# wellbeing_core_s3$anova
# wellbeing_core_s3$choice
# wellbeing_core_s3$lmer_model %>% summ(., confint = TRUE, digits = 3)
# wellbeing_core_s3$lmer_model_z %>% summ(., confint = TRUE, digits = 3)
```
```{r}
#| label: wellbeing_full_s3
#| include: false
wellbeing_full_s3 <- select_best_lmer_model(
data = dt_exp_all %>% filter(study == 3, OutgroupInteractionLab == "Yes"),
prediction_form = "CoreNeedC + QualityC",
structure = "PID",
dependent_var = "WellBeing"
)
# wellbeing_full_s3$anova
# wellbeing_full_s3$choice
# wellbeing_full_s3$lmer_model %>% summ(., confint = TRUE, digits = 3)
# wellbeing_full_s3$lmer_model_z %>% summ(., confint = TRUE, digits = 3)
```
```{r}
#| label: wellbeing_core_study_coef
#| include: false
wellbeing_core_study_coef <-
rbind(
wellbeing_core_s1$lmer_coef %>% mutate(study = 1),
wellbeing_core_s2$lmer_coef %>% mutate(study = 2),
wellbeing_core_s3$lmer_coef %>% mutate(study = 3)
)
```
Thirdly, to build a stronger case for the relevance of need fulfillment to minority group members, we exploratorily assessed the effect of need fulfilling outgroup interactions on self-reported well-being. We, thus, re-ran our main analysis but substituted the outgroup attitudes outcome with situational well-being. As with the previous robustness analyses, we begin with a global three-level hierarchical model (across the three studies). We find that need fulfillment during outgroup contacts, indeed, has a similar effect on experienced well-being (random slopes model, grand-mean standardized to account for all levels of variance; `r get_latex_coef(wellbeing_core_overall$lmer_coef, "CoreNeed")`). We found the same result when we assessed each of the three studies individually. In each of the studies situational need fulfillment during the outgroup interaction was related with higher well-being ratings by the participants (random slopes model, centered within participants; all |\textit{b}| > `r min(abs(wellbeing_core_study_coef[wellbeing_core_study_coef$coef == "CoreNeedC", "b"])) %>% round(2) %>% format(nsmall=2)`, all \textit{p} < `r ifelse(max(wellbeing_core_study_coef[wellbeing_core_study_coef$coef == "CoreNeedC", "p"]) %>% round(3) %>% format(nsmall=3)<.001, ".001", max(wellbeing_core_study_coef[wellbeing_core_study_coef$coef == "CoreNeedC", "p"]) %>% round(3) %>% format(nsmall=3))`). We, thus, find consistent and meaningful evidence that need fulfilling outgroup interactions also relate to higher everyday well-being.
\subsubsection{Need types}
```{r}
#| label: need_type_overall
#| include: false
need_type_overall <- select_best_lmer_model(
data = dt_goal_directedness,
prediction_form = "CoreNeed * practical_need_dum + CoreNeed * psychological_need_dum",
structure = "study/PID",
dependent_var = "Attitude",
lmer_scale = TRUE
)
# need_type_overall$anova
# need_type_overall$choice
# need_type_overall$lmer_model %>% summ(., confint = TRUE, digits = 3)
# need_type_overall$lmer_model %>% summ(., confint = TRUE, digits = 3, scale = TRUE)
```
Fourthly, to assess the role of different types of motives reported by our participants, we added our coding of practical and psychological goal-directedness as additional predictors to our base model. We thus had core need fulfillment predicting outgroup attitudes while also accounting for whether the reported motives were capturing practical and/or psychological motives. We again ran a global model, across the three studies first. We found that core need fulfillment remain a core predictor of outgroup attitudes (random slopes model, grand-mean standardized to account for all levels of variance; `r get_latex_coef(need_type_overall$lmer_coef, "CoreNeed")`), even after accounting for different types of motives. None of the motive types nor the moderation effects reached statistical significance within the overall analysis (all |\textit{b}| < `r max(abs(need_type_overall$lmer_coef[need_type_overall$lmer_coef$coef != c("(Intercept)", "CoreNeed"), "b"])) %>% round(2) %>% format(nsmall=2)` and all \textit{p} > `r min(need_type_overall$lmer_coef[need_type_overall$lmer_coef$coef != c("(Intercept)", "CoreNeed"), "p"]) %>% round(3) %>% format(nsmall=3)`; see \tblref{tab:robustnessTblLong} for full results).
```{r}
#| label: need_type_s1
#| include: false
need_type_s1 <- select_best_lmer_model(
data = dt_goal_directedness %>% filter(study == 1),
prediction_form = "CoreNeedC * practical_need_dum + CoreNeedC * psychological_need_dum",
structure = "PID",
dependent_var = "Attitude",
return = "slope"
)
# need_type_s1$anova
# need_type_s1$choice
# need_type_s1$lmer_model %>% summ(., confint = TRUE, digits = 3)
# need_type_s1$lmer_model_z %>% summ(., confint = TRUE, digits = 3)
```
```{r}
#| label: need_type_s2
#| include: false
need_type_s2 <- select_best_lmer_model(
data = dt_goal_directedness %>% filter(study == 2),
prediction_form = "CoreNeedC * practical_need_dum + CoreNeedC * psychological_need_dum",
structure = "PID",
dependent_var = "Attitude"
)
# need_type_s2$anova
# need_type_s2$choice
# need_type_s2$lmer_model %>% summ(., confint = TRUE, digits = 3)
# need_type_s2$lmer_model_z %>% summ(., confint = TRUE, digits = 3)
```
```{r}
#| label: need_type_s3
#| include: false
need_type_s3 <- select_best_lmer_model(
data = dt_goal_directedness %>% filter(study == 3),
prediction_form = "CoreNeedC * practical_need_dum + CoreNeedC * psychological_need_dum",
structure = "PID",
dependent_var = "Attitude"
)
# need_type_s3$anova
# need_type_s3$choice
# need_type_s3$lmer_model %>% summ(., confint = TRUE, digits = 3)
# need_type_s3$lmer_model_z %>% summ(., confint = TRUE, digits = 3)
```
```{r}
#| label: need_type_study_coef
#| include: false
need_type_study_coef <-
rbind(
need_type_s1$lmer_coef %>% mutate(study = 1),
need_type_s2$lmer_coef %>% mutate(study = 2),
need_type_s3$lmer_coef %>% mutate(study = 3)
)
```
When looking at the individual studies, we again saw that the effect of core need fulfillment remained the on only clear effect (all |\textit{b}| > `r min(abs(need_type_study_coef[need_type_study_coef$coef == "CoreNeedC", "b"])) %>% round(2) %>% format(nsmall=2)`, all \textit{p} < `r ifelse(max(need_type_study_coef[need_type_study_coef$coef == "CoreNeedC", "p"]) %>% round(3) %>% format(nsmall=3)<.001, ".001", max(need_type_study_coef[need_type_study_coef$coef == "CoreNeedC", "p"]) %>% round(3) %>% format(nsmall=3))`). Additionally, in none of the studies neither motive type dummies nor the moderation effect explained a significant amount of variance in outgroup attitudes (all |\textit{b}| < `r max(abs(need_type_study_coef[need_type_study_coef$coef != c("(Intercept)", "CoreNeedC"), "b"])) %>% round(2) %>% format(nsmall=2)` and all \textit{p} > `r min(need_type_study_coef[need_type_study_coef$coef != c("(Intercept)", "CoreNeedC"), "p"]) %>% round(3) %>% format(nsmall=3)`; also see \tblref{tab:robustnessTblLong}). We, thus, find consistent evidence that need fulfillment is related to outgroup attitudes, even when taking the type of need into account --- at least in our three samples.
\subsubsection{Specific psychological needs}
```{r}
#| label: need_sdt_overall
#| include: false
need_sdt_overall <- select_best_lmer_model(
data = dt_exp_all %>% filter(OutgroupInteractionLab == "Yes"),
prediction_form = "CoreNeed + Competence + Autonomy + Relatednesss",
structure = "study/PID",
dependent_var = "Attitude",
lmer_scale = TRUE
)
# need_sdt_overall$anova
# need_sdt_overall$choice
# need_sdt_overall$lmer_model %>% summ(., confint = TRUE, digits = 3)
# need_sdt_overall$lmer_model %>% summ(., confint = TRUE, digits = 3, scale = TRUE)
```
In a final step, we checked whether during the interaction the core situational need remains a meaningful predictor even when taking other fundamental psychological needs into account. We again take a two-step approach, starting with cross-study global three-level test and then assessing the effects within the individual studies. Within the overall model we find that across the studies core need fulfillment remained a strong predictor of outgroup attitudes, even after controlling for the three self-determination theory need (random slopes model, grand-mean standardized to account for all levels of variance; `r get_latex_coef(need_sdt_overall$lmer_coef, "CoreNeed")`). Within this overall analysis, none of the self-determination theory needs independently predicted outgroup attitudes to a statistically significant extent (all \textit{p} > `r min(need_sdt_overall$lmer_coef[need_sdt_overall$lmer_coef$coef != c("(Intercept)", "CoreNeed"), "p"]) %>% round(3) %>% format(nsmall=3)`). However, some of the effect sizes were largely comparable to that of the core need fulfillment (all |\textit{b}| < `r max(abs(need_sdt_overall$lmer_coef[need_sdt_overall$lmer_coef$coef != c("(Intercept)", "CoreNeed"), "b"])) %>% round(2) %>% format(nsmall=2)`, particularly that of relatedness fulfillment; see \tblref{tab:robustnessTblLong} for full results).
```{r}
#| label: need_sdt_s1
#| include: false
need_sdt_s1 <- select_best_lmer_model(
data = dt_exp_all %>% filter(study == 1, OutgroupInteractionLab == "Yes"),
prediction_form = "CoreNeedC + CompetenceC + AutonomyC + RelatednesssC",
structure = "PID",
dependent_var = "Attitude"
)
# need_sdt_s1$anova
# need_sdt_s1$choice
# need_sdt_s1$lmer_model %>% summ(., confint = TRUE, digits = 3)
# need_sdt_s1$lmer_model_z %>% summ(., confint = TRUE, digits = 3)
```
```{r}
#| label: need_sdt_s2
#| include: false
# need_sdt_s2 <- select_best_lmer_model(
# data = dt_exp_all %>% filter(study == 2, OutgroupInteractionLab == "Yes"),
# prediction_form = "CoreNeedC + CompetenceC + AutonomyC + RelatednesssC",
# structure = "PID",
# dependent_var = "Attitude",
# control = lmeControl(opt = "nlminb", msMaxIter = 500, tolerance = 1e-6)
# )
model0 <- lmer(
Attitude ~ 1 + (1 | PID),
data = dt_exp_all %>% filter(study == 2, OutgroupInteractionLab == "Yes")
)
model1 <- lmer(
Attitude ~ CoreNeedC + CompetenceC + AutonomyC + RelatednesssC + (1 | PID),
data = dt_exp_all %>% filter(study == 2, OutgroupInteractionLab == "Yes")
)
model2 <- lmer(
Attitude ~ CoreNeedC + CompetenceC + AutonomyC + RelatednesssC + (1 + CoreNeedC + CompetenceC + AutonomyC + RelatednesssC | PID),
data = dt_exp_all %>% filter(study == 2, OutgroupInteractionLab == "Yes")
)
test <- anova(model0, model1, model2)
test$`Pr(>Chisq)`[3] < 0.05
rm(model0, model1, model2, test)
need_sdt_s2 <- list()
need_sdt_s2$lmer_model <- lmer(
Attitude ~ CoreNeedC + CompetenceC + AutonomyC + RelatednesssC + (1 | PID),
data = dt_exp_all %>% filter(study == 2, OutgroupInteractionLab == "Yes")
)
need_sdt_s2$lmer_model_z <- lmer(
AttitudeZ ~ CoreNeedZ + CompetenceZ + AutonomyZ + RelatednesssZ + (1 | PID),
data = dt_exp_all %>% filter(study == 2, OutgroupInteractionLab == "Yes")
)
need_sdt_s2$lmer_model %>% summ(., confint = TRUE, digits = 3)
need_sdt_s2$lmer_model_z %>% summ(., confint = TRUE, digits = 3)
need_sdt_s2$lmer_coef <-
summ(need_sdt_s2$lmer_model, confint = TRUE, scale = FALSE)$coeftable %>%
as_tibble %>%
transmute(
coef = rownames(summ(need_sdt_s2$lmer_model)$coeftable),
b = Est.,
df = d.f.,
t = `t val.`,
p = p,
lwr = `2.5%`,
upr = `97.5%`,
coef_latex = paste0(
"\\textit{b} = ", format(round(b, 2), nsmall = 2),
", \\textit{t}(", format(df, big.mark=","), ") = ", format(round(t, 2), nsmall = 2),
", \\textit{p} ", ifelse(p < .001, "< .001", paste0("= ", format(round(p, 3), nsmall = 3))),
", \\textit{95\\%CI}[", format(round(lwr, 2), nsmall = 2), ", ", format(round(upr, 2), nsmall = 2), "]"
),
coef_html = paste0(
"<i>b</i> = ", format(round(b, 2), nsmall = 2),
", <i>t</i>(", format(df, big.mark=","), ") = ", format(round(t, 2), nsmall = 2),
", <i>p</i> ", ifelse(p < .001, "< .001", paste0("= ", format(round(p, 3), nsmall = 3))),
", <i>95%CI</i>[", format(round(lwr, 2), nsmall = 2), ", ", format(round(upr, 2), nsmall = 2), "]"
)
)
```
```{r}
#| label: need_sdt_s3
#| include: false
need_sdt_s3 <- select_best_lmer_model(
data = dt_exp_all %>% filter(study == 3, OutgroupInteractionLab == "Yes"),
prediction_form = "CoreNeedC + CompetenceC + AutonomyC + RelatednesssC",
structure = "PID",
dependent_var = "Attitude"
)
# need_sdt_s3$anova
# need_sdt_s3$choice
# need_sdt_s3$lmer_model %>% summ(., confint = TRUE, digits = 3)
# need_sdt_s3$lmer_model_z %>% summ(., confint = TRUE, digits = 3)
```
```{r}
#| label: need_sdt_study_coef
#| include: false
need_sdt_study_coef <-
rbind(
need_sdt_s1$lmer_coef %>% mutate(study = 1),
need_sdt_s2$lmer_coef %>% mutate(study = 2),
need_sdt_s3$lmer_coef %>% mutate(study = 3)
)
need_sdt_study_coef_other <- need_sdt_study_coef %>%
filter(
coef != "(Intercept)",
coef != "CoreNeedC"
)
```
When looking at the individual studies, we again saw that core need fulfillment remained a consistent predictor of outgroup attitudes, even after accounting for the self-determination theory need (all |\textit{b}| > `r min(abs(need_sdt_study_coef[need_sdt_study_coef$coef == "CoreNeedC", "b"])) %>% round(2) %>% format(nsmall=2)`, all \textit{p} < `r ifelse(max(need_sdt_study_coef[need_sdt_study_coef$coef == "CoreNeedC", "p"]) %>% round(3) %>% format(nsmall=3)<.001, ".001", max(need_sdt_study_coef[need_sdt_study_coef$coef == "CoreNeedC", "p"]) %>% round(3) %>% format(nsmall=3))`). However, across all three studies the fulfillment of relatedness motives also emerged as a consistent predictor of outgroup attitudes (all |\textit{b}| > `r min(abs(need_sdt_study_coef[need_sdt_study_coef$coef == "RelatednesssC", "b"])) %>% round(2) %>% format(nsmall=2)`, all \textit{p} < `r ifelse(max(need_sdt_study_coef[need_sdt_study_coef$coef == "RelatednesssC", "p"]) %>% round(3) %>% format(nsmall=3)<.001, ".001", max(need_sdt_study_coef[need_sdt_study_coef$coef == "RelatednesssC", "p"]) %>% round(3) %>% format(nsmall=3))`). Additionally, in the larger studies 2 and 3 competence fulfillment was also related to more positive outgroup attitudes (study 2: `r get_latex_coef(need_sdt_study_coef %>% filter(study == 2), "CompetenceC")`, study 3: `r get_latex_coef(need_sdt_study_coef %>% filter(study == 3), "CompetenceC")`). None of the autonomy fulfillment effects reached statistical significance nor did the competence fulfillment during study 1 (see \tblref{tab:robustnessTblLong} for the full results). In short, find that across our samples, relatedness fulfillment (and to a smaller extend competence fulfillment) are instrumental in understanding when an outgroup contact leads to more positive outgroup attitudes. Importantly, even when considering these effects situational core need fulfillment remains a strong and consistent predictor of outgroup attitudes. In some cases, we even find that core need fulfillment takes on some of the variance that would otherwise be explained by the self-determination theory needs (see Online Supplemental Material A).
<!-- TABLES -->
```{r}
#| label: descrFullWideAppB
#| include: false
vars_full <- c(
"Core Need" = "CoreNeed",
"Competence" = "Competence",
"Autonomy" = "Autonomy",
"Relatednesss" = "Relatednesss",
#"Outgroup Interaction" = "OutgroupInteraction",
"Accidental" = "InteractionAccidental",
"Quality" = "Quality",
"Attitudes NL" = "Attitude"
)
dt_exp_all <- dt_exp_all %>%
mutate(
OutgroupInteraction = (OutgroupInteraction-1.5)
)
s1_MlCor_full <-
MlCorMat(
data = dt_exp_all %>% filter(study == 1),
id = "PID",
selection = setdiff(as.character(vars_full), c("InteractionAccidental", "Quality")),
labels = setdiff(names(vars_full), c("Accidental", "Quality"))
)
s2_MlCor_full <-
MlCorMat(
data = dt_exp_all %>% filter(study == 2),
id = "PID",
selection = as.character(vars_full),
labels = names(vars_full)
)
s3_MlCor_full <-
MlCorMat(
data = dt_exp_all %>% filter(study == 3),
id = "PID",
selection = as.character(vars_full),
labels = names(vars_full)
)
all_MlCor_full <-
MlCorMat(
data = dt_exp_all,
id = "PID",
selection = as.character(vars_full),
labels = names(vars_full)
)
rbind(
s1_MlCor_full %>%
t %>%
as.data.frame %>%
rownames_to_column(., "Variable") %>%
add_column(Accidental = "",
.before = "Attitudes NL") %>%
add_column(Quality = "",
.before = "Attitudes NL"),
s2_MlCor_full %>%
t %>%
as.data.frame %>%
rownames_to_column(., "Variable"),
s3_MlCor_full %>%
t %>%
as.data.frame %>%
rownames_to_column(., "Variable"),
all_MlCor_full %>%
t %>%
as.data.frame %>%
rownames_to_column(., "Variable")
) %>%
kbl(.,
format = "latex",
caption = "Full Sample: Correlation Table and Descriptive Statistics",
booktabs = TRUE,
align = c("l", rep("c", ncol(.) - 1))) %>%
kable_classic() %>%
add_header_above(
.,
c(
"",
"Correlations" = ncol(s3_MlCor_full),
"Descriptives" = nrow(s3_MlCor_full) - ncol(s3_MlCor_full)
)
) %>%
pack_rows("Study 1", 1, ncol(s1_MlCor_full)) %>%
pack_rows("Study 2", ncol(s1_MlCor_full) + 1,
sum(ncol(s1_MlCor_full), ncol(s2_MlCor_full))) %>%
pack_rows("Study 3", sum(ncol(s1_MlCor_full), ncol(s2_MlCor_full)) + 1,
sum(ncol(s1_MlCor_full), ncol(s2_MlCor_full), ncol(s3_MlCor_full))) %>%
pack_rows("Across Studies", sum(ncol(s1_MlCor_full), ncol(s2_MlCor_full), ncol(s3_MlCor_full)) + 1,
sum(ncol(s1_MlCor_full), ncol(s2_MlCor_full), ncol(s3_MlCor_full), ncol(all_MlCor_full))) %>% # fix table position
footnote(
general = c(
"Upper triangle: Within-person correlations;",
"Lower triangle: Between-person correlations;",
"*** p < .001, ** p < .01, * p < .05",
"Interaction Intent and Interaction Quality were only measured for outgroup interactions in Study 1."
)
) %>%
kable_styling(latex_options = "scale_down") %>%
gsub("\\begin{table}", "\\begin{table}\n\\begin{minipage}[t][\\textheight][t]{\\textwidth}", ., fixed = TRUE) %>% # fix table position
gsub("\\end{table}", "\\end{minipage}\n\\end{table}", ., fixed = TRUE) %>% # fix table position
save_kable("Tables/descrFullWideAppB.tex")
```
```{r}
#| label: descrOutWideAppB
#| include: false
vars_out <- c(
"Core Need" = "CoreNeed",
"Competence" = "Competence",
"Autonomy" = "Autonomy",
"Relatednesss" = "Relatednesss",
# "Practical Need" = "practical_need_dum",
# "Psychological Need" = "psychological_need_dum",
"Accidental" = "InteractionAccidental",
"Quality" = "Quality",
"Attitudes NL" = "Attitude"
)
s1_MlCor_out <-
MlCorMat(
data = dt_exp_all %>% filter(study == 1, OutgroupInteractionLab == "Yes", PID != 21), # PP 21 has inflated zero for Accidental
id = "PID",
selection = as.character(vars_out),
labels = names(vars_out)
)
s2_MlCor_out <-
MlCorMat(
data = dt_exp_all %>% filter(study == 2, OutgroupInteractionLab == "Yes"),
id = "PID",
selection = as.character(vars_out),
labels = names(vars_out)
)
s3_MlCor_out <-
MlCorMat(
data = dt_exp_all %>% filter(study == 3, OutgroupInteractionLab == "Yes"),
id = "PID",
selection = as.character(vars_out),
labels = names(vars_out)
)
all_MlCor_out <-
MlCorMat(
data = dt_exp_all %>% filter(OutgroupInteractionLab == "Yes"),
id = "PID",
selection = as.character(vars_out),
labels = names(vars_out)
)
rbind(
s1_MlCor_out %>%
t %>%
as.data.frame %>%
rownames_to_column(., "Variable"),
s2_MlCor_out %>%
t %>%
as.data.frame %>%
rownames_to_column(., "Variable"),
s3_MlCor_out %>%
t %>%
as.data.frame %>%
rownames_to_column(., "Variable"),
all_MlCor_out %>%
t %>%
as.data.frame %>%
rownames_to_column(., "Variable")
) %>%
kbl(.,
format = "latex",
caption = "Outgroup Interaction Sample: Correlation Table and Descriptive Statistics",
booktabs = TRUE,
align = c("l", rep("c", ncol(.) - 1))) %>%
kable_classic() %>%
add_header_above(
.,
c(
"",
"Correlations" = ncol(s3_MlCor_out),
"Descriptives" = nrow(s3_MlCor_out) - ncol(s3_MlCor_out)
)
) %>%
pack_rows("Study 1", 1, ncol(s1_MlCor_out)) %>%
pack_rows("Study 2", ncol(s1_MlCor_out) + 1,
sum(ncol(s1_MlCor_out), ncol(s2_MlCor_out))) %>%
pack_rows("Study 3", sum(ncol(s1_MlCor_out), ncol(s2_MlCor_out)) + 1,
sum(ncol(s1_MlCor_out), ncol(s2_MlCor_out), ncol(s3_MlCor_out))) %>%
pack_rows("Across Studies", sum(ncol(s1_MlCor_out), ncol(s2_MlCor_out), ncol(s3_MlCor_out)) + 1,
sum(ncol(s1_MlCor_out), ncol(s2_MlCor_out), ncol(s3_MlCor_out), ncol(all_MlCor_out))) %>% # fix table position
footnote(
general = c(
"Upper triangle: Within-person correlations;",
"Lower triangle: Between-person correlations;",
"*** p < .001, ** p < .01, * p < .05"
)
) %>%
kable_styling(latex_options = "scale_down") %>%
gsub("\\begin{table}", "\\begin{table}\n\\begin{minipage}[t][\\textheight][t]{\\textwidth}", ., fixed = TRUE) %>% # fix table position
gsub("\\end{table}", "\\end{minipage}\n\\end{table}", ., fixed = TRUE) %>% # fix table position
save_kable("Tables/descrOutWideAppB.tex")
```