amplitudes | R Documentation |
Extract the amplitude or intensity values associated with each event. Amplitudes represent the strength or magnitude of events and can be used to:
Model parametric modulation of neural responses
Weight events by their intensity or importance
Create amplitude-modulated regressors
amplitudes(x)
## S3 method for class 'regressor'
amplitudes(x)
x |
The object containing event information (typically an event_term or event_model) |
A numeric vector of amplitude values, where:
Each value represents the intensity of an event
Default value of 1 indicates unmodulated events
Order matches the corresponding event sequence
event_term()
, onsets()
# Create event data with varying amplitudes
event_data <- data.frame(
condition = factor(c("stim", "stim", "stim", "stim")),
onsets = c(1, 10, 20, 30),
intensity = c(0.5, 1.0, 1.5, 2.0), # Parametrically varying intensity
run = c(1, 1, 1, 1)
)
# Create event term with amplitudes
eterm <- event_term(
list(condition = event_data$condition),
onsets = event_data$onsets,
amplitudes = event_data$intensity,
blockids = event_data$run
)
# Get amplitudes from term
amp <- amplitudes(eterm) # Returns: c(0.5, 1.0, 1.5, 2.0)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.