<?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: How do I plot a multilevel model with clustered participants? in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/How-do-I-plot-a-multilevel-model-with-clustered-participants/m-p/314830#M11063</link>
    <description>&lt;P&gt;When you use the STORE statement in PROC MIXED, the file that is stored (called the "item store") contains all information about the model, including the dependent variable. Thus you do not need to re-specify that information in PRO PLM. (You did use the STORE statement, right?)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You say "&lt;SPAN&gt;It did not work in SAS, as one would expect," but that doesn't help us diagnose what happened. Was there an error? Was the graph not what you want?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;From the information you've provided, I suggest that you reread the article on the EFFECTPLOT statement AND read the many links in that article, which provide additional information. If you post some sample data (in the form of an&amp;nbsp;CSV or&amp;nbsp;SAS DATA step;&amp;nbsp;NOT as an image file), someone might be able to work with you. &lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 28 Nov 2016 14:58:35 GMT</pubDate>
    <dc:creator>Rick_SAS</dc:creator>
    <dc:date>2016-11-28T14:58:35Z</dc:date>
    <item>
      <title>How do I plot a multilevel model with clustered participants?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-do-I-plot-a-multilevel-model-with-clustered-participants/m-p/314409#M11047</link>
      <description>&lt;P&gt;Hi, all. I'm fairly new to SAS (using version 9.4), as a colleague kindly showed me how to run some analyses I was requested to do on revisions for a manuscript that I was unable to do in SPSS / Mplus. I am seeing if there are any differences among 3 groups of users of different drugs (let's call them X, Y, and Z) on a measure of Attention. Each participant was seen once yearly for 4 years and therefore has 4 scores on attention. The data are in long-form with each time-point coded as "timept", and time was treated as a continuous variable. Predictors in the model include age, sex, and years of education. I included effects of time ("timept"), drug group ("grp"), and a time x group interaction in the model, and clustered participants by hospital to account for prescribing practices.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to plot results of this analysis with each group (X, Y, and Z) on their separate lines, with time on the x-axis and attention scores on the y-axis? I've Googled around trying to figure this out, but have been having trouble finding code to adapt which has clustered participants as I have done - though perhaps I have not looked in the right place.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help or advice on how else to best present these findings would be much appreciated. The time x group interaction is significant - users of drug Y showed worse attention over time than users of drugs X and Z. Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the code I have been using:&lt;/P&gt;&lt;PRE class="aLF-aPX-K0-aPE aLF-aPX-aLK-ayr-auR"&gt;ods listing;
run;

libname data 'C:\Users\kateiverson\Downloads\';
run;
&lt;BR /&gt;ods graphics on;&lt;BR /&gt;
*Importing data;

proc import datafile="C:\Users\kateiverson\Downloads\11-25-16.csv"
     out=final
     dbms=csv
     replace;
run;

*Attention;

proc mixed data=final plots=all covtest noclprint cl nobound;
   class hospital subjectID grp(ref="3");
   model attention=age sex edu timept grp timept*grp / solution cl;
   random intercept timept / subject=hospital;
   random intercept timept / subject=subjectID(hospital);
run;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 26 Nov 2016 03:37:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-do-I-plot-a-multilevel-model-with-clustered-participants/m-p/314409#M11047</guid>
      <dc:creator>kate_iverson</dc:creator>
      <dc:date>2016-11-26T03:37:45Z</dc:date>
    </item>
    <item>
      <title>Re: How do I plot a multilevel model with clustered participants?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-do-I-plot-a-multilevel-model-with-clustered-participants/m-p/314435#M11048</link>
      <description>&lt;P&gt;Can you post sample data and a mockup, even hand drawn, of what your plot should look like?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 26 Nov 2016 07:20:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-do-I-plot-a-multilevel-model-with-clustered-participants/m-p/314435#M11048</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-11-26T07:20:43Z</dc:date>
    </item>
    <item>
      <title>Re: How do I plot a multilevel model with clustered participants?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-do-I-plot-a-multilevel-model-with-clustered-participants/m-p/314451#M11049</link>
      <description>&lt;P&gt;First, make sure ODS GRAPHICS are on and use the PLOTS=ALL option on the PROC MIXED statement. You might get lucky and see an insightful graph that is created automatically:&lt;/P&gt;
