Skip to content

Instantly share code, notes, and snippets.

View benwhalley's full-sized avatar

Ben Whalley benwhalley

  • Plymouth University
View GitHub Profile
<?xml version="1.0" ?>
<auth>
<publications>
<publication>
<authors>bjwhalley,thollins</authors>
<elements_id>1</elements_id>
<bibtex>{Stuff here}</bibtex>
<timestamp>2050-01-31T20:00-4:00</timestamp>
</publication>
<publication>
library(rstanarm)
library(tidybayes)
m1 <- stan_lmer(t2_accuracy ~ lag*condition + (1|p), data = rsvp_accuracy)
nd <- expand.grid(condition=unique(rsvp_accuracy$condition), lag=factor(c(1,3))) %>% as.tibble() %>% mutate(p=Inf)
m1.preds <- add_fitted_samples(nd, m1)
m1.preds.wide <- m1.preds %>%
data.table::dcast(.iteration+condition~lag)
person sauce pudding yumminess
1 cream choc 17.197621767238935
2 cream choc 18.849112552583602
3 cream choc 27.79354157074562
4 cream choc 20.35254195712288
5 cream choc 20.64643867580473
6 cream choc 28.575324934416408
7 cream choc 22.30458102994601
8 cream choc 13.67469382696733
9 cream choc 16.565735740532368
patient dose improvement
1 0 2.197621767238937
2 0 3.8491125525836
3 0 12.79354157074562
4 0 5.35254195712288
5 0 5.646438675804731
6 0 13.575324934416406
7 0 7.304581029946012
8 0 -1.3253061730326703
9 0 1.5657357405323697
```{r}
expand.grid(person=1:5, trial=1:10) %>%
group_by(person) %>%
mutate(trialnumcreate = row_number()) %>%
ungroup() %>%
arrange(person,trial)
mtcars %>%
[1] "3. Age"
[2] "4. Gender"
[3] "5. Height (cm eg, 168)"
[4] "6. Current Weight (kg eg, 66)"
[5] "7. The lowest adult weight that you have ever been from age of 18 onwards (kg eg, 50)"
[6] "8. Highest adult weight that you have ever been since the age of 18, excluding pregnancy (kg eg, 62)"
@article{henderson_stepwise_1989,
title = {Stepwise {Regression} in {Social} and {Psychological} {Research}},
volume = {64},
issn = {0033-2941},
url = {https://doi.org/10.2466/pr0.1989.64.1.251},
doi = {10.2466/pr0.1989.64.1.251},
abstract = {Researchers often invoke stepwise ordinary least squares regression to explain, predict or classify practical problems or theoretical constructs in psychological and social research. Unfortunately, this statistical technique is used without proper consideration for its inherent theoretical and practical limitations, a problem expected to grow even more serious with the proliferation of statistical packages for use on personal computers. Use of stepwise regression in social and psychological research is reconsidered here. Explanations of forward selection, backward elimination and combination stepwise procedures are provided; limitations of the technique, statistical and practical, are then addressed. Analysis shows that most of the current applic
import random
import pandas as pd
def randomisesims():
stimA = list(range(1,91))
stimB = list(range(91,131))
random.shuffle(stimA)
random.shuffle(stimB)
return stimA[:40]+stimB[:20]
Condition stimuli p RT
A S1 1 151.84776423196666
B S1 1 313.6829804494978
C S1 1 556.6156324888166
A S2 1 53.63154468977615
B S2 1 560.3667345910135
C S2 1 586.0361000228185
A S3 1 504.9853511354472
B S3 1 271.76747315203426
C S3 1 267.13421840610965