<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: PROC Mixed for EEG time series comparison in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/PROC-Mixed-for-EEG-time-series-comparison/m-p/630981#M30245</link>
    <description>&lt;P&gt;I am only just starting to use SAS on EEG time series. It might be helpful to use SAS Enterprise Miner, which is a part of SAS software package for the universities.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 10 Mar 2020 16:02:58 GMT</pubDate>
    <dc:creator>pink_poodle</dc:creator>
    <dc:date>2020-03-10T16:02:58Z</dc:date>
    <item>
      <title>PROC Mixed for EEG time series comparison</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/PROC-Mixed-for-EEG-time-series-comparison/m-p/621624#M29944</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have individual time series data from 32 EEG channels. In the data, time runs from -200ms to 800ms. Zero is where a stimulus is presented. Two groups of subjects (10 patients v 20 controls) carried out four experimental conditions. My data have been averaged across trials, separately for each group, participant and condition. In other words, for each participant I have a separate time series for each condition, which has been averaged across trials.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For individual EEG channels I want to overplot the average EEG signal for both groups (on the y-axis) as a function of time (from -200 to 800ms, in 10ms increments), and indicate where in time the two time series are statistically significantly different from each other - i.e. effectively a set of multiple pairwise comparisons, one for each time point.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So far, to deal with the fact that we have a repeated measures design, I have used PROC MIXED as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ods output diffs = diff;&lt;BR /&gt;PROC MIXED DATA=mlm2 COVTEST METHOD=ML;&lt;BR /&gt;&amp;nbsp;CLASS sub group time;&amp;nbsp;&lt;BR /&gt;&amp;nbsp; MODEL EEGdata = group time group*time / SOLUTION&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; OUTP=pred;&lt;BR /&gt;&amp;nbsp; RANDOM INTERCEPT / SUBJECT=sub TYPE= un;&lt;BR /&gt;&amp;nbsp; LSMEANS group*time / diff;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data subset; set diff;&lt;BR /&gt;&amp;nbsp;if group = _group then delete;&lt;BR /&gt;&amp;nbsp;if time ^= _time then delete;&lt;BR /&gt;&amp;nbsp;timepoint_id = group||_group||time1;&lt;BR /&gt;&amp;nbsp;raw_p = Probt;&lt;BR /&gt;&amp;nbsp; keep timepoint_id raw_p;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc multtest inpvalues=subset holm hoc fdr;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The general idea was to use LSmeans to get a set of pairwise comparisons which would give me a complete set of uncorrected t-tests. Then select the ones I want and run those p-values through proc multtest to do the statistical corrections. I would have liked to use the slice option, but could not find a way to obtain adjustments for the p-values, directly, so I settled on this rather clumsy route. I know you can use the adjust option in the lsmeans statement, but the only way I could think of using this to prevent computing all pairwise comparisons (thereby obtaining a very conservative adjustment as a result), was to use the lsmestimate route - but coding that looked horrific with 100 time points.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In summary:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1) Does anyone see an objection to the&amp;nbsp; use of proc mixed to run the basic model in this way?&lt;/P&gt;&lt;P&gt;2) I am aware that taking account of autocorrelation in the data would be ideal, but including a random effect like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; random intercept time / subject=sub type=ar(1)&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; caused the models to run forever, even when I resampled the timeseries to a much coarser scale. This also made me think that I&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; might be doing something wrong.&lt;/P&gt;&lt;P&gt;3) Are there better / smarter / more elegant ways of obtaining the pairwise comparisons I am seeking.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Bottom line, help needed please ....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Piers C&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 01 Feb 2020 11:38:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/PROC-Mixed-for-EEG-time-series-comparison/m-p/621624#M29944</guid>
      <dc:creator>Piers</dc:creator>
      <dc:date>2020-02-01T11:38:04Z</dc:date>
    </item>
    <item>
      <title>Re: PROC Mixed for EEG time series comparison</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/PROC-Mixed-for-EEG-time-series-comparison/m-p/630981#M30245</link>
      <description>&lt;P&gt;I am only just starting to use SAS on EEG time series. It might be helpful to use SAS Enterprise Miner, which is a part of SAS software package for the universities.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Mar 2020 16:02:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/PROC-Mixed-for-EEG-time-series-comparison/m-p/630981#M30245</guid>
      <dc:creator>pink_poodle</dc:creator>
      <dc:date>2020-03-10T16:02:58Z</dc:date>
    </item>
    <item>
      <title>Re: PROC Mixed for EEG time series comparison</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/PROC-Mixed-for-EEG-time-series-comparison/m-p/631001#M30247</link>
      <description>Please also check my post, since you seem to have more experience, perhaps you would have some suggestions...:&lt;BR /&gt;&lt;A href="https://communities.sas.com/t5/SAS-Data-Mining-and-Machine/EEG-brain-data-survival-mining/m-p/630997#M8173" target="_blank"&gt;https://communities.sas.com/t5/SAS-Data-Mining-and-Machine/EEG-brain-data-survival-mining/m-p/630997#M8173&lt;/A&gt;</description>
      <pubDate>Tue, 10 Mar 2020 16:22:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/PROC-Mixed-for-EEG-time-series-comparison/m-p/631001#M30247</guid>
      <dc:creator>pink_poodle</dc:creator>
      <dc:date>2020-03-10T16:22:46Z</dc:date>
    </item>
  </channel>
</rss>