&lt;P&gt;ods graphics on;&lt;/P&gt;
&lt;P&gt;proc mixed plots=all ....;&lt;/P&gt;
&lt;P&gt;...;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Most likely you should look at the EFFECTPLOT statement. An introduction with examples is in the article &lt;A href="http://blogs.sas.com/content/iml/2016/06/22/sas-effectplot-statement.html" target="_self"&gt;"Use the EFFECTPLOT statement to visualize regression models in SAS."&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 26 Nov 2016 11:21:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-do-I-plot-a-multilevel-model-with-clustered-participants/m-p/314451#M11049</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2016-11-26T11:21:18Z</dc:date>
    </item>
    <item>
      <title>Re: How do I plot a multilevel model with clustered participants?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-do-I-plot-a-multilevel-model-with-clustered-participants/m-p/314480#M11050</link>
      <description>&lt;P&gt;Hi Reeza,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes, here is some sample data and the kind of plot I am looking for. Scores at timept=0 are scores at baseline.&lt;/P&gt;&lt;P&gt;I'd like the graph to reflect values on Attention after controlling for the covariates (age, sex, education). Of note, age does not change as I'm controlling for age as simply their age at the baseline visit.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is this possible?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;BR /&gt;Kate&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/6031iA0DBC75727F66D6C/image-size/original?v=v2&amp;amp;px=-1" border="0" alt="Screen Shot 2016-11-26 at 1.22.23 PM.png" title="Screen Shot 2016-11-26 at 1.22.23 PM.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/6032i6994C0262BCA7C48/image-size/original?v=v2&amp;amp;px=-1" border="0" alt="Screen Shot 2016-11-26 at 1.28.26 PM.png" title="Screen Shot 2016-11-26 at 1.28.26 PM.png" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 26 Nov 2016 18:37:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-do-I-plot-a-multilevel-model-with-clustered-participants/m-p/314480#M11050</guid>
      <dc:creator>kate_iverson</dc:creator>
      <dc:date>2016-11-26T18:37:52Z</dc:date>
    </item>
    <item>
      <title>Re: How do I plot a multilevel model with clustered participants?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-do-I-plot-a-multilevel-model-with-clustered-participants/m-p/314482#M11051</link>
      <description>&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" size="2"&gt;&lt;SPAN&gt;Hi Rick,&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" size="2"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" size="2"&gt;&lt;SPAN&gt;Thanks for the response. Unfortunately, plots=all with PROC MIXED does not give the insightful graph I have been hoping for!&amp;nbsp;EFFECTPLOT seems closer to what I want to achieve, but I am stuck after adapting some of the code, as I still haven’t accounted for clustering my participants by hospital in the plotting syntax (as I did in my analyses).&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" size="2"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" size="2"&gt;&lt;SPAN&gt;Here’s what I could come up with. I know it's wrong given that I haven’t even specified the dependent variable (attention) anywhere!&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc plm source=final;
&amp;nbsp;&amp;nbsp; effectplot slicefit(x=timept sliceby=timept=0 1 2 3 plotby=grp);
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;It did not work in SAS, as one would expect. &lt;/SPAN&gt;&lt;SPAN&gt;Would be grateful for any further advice.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Kate&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 26 Nov 2016 19:08:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-do-I-plot-a-multilevel-model-with-clustered-participants/m-p/314482#M11051</guid>
      <dc:creator>kate_iverson</dc:creator>
      <dc:date>2016-11-26T19:08:48Z</dc:date>
    </item>
    <item>
      <title>Re: How do I plot a multilevel model with clustered participants?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-do-I-plot-a-multilevel-model-with-clustered-participants/m-p/314830#M11063</link>
      <description>&lt;P&gt;When you use the STORE statement in PROC MIXED, the file that is stored (called the "item store") contains all information about the model, including the dependent variable. Thus you do not need to re-specify that information in PRO PLM. (You did use the STORE statement, right?)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You say "&lt;SPAN&gt;It did not work in SAS, as one would expect," but that doesn't help us diagnose what happened. Was there an error? Was the graph not what you want?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;From the information you've provided, I suggest that you reread the article on the EFFECTPLOT statement AND read the many links in that article, which provide additional information. If you post some sample data (in the form of an&amp;nbsp;CSV or&amp;nbsp;SAS DATA step;&amp;nbsp;NOT as an image file), someone might be able to work with you. &lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2016 14:58:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-do-I-plot-a-multilevel-model-with-clustered-participants/m-p/314830#M11063</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2016-11-28T14:58:35Z</dc:date>
    </item>
  </channel>
</rss>

