<?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: Model specification in Proc mixed for  time interval dependent variable in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Model-specification-in-Proc-mixed-for-time-interval-dependent/m-p/676202#M32408</link>
    <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/190438"&gt;@Ely&lt;/a&gt;&amp;nbsp;, here are some thoughts:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How to treat the intercept?&amp;nbsp; Well, it is the expected value for age=0, male, tttB, offlabel and injnr=0.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is a case where the F tests and any lsmeans you have will be substantially more informative than the solution vector.&amp;nbsp; Because PROC MIXED uses a non-full rank parameterization, various categories are set to 0 in the solution.&amp;nbsp; So, look at the residual plots, F tests and LSMEANS using the AT= option.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Should I run the model using PROC GLIMMIX with a gamma link and select the model with lower AIC?&amp;nbsp; That would be a gamma distribution.&amp;nbsp; Your code would look something like:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;
/* Gamma distribution */
proc glimmix data=have method=laplace ;
class treat sex hospital;
model interval = age sex treat dose_ interval inj_nr / S dist=gamma chisq;
random int / subject=pat(hospital) type=UN G ;
run;

/* Gaussian distribution */
proc glimmix data=have method=laplace ;
class treat sex hospital;
model interval = age sex treat dose_ interval inj_nr / S dist=gaussian chisq;
random int / subject=pat(hospital) type=UN G ;
run;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Selecting the distribution with the smaller AIC ought to give you the distribution that retains the most information in the data.&amp;nbsp; Note that I have fit both using METHOD=LAPLACE, as the AIC wouldn't be calculated for the gamma distribution using the default pseudo-likelihood linearization.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Again, get some plots to give you an idea of how well the model fits.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;SteveDenham&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 12 Aug 2020 15:29:03 GMT</pubDate>
    <dc:creator>SteveDenham</dc:creator>
    <dc:date>2020-08-12T15:29:03Z</dc:date>
    <item>
      <title>Model specification in Proc mixed for  time interval dependent variable</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Model-specification-in-Proc-mixed-for-time-interval-dependent/m-p/676113#M32401</link>
      <description>&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;I am trying to&amp;nbsp;estimate for a given indication :&lt;/P&gt;&lt;P&gt;&amp;nbsp; 1. the effect of sex, age, treatment&amp;nbsp; and dose on the interval between injections (of the treatment injected in the hospital) over time.&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;2.&amp;nbsp;the effect of sex, age, treatment&amp;nbsp; on the dose (qualitative, dosing interval) over time.&lt;/P&gt;&lt;P&gt;I also want to include the hospital experience in the analysis. There are 2 options for this: nested the patient in the hospital or include the number of patients injected at hospital level and a dummy indicating whether the patient change the hospital or not.&lt;/P&gt;&lt;P&gt;Patients don't receive the same number of injections (actually the number of injections varies from 1&amp;nbsp; to 19) and cannot switch between treatment over time.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data Have;
