Main effect of stimulation
Follow-up One-sample t-test:
medianLatencyCenterStats %>%
group_by(stimulation,subject) %>% # for each session and subject
summarise(latency = mean(latency.baseline)) %>% # average over all other variables (df is now still grouped per stimulation)
summarise_if(is.numeric, funs(list(tidy(t.test(.))))) %>% # run one-sample t-test for each stimulation condition, return tidy data frames
unnest() %>% # unpack the list-column with data frame for each test
kable(.)
stimulation | estimate | statistic | p.value | parameter | conf.low | conf.high | method | alternative |
---|---|---|---|---|---|---|---|---|
anodal | -1.608974 | -0.9875463 | 0.3328370 | 25 | -4.964508 | 1.746559 | One Sample t-test | two.sided |
cathodal | 1.096154 | 0.8335773 | 0.4124131 | 25 | -1.612139 | 3.804446 | One Sample t-test | two.sided |
Follow-up Bayesian one-sample t-test:
medianLatencyCenterStats %>%
group_by(stimulation,subject) %>% # for each session and subject
summarise(latency = mean(latency.baseline)) %>% # average over all other variables
spread(stimulation, latency) %>% # make separate columns with test data
summarise_if(is.numeric, funs(extractBF(ttestBF(.), onlybf = TRUE))) %>% # run Bayesian t-test on each column, keeping only the BF
gather(stimulation,BF,anodal,cathodal) %>% # make row for each stimulation condition
kable(.)
stimulation | BF |
---|---|
anodal | 0.3218926 |
cathodal | 0.2840670 |