-
Notifications
You must be signed in to change notification settings - Fork 0
/
analyzeCHNSP_NumVoc.R
191 lines (147 loc) · 5.45 KB
/
analyzeCHNSP_NumVoc.R
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
library(lme4)
library(lmerTest)
setwd('~/Documents/opensmile/HumanData_analysis/completeDataset/AllAges_CHNSP_FAN_MAN')
ourdata = read.csv('baby_list.csv')
plot(ourdata$AGE, ourdata$CHNSPentropy,
xlab = "Infant age (days)",
ylab = "Entropy of infant vocalization types")
######
# Read dataset
######
CHNSPentropy_UMAP = ourdata$CHNSPentropyUMAP
CHNSPentropy_tSNE = ourdata$CHNSPentropytSNE
CHNSPcentroid_self_UMAP = ourdata$CENTROIDdist_CHSNPself_UMAP
CHNSP_FAN_centroid_UMAP = ourdata$CENTROID_CHSNP_FAN_UMAP
CHNSPcentroid_self_PCA = ourdata$CENTROIDdist_CHSNPself_PCA
CHNSP_FAN_centroid_PCA = ourdata$CENTROID_CHSNP_FAN_PCA
CHNSPcentroid_self_tSNE = ourdata$CENTROIDdist_CHSNPself_tSNE
CHNSP_FAN_centroid_tSNE = ourdata$CENTROID_CHSNP_FAN_tSNE
CHNSP_selfPRE_covariance = ourdata$cov_BBself_pre
CHNSP_self_covariance = ourdata$cov_BBself
AGE =ourdata$AGE
AgeGroup = ourdata$AGEGROUP
ChildID = ourdata$CHILDID
CHILDvocNumber = ourdata$NUMCHNSPVOC
#############################################
# ENTROPY
#############################################
# UMAP
plot(ourdata$AGE, ourdata$CHNSPentropyUMAP,
xlab = "Infant age (days)",
ylab = "CHNSP entropy UMAP")
lmPoly = lmer(CHNSPentropy_UMAP ~ poly(AGE,2) + (1|ChildID) + CHILDvocNumber, data = ourdata)
summary(lmPoly)
confint(lmPoly)
predCHNSP_entropy = predict(lmPoly)
ix = sort(ourdata$AGE,index.return=T)$ix
pred = predCHNSP_entropy[ix]
lines(ourdata$AGE[ix],predCHNSP_entropy[ix])
# tSNE
plot(ourdata$AGE, ourdata$CHNSPentropytSNE,
xlab = "Infant age (days)",
ylab = "CHNSP entropy UMAP")
lmPoly = lmer(CHNSPentropytSNE ~ poly(AGE,2) + (1|ChildID) + CHILDvocNumber, data = ourdata)
summary(lmPoly)
confint(lmPoly)
predCHNSP_entropy = predict(lmPoly)
ix = sort(ourdata$AGE,index.return=T)$ix
pred = predCHNSP_entropy[ix]
lines(ourdata$AGE[ix],predCHNSP_entropy[ix])
##############################################
# MEAN DISTANCE FROM THE CHNSP CENTROID (self)
##############################################
# UMAP
plot(ourdata$AGE, ourdata$CENTROIDdist_CHSNPself_UMAP,
xlab = "Infant age (days)",
ylab = "Distance from the centroid CHSNP")
lmPoly = lmer(CHNSPcentroid_self_UMAP ~ poly(AGE,2) + (1|ChildID) + CHILDvocNumber, data = ourdata)
summary(lmPoly)
confint(lmPoly)
predCentroidself = predict(lmPoly)
ix = sort(ourdata$AGE,index.return=T)$ix
pred = predCentroidself[ix]
lines(ourdata$AGE[ix],predCentroidself[ix])
# PCA
plot(ourdata$AGE, ourdata$CENTROIDdist_CHSNPself_PCA,
xlab = "Infant age (days)",
ylab = "Distance from the centroid CHSNP")
lmPoly = lmer(CHNSPcentroid_self_PCA ~ poly(AGE,2) + (1|ChildID) + CHILDvocNumber, data = ourdata)
summary(lmPoly)
confint(lmPoly)
predCentroidself = predict(lmPoly)
ix = sort(ourdata$AGE,index.return=T)$ix
pred = predCentroidself[ix]
lines(ourdata$AGE[ix],predCentroidself[ix])
# tSNE
plot(ourdata$AGE, ourdata$CENTROIDdist_CHSNPself_tSNE,
xlab = "Infant age (days)",
ylab = "Distance from the centroid CHSNP")
lmPoly = lmer(CHNSPcentroid_self_tSNE ~ poly(AGE,2) + (1|ChildID) + CHILDvocNumber, data = ourdata)
summary(lmPoly)
confint(lmPoly)
predCentroidself = predict(lmPoly)
ix = sort(ourdata$AGE,index.return=T)$ix
pred = predCentroidself[ix]
lines(ourdata$AGE[ix],predCentroidself[ix])
######################################
# DISTANCE CENTROIDS CHNSP versus FAN
######################################
# UMAP
plot(ourdata$AGE, ourdata$CENTROID_CHSNP_FAN_UMAP,
xlab = "Infant age (days)",
ylab = "Distance between centroids (CHNSP-FAN)")
lmPoly = lmer(CHNSP_FAN_centroid_UMAP ~ poly(AGE,2) + (1|ChildID) + CHILDvocNumber, data = ourdata)
summary(lmPoly)
confint(lmPoly)
predCHNSP_FAN = predict(lmPoly)
ix = sort(ourdata$AGE,index.return=T)$ix
pred = predCHNSP_FAN[ix]
lines(ourdata$AGE[ix],predCHNSP_FAN[ix])
# PCA
plot(ourdata$AGE, ourdata$CENTROID_CHSNP_FAN_PCA,
xlab = "Infant age (days)",
ylab = "Distance between centroids (CHNSP-FAN)")
lmPoly = lmer(CHNSP_FAN_centroid_PCA ~ poly(AGE,2) + (1|ChildID) + CHILDvocNumber, data = ourdata)
summary(lmPoly)
confint(lmPoly)
predCHNSP_FAN = predict(lmPoly)
ix = sort(ourdata$AGE,index.return=T)$ix
pred = predCHNSP_FAN[ix]
lines(ourdata$AGE[ix],predCHNSP_FAN[ix])
# tSNE
plot(ourdata$AGE, ourdata$CENTROID_CHSNP_FAN_tSNE,
xlab = "Infant age (days)",
ylab = "Distance between centroids (CHNSP-FAN)")
lmPoly = lmer(CHNSP_FAN_centroid_tSNE ~ poly(AGE,2) + (1|ChildID) + CHILDvocNumber, data = ourdata)
summary(lmPoly)
confint(lmPoly)
predCHNSP_FAN = predict(lmPoly)
ix = sort(ourdata$AGE,index.return=T)$ix
pred = predCHNSP_FAN[ix]
lines(ourdata$AGE[ix],predCHNSP_FAN[ix])
######################################
# COVARIANCE CENTROIDS CHNSP SELF
######################################
# UMAP
# consecutive vocalizations
plot(ourdata$AGE, ourdata$cov_BBself_pre,
xlab = "Infant age (days)",
ylab = "Cov CHNSP self pre")
lmPoly = lmer(CHNSP_selfPRE_covariance ~ poly(AGE,2) + (1|ChildID) + CHILDvocNumber, data = ourdata)
summary(lmPoly)
confint(lmPoly)
predCHNSP_cov = predict(lmPoly)
ix = sort(ourdata$AGE,index.return=T)$ix
pred = predCHNSP_cov[ix]
lines(ourdata$AGE[ix],predCHNSP_cov[ix])
# Self vocalizations
plot(ourdata$AGE, ourdata$cov_BBself,
xlab = "Infant age (days)",
ylab = "Cov CHSNP self")
lmPoly = lmer(CHNSP_self_covariance ~ poly(AGE,2) + (1|ChildID) + CHILDvocNumber, data = ourdata)
summary(lmPoly)
confint(lmPoly)
predCHNSP_cov = predict(lmPoly)
ix = sort(ourdata$AGE,index.return=T)$ix
pred = predCHNSP_cov[ix]
lines(ourdata$AGE[ix],predCHNSP_cov[ix])