-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathimputing_SDs.R
More file actions
39 lines (30 loc) · 1.1 KB
/
imputing_SDs.R
File metadata and controls
39 lines (30 loc) · 1.1 KB
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
# This is the first stage : inputing SDs that are missing to have complete data
# Collecting data stage (mostly using the metagear package)
library(metagear)
# importing csv file
path <- file.path("MA_infants.csv")
MA <- read.csv(path)
# Subsetting into studies
FBl <- subset(MA, seed_ID == "FBl")
NDi <- subset(MA, seed_ID == "NDis")
wWS <- subset(MA, seed_ID == "wordWSeg")
sWS <- subset(MA, seed_ID == "speechWSeg")
HTS <- subset(MA, seed_ID == "HTScram")
sIS <- subset(MA, seed_ID == "samInfS")
pIS <- subset(MA, seed_ID == "popInfS")
VST <- subset(MA, seed_ID == "VisStats")
LTS <- subset(MA, seed_ID == "LTScram")
IACT <- subset(MA, seed_ID == "IntAct")
GRS <- subset(MA, seed_ID == "GrSoc")
# NDi impute
NDi <- impute_SD(NDi, "SD_1", "x_1")
NDi <- impute_SD(NDi, "SD_2", "x_2")
# HTS impute
HTS <- impute_SD(HTS, "SD_1", "x_1")
HTS <- impute_SD(HTS, "SD_2", "x_2")
# IACT impute
IACT <- impute_SD(IACT, "SD_1", "x_1")
IACT <- impute_SD(IACT, "SD_2", "x_2")
# Binding back together
MA_imp <- rbind(FBl, NDi, wWS, sWS, HTS, sIS, pIS, VST, LTS, IACT, GRS)
write.csv(MA_imp, file = "MA_SD.csv", row.names = FALSE)