<?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 proc mixed with repeated mesures in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/proc-mixed-with-repeated-mesures/m-p/971464#M48813</link>
    <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I am working on a regression model with repeated measures, and my response variable is continuous.&lt;/P&gt;&lt;P&gt;Each pair of physician-patient-drug is unique, but the physician may have several patients who are prescribed different medications.&lt;/P&gt;&lt;P&gt;My dataset looks like this (My dataset contains approximately 15000 rows, approximately 15,000 patients are treated by around 150 physicians.)&lt;/P&gt;&lt;P&gt;data drugs;&lt;BR /&gt;input physician patient drug $ outcome age gender$;&lt;BR /&gt;datalines;&lt;BR /&gt;1 1 a1 83.1 55 F&lt;BR /&gt;1 1 b5 76.2 55 F&lt;BR /&gt;1 1 b7 99.9 55 F&lt;BR /&gt;1 4 f2 2.7 82 M&lt;BR /&gt;2 4 a1 40.2 82 M&lt;BR /&gt;2 5 a2 88.1 65 M&lt;BR /&gt;3 6 c8 26.1 49 F&lt;BR /&gt;4 2 a1 23.3 89 F&lt;BR /&gt;5 3 b1 92.1 67 M&lt;BR /&gt;5 3 b2 92.4 67 M&lt;BR /&gt;6 7 e4 12.1 28 M&lt;BR /&gt;6 8 a2 5.1 73 M&lt;BR /&gt;6 8 b2 3.1 73 M&lt;BR /&gt;7 9 a2 98.9 79 M&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc mixed data=drugs noclprint;&lt;BR /&gt;class patient physician drug gender(ref="F") ;&lt;BR /&gt;model outcome= gender age /solution outp=preddata ;&lt;/P&gt;&lt;P&gt;repeated DRUG /subject=physician(patient) type=cs ;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;I am working on evaluating whether certain drugs are prescribed correctly, which will be my outcome measure.&lt;/P&gt;&lt;P&gt;Do you believe the model is accurate? This is my first time working with this type of data.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thank you for your response.&lt;/P&gt;&lt;P&gt;Teresa&lt;/P&gt;</description>
    <pubDate>Fri, 25 Jul 2025 11:21:11 GMT</pubDate>
    <dc:creator>Teresa12</dc:creator>
    <dc:date>2025-07-25T11:21:11Z</dc:date>
    <item>
      <title>proc mixed with repeated mesures</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-mixed-with-repeated-mesures/m-p/971464#M48813</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I am working on a regression model with repeated measures, and my response variable is continuous.&lt;/P&gt;&lt;P&gt;Each pair of physician-patient-drug is unique, but the physician may have several patients who are prescribed different medications.&lt;/P&gt;&lt;P&gt;My dataset looks like this (My dataset contains approximately 15000 rows, approximately 15,000 patients are treated by around 150 physicians.)&lt;/P&gt;&lt;P&gt;data drugs;&lt;BR /&gt;input physician patient drug $ outcome age gender$;&lt;BR /&gt;datalines;&lt;BR /&gt;1 1 a1 83.1 55 F&lt;BR /&gt;1 1 b5 76.2 55 F&lt;BR /&gt;1 1 b7 99.9 55 F&lt;BR /&gt;1 4 f2 2.7 82 M&lt;BR /&gt;2 4 a1 40.2 82 M&lt;BR /&gt;2 5 a2 88.1 65 M&lt;BR /&gt;3 6 c8 26.1 49 F&lt;BR /&gt;4 2 a1 23.3 89 F&lt;BR /&gt;5 3 b1 92.1 67 M&lt;BR /&gt;5 3 b2 92.4 67 M&lt;BR /&gt;6 7 e4 12.1 28 M&lt;BR /&gt;6 8 a2 5.1 73 M&lt;BR /&gt;6 8 b2 3.1 73 M&lt;BR /&gt;7 9 a2 98.9 79 M&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc mixed data=drugs noclprint;&lt;BR /&gt;class patient physician drug gender(ref="F") ;&lt;BR /&gt;model outcome= gender age /solution outp=preddata ;&lt;/P&gt;&lt;P&gt;repeated DRUG /subject=physician(patient) type=cs ;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;I am working on evaluating whether certain drugs are prescribed correctly, which will be my outcome measure.&lt;/P&gt;&lt;P&gt;Do you believe the model is accurate? This is my first time working with this type of data.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thank you for your response.&lt;/P&gt;&lt;P&gt;Teresa&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jul 2025 11:21:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-mixed-with-repeated-mesures/m-p/971464#M48813</guid>
      <dc:creator>Teresa12</dc:creator>
      <dc:date>2025-07-25T11:21:11Z</dc:date>
    </item>
    <item>
      <title>Re: proc mixed with repeated mesures</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-mixed-with-repeated-mesures/m-p/971636#M48824</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/59366"&gt;@Teresa12&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;The repeated statement models the correlation structure of residuals. If you believe there is random variability at the physician or patient level beyond what’s captured by the residuals, consider adding a random statement,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;for example:&amp;nbsp;&lt;STRONG&gt;random intercept / subject=physician(patient);&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;You're using compound symmetry (type=cs), which assumes equal correlation between all drug responses within a patient. This may be too restrictive. Consider testing other structures like type=un (unstructured) or type=ar(1) (autoregressive) and compare models using AIC/BIC.&lt;/P&gt;
