-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMain_Paxton_Dale-all_analyses.Rmd
150 lines (111 loc) · 5.42 KB
/
Main_Paxton_Dale-all_analyses.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
---
title: "Main, Paxton, & Dale Data Analysis"
output: html_document
---
Interest/Validation
-----
```{r interestvalidation-generate-RQA}
setwd('/Main_Paxton_Dale-Analyses')
# preliminaries
rm(list=ls())
getwd()
source('globals_functions.R')
# specify parents' and adolescents' affect
a_target_emotion = c(int,val)
p_target_emotion = c(int,val)
# run RQA
source('get_rqa_measures.R')
```
Let's look at the location of maximum lags. If one or the other is leading, we will find maximum lag location to be more on the left (parent leading) or right (adolescent leading). In general we do not find this imbalance: A one-sample t-test with maximum observed lag as the dependent variable is not significant less or greater than 0. In fact, it is centered around 0 (see plots); interestingly, in the interest/validation case, the maximum lags do show a bimodality, suggesting the turn taking pattern holds even in the maximum lag value.
```{r interestvalidation-analyses-and-plotting}
# only include those for which a maximum RR is observed
descriptives = descriptives[descriptives$maxrec>0,]
# print it out
pander(t.test(descriptives[descriptives$shuff=='observed',]$maxlag),style="rmarkdown")
# plot interaction with satisfaction -- use PDF if we want to save as a file in a subdirectory
# pdf(file='plots/interestvalidation_satisfaction.pdf',width=8,height=5.25)
source('plot_drps_satisfaction.R')
# dev.off()
# plot interaction with age -- use PDF if we want to save as a file in a subdirectory
# pdf(file='plots/interestvalidation_age.pdf',width=8,height=5.25)
source('plot_drps_age.R')
# dev.off()
# print model results using standardized and unstandardized coefficients
source('lmer_stats.R')
pander(coefs.simple,style="rmarkdown") # simple (just lag terms): standardized
pander(coefs.simple.raw,style="rmarkdown") # simple (just lag terms): unstandardized
pander(coefs.satisfaction,style="rmarkdown") # lag terms and satisfaction: standardized
pander(coefs.satisfaction.raw,style="rmarkdown") # lag terms and satisfaction: unstandardized
pander(coefs.age,style="rmarkdown") # lag terms and age: standardized
pander(coefs.age.raw,style="rmarkdown") # lag terms and age: unstandardized
```
Negative Emotion
------
```{r negative-emotion}
# preliminaries
rm(list=ls())
source('globals_functions.R')
# set the target emotion for these analyses and then run RQA
a_target_emotion = neg
p_target_emotion = neg
source('get_rqa_measures.R')
# only include those for which a maximum RR is observed
descriptives = descriptives[descriptives$maxrec>0,]
# print it out
pander(t.test(descriptives[descriptives$shuff=='observed',]$maxlag),style="rmarkdown")
# plot interaction with satisfaction -- use PDF if we want to save as a file in a subdirectory
# pdf(file='plots/negative_satisfaction.pdf',width=8,height=5.25)
source('plot_drps_satisfaction.R')
# dev.off()
# plot interaction with age -- use PDF if we want to save as a file in a subdirectory
# pdf(file='plots/negative_age.pdf',width=8,height=5.25)
source('plot_drps_age.R')
# dev.off()
# print model results using standardized and unstandardized ("raw") coefficients
source('lmer_stats.R')
pander(coefs.simple,style="rmarkdown") # simple (just lag terms): standardized
pander(coefs.simple.raw,style="rmarkdown") # simple (just lag terms): unstandardized
pander(coefs.satisfaction,style="rmarkdown") # lag terms and satisfaction: standardized
pander(coefs.satisfaction.raw,style="rmarkdown") # lag terms and satisfaction: unstandardized
pander(coefs.age,style="rmarkdown") # lag terms and age: standardized
pander(coefs.age.raw,style="rmarkdown") # lag terms and age: unstandardized
```
Positive Emotion
------
```{r positive-emotion}
# preliminaries
rm(list=ls())
source('globals_functions.R')
# set the target emotion for these analyses and then run RQA
a_target_emotion = pos
p_target_emotion = pos
source('get_rqa_measures.R')
# only include those for which a maximum RR is observed
descriptives = descriptives[descriptives$maxrec>0,]
# print it out
pander(t.test(descriptives[descriptives$shuff=='observed',]$maxlag),style="rmarkdown")
# plot interaction with satisfaction -- use PDF if we want to save as a file in a subdirectory
# pdf(file='plots/positive_satisfaction.pdf',width=8,height=5.25)
source('plot_drps_satisfaction.R')
# dev.off()
# plot interaction with age -- use PDF if we want to save as a file in a subdirectory
# pdf(file='plots/positive_age.pdf',width=8,height=5.25)
source('plot_drps_age.R')
# dev.off()
# print model results using standardized and unstandardized ("raw") coefficients
source('lmer_stats.R')
pander(coefs.simple,style="rmarkdown") # simple (just lag terms): standardized
pander(coefs.simple.raw,style="rmarkdown") # simple (just lag terms): unstandardized
pander(coefs.satisfaction,style="rmarkdown") # lag terms and satisfaction: standardized
pander(coefs.satisfaction.raw,style="rmarkdown") # lag terms and satisfaction: unstandardized
pander(coefs.age,style="rmarkdown") # lag terms and age: standardized
pander(coefs.age.raw,style="rmarkdown") # lag terms and age: unstandardized
```
Correlation between Dyad Satisfaction and Adolescent Age
------
Given systematic similarities between the age and satisfaction models, we checked for but did not find a reliable correlation between adolescent age and dyad satisfaction score.
``` {r age-satisfaction-correlation}
# grab only one slice from each dyad
corr_check = drps_raw[drps_raw$RawLag==0,]
pander(cor.test(corr_check$Satisfaction,corr_check$Age),style="rmarkdown")
```