-
Hey Bruno, Ages ago I mentioned I wanted to apply the baseline for one word to multiple words in a sentence, and you said send you what I tried... finally I got around to it. Here I've tried to compute the mean amplitude across the baseline for the word I want and subtract it from all the other words, but it doesn't really work. Can you see what I'm doing wrong? I put the corresponding data and script (common_baseline_example.R) in Dropbox/kate_eeg_data TIA
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Ok I maybe came up with a (very clunky) solution (posting here in case it's useful or someone one day can suggest something better): My issue is that I'm creating a separate eeg_lst with the baseline average amplitudes at the first word in a sentence which should then be applied to every word in that same sentence. If there are 20 sentences, then this yields an eeg_lst with one baseline value per sentence, .id values 1:20. But each of the words in the 20 sentences in the main eeg_lst gets its own .id, so there are .ids 1:nrow(eeg_lst). Thus, .id 2 in the baseline eeg_lst is for the first word of the second sentence, but .id 2 in the main eeg_lst is the second word of the first sentence: The issue was therefore how to match the .id in the baseline eeg_lst with the relevant sentences in the main eeg_lst. To do this:
So the loop extracts each individual word from the main eeg_lst, subtracts the relevant baseline, then adds it to a new eeg_lst, word-by-word. Clunky but it seems to work. |
Beta Was this translation helpful? Give feedback.
Ok I maybe came up with a (very clunky) solution (posting here in case it's useful or someone one day can suggest something better):
My issue is that I'm creating a separate eeg_lst with the baseline average amplitudes at the first word in a sentence which should then be applied to every word in that same sentence. If there are 20 sentences, then this yields an eeg_lst with one baseline value per sentence, .id values 1:20.
But each of the words in the 20 sentences in the main eeg_lst gets its own .id, so there are .ids 1:nrow(eeg_lst). Thus, .id 2 in the baseline eeg_lst is for the first word of the second sentence, but .id 2 in the main eeg_lst is the second word of the first sentence: T…