*infile datalines ;
input pat hospital Sex $ Age_at_initiation treat $ change_hosp dose_units dose_interval $ Inj_nr date mmddyy10.;
format date mmddyy10.;
cards;
3 9 M 80 tttB 1 1600 Off-label 1 02/19/2015
3 13 M 80 tttB 1 1200 High 2 08/31/2015
3 13 M 80 tttB 1 1200 High 3 01/10/2016
1 1 M 69 tttA 1 100 Low 1 12/02/2012
1 1 M 69 tttA 1 100 Low 2 05/05/2013
1 1 M 69 tttA 1 200 Low 3 07/07/2013
1 2 M 69 tttA 1 200 Moderate 4 11/15/2013
1 2 M 69 tttA 1 300 Moderate 5 04/24/2014
2 6 F 25 tttB 0 300 Low 1 03/27/2016
2 6 F 25 tttB 0 500 Moderate 2 10/04/2016
;;;;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For the first model, the dependent&amp;nbsp; variable "interval" is the difference between consecutive date of injections.&lt;/P&gt;&lt;P&gt;I have tried the following code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc mixed data=have covtest ;
class treat sex hospital;
model interval = age sex treat dose_ interval inj_nr / CHISQ S covb ;
random int / subject=pat(hospital) type=UN G ;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;My questions are:&lt;/P&gt;&lt;P&gt;a. Is this model specification answer to my research question?&lt;/P&gt;&lt;P&gt;b. How to validate and interpret the results?&lt;/P&gt;&lt;P&gt;Thank you in advance for your time and help.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Wed, 12 Aug 2020 11:03:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Model-specification-in-Proc-mixed-for-time-interval-dependent/m-p/676113#M32401</guid>
      <dc:creator>Ely</dc:creator>
      <dc:date>2020-08-12T11:03:26Z</dc:date>
    </item>
    <item>
      <title>Re: Model specification in Proc mixed for  time interval dependent variable</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Model-specification-in-Proc-mixed-for-time-interval-dependent/m-p/676134#M32403</link>
      <description>&lt;P&gt;Before starting on this, I have a question.&amp;nbsp; In the data, I see pat=1 for two hospitals.&amp;nbsp; My question is whether this patient was seen at both hospitals, or is it a situation where patient 1 is unique per hospital.&amp;nbsp; That will make a difference in your RANDOM statements.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Next, I suspect that interval is not a variable with Gaussian error.&amp;nbsp; Intervals like this give rise to Poisson distributed counts, and are generally gamma distributed.&amp;nbsp; If that is the case, you will likely need to shift to PROC GLIMMIX.&amp;nbsp; Next, what about interactions between your independent variables?&amp;nbsp; Are you willing to assume that males on tttA have the same effect on interval as females on tttB?&amp;nbsp; If you can make that assumption, then the model statement looks OK. And last, how many unique patients are involved.&amp;nbsp; To have pat as a continuous effect, you will almost certainly need to sort your data by hospital and patient.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Given all of that, you have a pretty good model.&amp;nbsp; What sort of results are you obtaining?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SteveDenham&lt;/P&gt;</description>
      <pubDate>Wed, 12 Aug 2020 12:29:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Model-specification-in-Proc-mixed-for-time-interval-dependent/m-p/676134#M32403</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2020-08-12T12:29:25Z</dc:date>
    </item>
    <item>
      <title>Re: Model specification in Proc mixed for  time interval dependent variable</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Model-specification-in-Proc-mixed-for-time-interval-dependent/m-p/676171#M32406</link>
      <description>&lt;P&gt;Hello &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15363"&gt;@SteveDenham&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Thank you for your quick reply.&amp;nbsp;&lt;/P&gt;&lt;P&gt;A patient can be followed-up over time between different hospitals with the same unique ID.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Regarding this statement: " Next, what about interactions between your independent variables?&amp;nbsp; Are you willing to assume that males on tttA have the same effect on interval as females on tttB?&amp;nbsp; If you can make that assumption, then the model statement looks OK. And last, how many unique patients are involved.&amp;nbsp; To have pat as a continuous effect, you will almost certainly need to sort your data by hospital and patient."&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN&gt;&amp;nbsp;I cannot assume&amp;nbsp;&lt;SPAN style="box-sizing: border-box; color: #333333; font-family: Arial,Helvetica,sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 300; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;that males on tttA have the same effect on interval as females on tttB&lt;/SPAN&gt;. I will test sex*treat interaction&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;&amp;nbsp;There are 455 distinct patients (350 on tttA and 105 on tttB)&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Yes my data are sorted by hospital and pat&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;&amp;nbsp;See below results with and without sex*treat interaction&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Interaction.PNG" style="width: 476px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/48159i65894ABDE7E90650/image-size/large?v=v2&amp;amp;px=999" role="button" title="Interaction.PNG" alt="Interaction.PNG" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="No interaction.PNG" style="width: 682px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/48160i3F9FBA5CF7979209/image-size/large?v=v2&amp;amp;px=999" role="button" title="No interaction.PNG" alt="No interaction.PNG" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;How to interpret the intercept ?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Regarding this statement: "&lt;SPAN style="box-sizing: border-box; color: #333333; font-family: Arial,Helvetica,sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 300; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;Next, I suspect that interval is not a variable with Gaussian error.&amp;nbsp; Intervals like this give rise to Poisson distributed counts, and are generally gamma distributed.&amp;nbsp; If that is the case, you will likely need to shift to PROC GLIMMIX. &lt;/SPAN&gt;"&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN&gt;Should I run the model using PROC GLMMIX with a gamma link and select the model with lower AIC?&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Aug 2020 14:06:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Model-specification-in-Proc-mixed-for-time-interval-dependent/m-p/676171#M32406</guid>
      <dc:creator>Ely</dc:creator>
      <dc:date>2020-08-12T14:06:08Z</dc:date>
    </item>
    <item>
      <title>Re: Model specification in Proc mixed for  time interval dependent variable</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Model-specification-in-Proc-mixed-for-time-interval-dependent/m-p/676202#M32408</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/190438"&gt;@Ely&lt;/a&gt;&amp;nbsp;, here are some thoughts:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How to treat the intercept?&amp;nbsp; Well, it is the expected value for age=0, male, tttB, offlabel and injnr=0.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is a case where the F tests and any lsmeans you have will be substantially more informative than the solution vector.&amp;nbsp; Because PROC MIXED uses a non-full rank parameterization, various categories are set to 0 in the solution.&amp;nbsp; So, look at the residual plots, F tests and LSMEANS using the AT= option.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Should I run the model using PROC GLIMMIX with a gamma link and select the model with lower AIC?&amp;nbsp; That would be a gamma distribution.&amp;nbsp; Your code would look something like:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;
/* Gamma distribution */
proc glimmix data=have method=laplace ;
class treat sex hospital;
model interval = age sex treat dose_ interval inj_nr / S dist=gamma chisq;
random int / subject=pat(hospital) type=UN G ;
run;

/* Gaussian distribution */
proc glimmix data=have method=laplace ;
class treat sex hospital;
model interval = age sex treat dose_ interval inj_nr / S dist=gaussian chisq;
random int / subject=pat(hospital) type=UN G ;
run;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Selecting the distribution with the smaller AIC ought to give you the distribution that retains the most information in the data.&amp;nbsp; Note that I have fit both using METHOD=LAPLACE, as the AIC wouldn't be calculated for the gamma distribution using the default pseudo-likelihood linearization.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Again, get some plots to give you an idea of how well the model fits.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;SteveDenham&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Aug 2020 15:29:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Model-specification-in-Proc-mixed-for-time-interval-dependent/m-p/676202#M32408</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2020-08-12T15:29:03Z</dc:date>
    </item>
    <item>
      <title>Re: Model specification in Proc mixed for  time interval dependent variable</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Model-specification-in-Proc-mixed-for-time-interval-dependent/m-p/683557#M32891</link>
      <description>Hello Steve,&lt;BR /&gt;Many thanks for your help. The gamma function fit the data beter.&lt;BR /&gt;Please how can I interpret the random effects? I have tried to interpret the covariance of the random intercept (when significant) but I am not sure if it is the best way.&lt;BR /&gt;Regards</description>
      <pubDate>Mon, 14 Sep 2020 04:33:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Model-specification-in-Proc-mixed-for-time-interval-dependent/m-p/683557#M32891</guid>
      <dc:creator>Ely</dc:creator>
      <dc:date>2020-09-14T04:33:48Z</dc:date>
    </item>
  </channel>
</rss>