&lt;P&gt;If you're interested in the effect of specific drugs, you might want to include drug as a fixed effect in the model:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;model outcome = gender age drug / solution;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You mentioned evaluating whether drugs are “prescribed correctly.” If this is a clinical appropriateness measure, you may need to define a benchmark or threshold for “correctness” and consider logistic regression or classification methods if the outcome becomes binary.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With that, please consider the following test example:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;proc mixed data=drugs noclprint;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;class patient physician drug gender(ref="F");&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;model outcome = gender age drug / solution outp=preddata;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;random intercept / subject=physician(patient);&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;repeated drug / subject=physician(patient) type=un;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;EM&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/EM&gt;Please consider the following SAS Documentation that can helps you:&lt;BR /&gt;&lt;A href="https://go.documentation.sas.com/doc/en/statcdc/14.2/statug/statug_mixed_examples02.htm" target="_blank"&gt;SAS Help Center: Example 78.2 Repeated Measures&lt;/A&gt;&lt;BR /&gt;and&lt;BR /&gt;&lt;A href="https://support.sas.com/resources/papers/proceedings/proceedings/sugi29/188-29.pdf" target="_blank"&gt;188-29: Repeated Measures Modeling with PROC MIXED&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Hope this helps you! Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Jul 2025 14:18:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-mixed-with-repeated-mesures/m-p/971636#M48824</guid>
      <dc:creator>Sa_S</dc:creator>
      <dc:date>2025-07-29T14:18:22Z</dc:date>
    </item>
    <item>
      <title>Re: proc mixed with repeated mesures</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-mixed-with-repeated-mesures/m-p/971645#M48825</link>
      <description>&lt;P&gt;Thank you very much for your assistance.&lt;/P&gt;&lt;P&gt;Your response has been incredibly helpful to me!!!&lt;/P&gt;</description>
      <pubDate>Tue, 29 Jul 2025 16:03:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-mixed-with-repeated-mesures/m-p/971645#M48825</guid>
      <dc:creator>Teresa12</dc:creator>
      <dc:date>2025-07-29T16:03:12Z</dc:date>
    </item>
    <item>
      <title>Re: proc mixed with repeated mesures</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-mixed-with-repeated-mesures/m-p/971653#M48826</link>
      <description>&lt;P&gt;Thanks a lot for your feedback and for using SAS!&lt;/P&gt;</description>
      <pubDate>Tue, 29 Jul 2025 18:15:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-mixed-with-repeated-mesures/m-p/971653#M48826</guid>
      <dc:creator>Sa_S</dc:creator>
      <dc:date>2025-07-29T18:15:39Z</dc:date>
    </item>
  </channel>
</rss>

