# Generate a simple example timeseries
ts <- data.frame(
subjects = rep(1, 100),
run = rep(1, 100),
time = seq(0, 99),
ROI1 = rnorm(100)
)
# Generate example events
events <- data.frame(
subjects = rep(1, 4),
run = rep(1, 4),
onset = c(10, 30, 50, 70),
duration = rep(0.5, 4),
event_type = c("hard", "easy", "hard", "easy"),
modulation = c(1, 1, 1, 1)
)
# Build design matrices
design_matrices <- convolve_design_matrix(
timeseries = ts,
events = events,
factors = list(difficulty = c("hard", "easy")),
contrasts = list(difficulty = matrix(c(-1, 1)))
)
Run the code above in your browser using DataLab