<div dir="ltr"><div><div><div>Hello David,<br><br></div>Using RMS amplitude rather than mean amplitude should be straightforward, you can just use the rms() function rather than the mean() function. As for papers that do this kind of analysis, Olaf shared some above (in particular, Amsel et al., 2011, seem to use basically the same kind of analysis as the code I sent above), and here are a few others off the top of my head that I believe take more or less the same route:<br><br><a href="http://www.ncbi.nlm.nih.gov/pubmed/21981676">http://www.ncbi.nlm.nih.gov/pubmed/21981676</a><br><a href="http://journals.plos.org/plosone/article?id=10.1371/journal.pone.0015024">http://journals.plos.org/plosone/article?id=10.1371/journal.pone.0015024</a><br><br></div>Best,<br></div>Steve<br><div><div><br></div></div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"><div dir="ltr"><div><br><br></div>Stephen Politzer-Ahles<br>New York University, Abu Dhabi<br>Neuroscience of Language Lab<br><a href="http://www.nyu.edu/projects/politzer-ahles/" target="_blank">http://www.nyu.edu/projects/politzer-ahles/</a><br></div></div></div>
<br><div class="gmail_quote">On Sun, Jun 21, 2015 at 5:03 PM, David Jackson Morris <span dir="ltr"><<a href="mailto:dmorris@hum.ku.dk" target="_blank">dmorris@hum.ku.dk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>
<div style="direction:ltr;font-family:Tahoma;color:#000000;font-size:10pt">Hi Stephen,
<div><br>
<div>Thanks for your thoughts and the code. I'm going to try this with RMS amplitude for each trial instead of mean amplitude, because I'm looking at the acoustic change complex, and the attached paper suggests that it is a strong correlate of <span style="font-size:10pt">phonemic
perception</span><span style="font-size:10pt">. Do you know of any papers that have used a route similar to the one that you've sketched for me below?</span></div>
<div><span style="font-size:10pt"><br>
</span></div>
<div><span style="font-size:10pt">Thanks again for your help.</span></div>
<div><br>
</div>
<div>Best wishes</div>
<div>David</div>
<div><br>
</div>
<div><br>
<div style="font-family:Times New Roman;color:#000000;font-size:16px">
<hr>
<div style="direction:ltr"><font color="#000000" face="Tahoma" size="2"><b>From:</b> <a href="mailto:politzerahless@gmail.com" target="_blank">politzerahless@gmail.com</a> [<a href="mailto:politzerahless@gmail.com" target="_blank">politzerahless@gmail.com</a>] on behalf of Stephen Politzer-Ahles [<a href="mailto:spa268@nyu.edu" target="_blank">spa268@nyu.edu</a>]<br>
<b>Sent:</b> Sunday, June 21, 2015 7:48 AM<br>
<b>To:</b> David Jackson Morris<br>
<b>Cc:</b> Lampros Perogamvros; <a href="mailto:eeglablist@sccn.ucsd.edu" target="_blank">eeglablist@sccn.ucsd.edu</a><br>
<b>Subject:</b> Re: [Eeglablist] mixed model for EEG data<br>
</font><br>
</div><div><div class="h5">
<div></div>
<div>
<div dir="ltr">
<div>
<div>
<div>Hello David,<br>
<br>
</div>
I'm not aware of any built-ins for doing this, but it is fairly straightforward using just basic MATLAB functions. The specifics depend on how your data have been processed, how your trial-level predictor info is coded, etc, how you plan on doing the analysis,
etc. Here's a simple example that assumes no trials have been removed (i.e., trial n of EEG corresponds to the nth predictor value that will go into the model), that the predictors are stored in a separate logfile that was generated by the stimulus presentation
software (as opposed to, e.g., in the EEG event codes themselves), and that the analysis will only look at one time window and one channel. It could of course be tweaked to handle different situations than those described above.<br>
<br>
<br>
<br>
</div>
<div>% the time range (inclusive) to average over<br>
</div>
<div>time_window = [150 250];<br>
<br>
</div>
<div>% the channel to use<br>
</div>
<div>channame = 'Fz';<br>
<br>
</div>
<div>% find all samples within this time range<br>
</div>
<div>samples = find( EEG.times>=time_window(1) & EEG.times<=time_window(end) );<br>
<br>
</div>
<div>% find the index of the channel<br>
</div>
<div>chanidx = find( arrayfun( @(x)( strcmpi( EEG.chanlocs(x).labels, channame ) ), 1:EEG.nbchan ) );<br>
<br>
</div>
<div>% get the window mean amplitude for each trial<br>
</div>
<div>data = squeeze( mean( EEG.data( chanidx, samples, : ), 2 ) );<br>
<br>
</div>
<div>% write out to text<br>
</div>
dlmwrite( ['voltages_' channame '_' num2str(time_window(1)) '-' num2str(time_window(end))], data );<br>
<br>
</div>
% the next step is to read those values back into R, along with whatever other file contains the trial-by-trial predictors that you want to regress these values on<br>
</div>
<div class="gmail_extra"><br clear="all">
<div>
<div>
<div dir="ltr">
<div><br>
<br>
</div>
Stephen Politzer-Ahles<br>
New York University, Abu Dhabi<br>
Neuroscience of Language Lab<br>
<a href="http://www.nyu.edu/projects/politzer-ahles/" target="_blank">http://www.nyu.edu/projects/politzer-ahles/</a><br>
</div>
</div>
</div>
<br>
<div class="gmail_quote">On Thu, Jun 18, 2015 at 3:17 AM, David Jackson Morris <span dir="ltr">
<<a href="mailto:dmorris@hum.ku.dk" target="_blank">dmorris@hum.ku.dk</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>
<div style="direction:ltr;font-family:Tahoma;color:#000000;font-size:10pt">Hi all and Lampros,
<div><br>
</div>
<div>This is a very interesting thread and it would be good to see a follow-up to this. I also wonder if anyone has any experience porting preprocessed data to R?</div>
<div><br>
</div>
<div>Best wishes</div>
<div>David</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div>
<div>
<div style="margin:0px"><font face="Segoe UI,Helvetica,Arial,sans-serif" size="3"><font color="gray" face="Verdana,sans-serif" size="1"><span style="font-size:7.5pt"><b>David Jackson Morris</b></span></font></font></div>
</div>
<div>
<div style="margin:0px"><font face="Segoe UI,Helvetica,Arial,sans-serif" size="3"><font color="gray" face="Verdana,sans-serif" size="1"><span style="font-size:7.5pt">Postdoc</span></font></font></div>
</div>
<div>
<div style="margin:0px"><font face="Segoe UI,Helvetica,Arial,sans-serif" size="3"><font color="gray" face="Verdana,sans-serif" size="1"><span style="font-size:7.5pt"> </span></font></font></div>
</div>
<div>
<div style="margin:0px"><font face="Segoe UI,Helvetica,Arial,sans-serif" size="3"><font color="gray" face="Verdana,sans-serif" size="1"><span style="font-size:7.5pt"><b>Københavns Universitet/University of Copenhagen</b></span></font></font></div>
</div>
<div>
<div style="margin:0px"><font face="Segoe UI,Helvetica,Arial,sans-serif" size="3"><font color="gray" face="Verdana,sans-serif" size="1"><span style="font-size:7.5pt">INSS/Department of Nordic Studies and Linguistics</span></font></font></div>
<div style="margin:0px"><font face="Segoe UI,Helvetica,Arial,sans-serif" size="3"><font color="gray" face="Verdana,sans-serif" size="1"><span style="font-size:7.5pt">Audiologopædi/Speech Pathology & Audiology</span></font></font></div>
</div>
<div>
<div style="margin:0px"><font face="Segoe UI,Helvetica,Arial,sans-serif" size="3"><font color="gray" face="Verdana,sans-serif" size="1"><span style="font-size:7.5pt">Njalsgade 120</span></font></font></div>
</div>
<div>
<div style="margin:0px"><font face="Segoe UI,Helvetica,Arial,sans-serif" size="3"><font color="gray" face="Verdana,sans-serif" size="1"><span style="font-size:7.5pt">2300 København S</span></font></font></div>
</div>
<div>
<div style="margin:0px"><font face="Segoe UI,Helvetica,Arial,sans-serif" size="3"><font color="gray" face="Verdana,sans-serif" size="1"><span style="font-size:7.5pt"><br>
</span></font></font></div>
<div style="margin:0px"><font face="Segoe UI,Helvetica,Arial,sans-serif" size="3"><font color="gray" face="Verdana,sans-serif" size="1"><span style="font-size:7.5pt">Office 22.5.14</span></font></font></div>
</div>
<div>
<div style="margin:0px"><font face="Segoe UI,Helvetica,Arial,sans-serif" size="3"><font color="gray" face="Verdana,sans-serif" size="1"><span style="font-size:7.5pt" lang="en-US">TLF 35328660 </span></font></font></div>
<div style="margin:0px"><font face="Segoe UI,Helvetica,Arial,sans-serif" size="3"><font color="gray" face="Verdana,sans-serif" size="1"><span style="font-size:7.5pt" lang="en-US"><a href="mailto:dmorris@hum.ku.dk" target="_blank">dmorris@hum.ku.dk</a></span></font></font></div>
</div>
</div>
<div><br>
<div style="font-family:Times New Roman;color:#000000;font-size:16px">
<hr>
<div style="direction:ltr"><font color="#000000" face="Tahoma" size="2"><b>From:</b> Lampros Perogamvros [<a href="mailto:lambros.pero@gmail.com" target="_blank">lambros.pero@gmail.com</a>]<br>
<b>Sent:</b> Tuesday, June 16, 2015 1:44 PM<br>
<b>To:</b> <a href="mailto:eeglablist@sccn.ucsd.edu" target="_blank">eeglablist@sccn.ucsd.edu</a><br>
<b>Subject:</b> [Eeglablist] mixed model for EEG data<br>
</font><br>
</div>
<div>
<div>
<div></div>
<div>
<div dir="ltr">Hi all,
<div><br>
</div>
<div>We were just wondering whether you guys ever implemented a <span>mixed</span>
<span>model</span> analysis for eeg data, and if so how you did it/setup the <span>
model</span>? This model would be ideal when there are unequal numbers of observations per condition, and sometimes 0 observations for a condition for a given subject. This
<span>model</span> would allow us to use all the data and do statistical tests on the individual observations rather than just averaging over all the observations for each subject, so it would be much more powerful. Are you aware of any such model for EEG?<br>
<br>
</div>
<div>Thanks!<br>
</div>
<div>Lampros Perogamvros MD<br>
</div>
<div>University of Wisconsin <br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<br>
_______________________________________________<br>
Eeglablist page: <a href="http://sccn.ucsd.edu/eeglab/eeglabmail.html" rel="noreferrer" target="_blank">
http://sccn.ucsd.edu/eeglab/eeglabmail.html</a><br>
To unsubscribe, send an empty email to <a href="mailto:eeglablist-unsubscribe@sccn.ucsd.edu" target="_blank">
eeglablist-unsubscribe@sccn.ucsd.edu</a><br>
For digest mode, send an email with the subject "set digest mime" to <a href="mailto:eeglablist-request@sccn.ucsd.edu" target="_blank">
eeglablist-request@sccn.ucsd.edu</a><br>
</blockquote>
</div>
<br>
</div>
</div>
</div></div></div>
</div>
</div>
</div>
</div>
</blockquote></div><br></div>