<?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 Piecewise Linear mixed-effects curve with predicted line and confidence intervals in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Piecewise-Linear-mixed-effects-curve-with-predicted-line-and/m-p/647887#M31095</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have used SAS before but I am very new and I am struggling to create a visual of my data. I would like to create a graph similar to the one displayed below. I have the pre and post data 10 years before and 10 years after AZA use. I tried using PROC MIXED and PROC SGPLOT below&amp;nbsp;but I am not getting anywhere close to this graph. Please help.&lt;/P&gt;&lt;PRE&gt;Proc Mixed Data=import;
Class time;
Model fvc = time / DDFM=KenwardRoger; 
Repeated time / Subject=id Type=ANTE(1) R RCorr;
Run;

PROC SGPLOT DATA=import NOAUTOLEGEND; 
SERIES X=time Y=fvc / GROUP=id; 
RUN;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="graph.jpg" style="width: 309px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/39455i929B4F4EA66714D1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="graph.jpg" alt="graph.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 14 May 2020 17:47:01 GMT</pubDate>
    <dc:creator>diversitygal</dc:creator>
    <dc:date>2020-05-14T17:47:01Z</dc:date>
    <item>
      <title>Piecewise Linear mixed-effects curve with predicted line and confidence intervals</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Piecewise-Linear-mixed-effects-curve-with-predicted-line-and/m-p/647887#M31095</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have used SAS before but I am very new and I am struggling to create a visual of my data. I would like to create a graph similar to the one displayed below. I have the pre and post data 10 years before and 10 years after AZA use. I tried using PROC MIXED and PROC SGPLOT below&amp;nbsp;but I am not getting anywhere close to this graph. Please help.&lt;/P&gt;&lt;PRE&gt;Proc Mixed Data=import;
Class time;
Model fvc = time / DDFM=KenwardRoger; 
Repeated time / Subject=id Type=ANTE(1) R RCorr;
Run;

PROC SGPLOT DATA=import NOAUTOLEGEND; 
SERIES X=time Y=fvc / GROUP=id; 
RUN;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="graph.jpg" style="width: 309px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/39455i929B4F4EA66714D1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="graph.jpg" alt="graph.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 14 May 2020 17:47:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Piecewise-Linear-mixed-effects-curve-with-predicted-line-and/m-p/647887#M31095</guid>
      <dc:creator>diversitygal</dc:creator>
      <dc:date>2020-05-14T17:47:01Z</dc:date>
    </item>
    <item>
      <title>Re: Piecewise Linear mixed-effects curve with predicted line and confidence intervals</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Piecewise-Linear-mixed-effects-curve-with-predicted-line-and/m-p/647897#M31096</link>
      <description>&lt;P&gt;Well, I think you are going to need PROC NLMIXED if you want to duplicate those graphs as they fit a segmented model which is something that PROC MIXED doesn't do without some major coding.&amp;nbsp; The key is to include a PREDICT statement with the out= option to get the predicted values and confidence bounds into a dataset.&lt;/P&gt;
&lt;P&gt;However, your PROC MIXED code treats time as a categorical variable, so you can get output with breaks at each time point.&amp;nbsp; Simply add outp=predicted to your model statement.&amp;nbsp; This will give you a dataset named "predicted" with the estimate for each time point, as well as upper and lower (1-alpha) confidence bounds.&amp;nbsp; Take that dataset as your input to PROC SGPLOT.&amp;nbsp; This note&amp;nbsp;&lt;A href="https://support.sas.com/kb/42/542.html" target="_self"&gt;https://support.sas.com/kb/42/542.html&lt;/A&gt;&amp;nbsp; will help walk you through the plot. Note that some of the data shaping steps won't be needed as you already have the estimate and the lower and upper bounds.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SteveDenham&lt;/P&gt;</description>
      <pubDate>Thu, 14 May 2020 18:28:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Piecewise-Linear-mixed-effects-curve-with-predicted-line-and/m-p/647897#M31096</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2020-05-14T18:28:01Z</dc:date>
    </item>
  </channel>
</rss>

