/
index.Rmd
executable file
·100 lines (84 loc) · 4.05 KB
/
index.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
---
title: "Progress Overview"
#date: `r format(Sys.time())`
output: html_document
---
```{r setup, message=FALSE, warning=FALSE, include=FALSE}
knitr::opts_chunk$set(cache = TRUE)
library(tidyverse)
library(osfr)
##osf_auth(token = "D:/osf-token.txt")
#library(flexdashboard)
# List the sequential output of each lab
lab_seq <- dir(path = "..",pattern = "Seq_output.csv",recursive = TRUE,full.names = TRUE)
# Get the latest lab tracking information
lab_info_path <- dir(path="..",recursive = TRUE, pattern = "Lab_info.csv", full.names = TRUE)
# Get the available log data
lab_fin_path <- dir(path="..",recursive = TRUE, pattern = "lab_fin.csv", full.names = TRUE)
# Get the available rawdata of verification task
rawdata_V_path <- dir(path="..",recursive = TRUE, pattern = "all_rawdata_SP_V.csv", full.names = TRUE)
# Function of plotting sequential analysis
seq_plot <- function(data){
## Draw results of sequential analysis
with(data, plot(N,log(BF,10), type = "b", xlab = "Sample Size",
ylab = "(log)Bayes Factor(10)", ylim = c(-2.5, 2.5), pch = 19,
col = "gray48", lwd = 2))
abline(h = 0, lwd = 1)
abline(h = log(10,10), col = "black", lty = 2, lwd = 2)
abline(h = log(1/10,10), col = "black", lty = 2, lwd = 2)
text(0, log(10,10) + 0.4, labels = "Evidence for Alternative",
cex = 1.5, col = "black", pos = 4)
text(0, log(1/10,10) - 0.4, labels = "Evidence for Null",
cex = 1.5, col = "black", pos = 4)
abline(v = 50, col = "red", lwd = 1)
}
```
### Latest Update
`r format(Sys.time(),usetz = TRUE)`
### For Participant Laboratories
- Check the [steps manual](https://docs.google.com/document/d/1XFj9qQT500lAEe3fjGNab6TTU_lgUWTiWWSh8oF3jGE/edit?usp=sharing); download the latest OpenSesame Scripts at [Project OSF](https://osf.io/e428p/).
- Navigate the tracking logs and enter the language page you are testing. There is the link to 003 survey page on the top. The sequential analysis plot for a lab will be available when a lab has collected 50 participants.
### Information Board
Column names explain:
- **PSA_ID**: Lab ID in Psychological Science Accelerator
- **N**: Maximal sample size this lab will recruit
- **Seq_N**: Sample Size to initialize the sequential analysis after 50.
- **osfid**: OSF repository for collected data
- **Language**: Primary language this lab is testing
- **Publicity**: Is this repository public?
- **collected_N**: Number of collected participants
- **begin_date**: First date and time this lab collected the data
- **latest_date**: Latest date and time this lab collected the data
- **Finish**: '*' represents the labratories that finished the data collection prior to the latest updated date.
<!---
- **log**: Is Lab log available?
--->
```{r lab_osf, echo=FALSE, message=FALSE, warning=FALSE, paged.print=TRUE}
require(lubridate)
info <- read.csv(lab_info_path) %>% subset(N!=0) %>%
left_join(
read.csv(rawdata_V_path) %>%
group_by(PSA_ID) %>%
##group_by(SEED) %>%
summarise(collected_N = length(unique(subject_nr)),
begin_date = min(parse_date_time(datetime,orders = c('mdy HMS','b d HMS Y','ymd')) %>%
##min(parse_date_time(DATE,orders = c('dmy','mdy','ymd','dmy, h.m','ymd, h:m')) %>%
format(format="%Y-%m-%d")),
lastest_date = max(parse_date_time(datetime,orders = c('mdy HMS','b d HMS Y','a b d HMS Y','ymd')) %>%
##max(parse_date_time(DATE,orders = c('dmy','mdy','ymd','dmy, h.m','ymd, h:m')) %>%
format(format="%Y-%m-%d"))),
by="PSA_ID"
)
lab_fin <- read.csv(lab_fin_path)
info <- data.frame(info, Finish = ifelse(info$PSA_ID %in% lab_fin$PSA_ID, "*",""))
##info$log <- rep("No",length(info$osfid))
##for(i in 1:length(info$osfid)){
## if(info$Publicity[i] == "Yes"){
## cr_project <- osf_retrieve_node(as.character(info$osfid[i]))
## info$log[i] <- ifelse((cr_project %>% osf_ls_files() %>%
## select("name") %>%
## dim())[1]>0,"Yes","No")
## }
##}
knitr::kable(info[-1], caption = "Labs planned N and progress.")
```