<?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 Mixed modelling, help with correct procedure and code in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Mixed-modelling-help-with-correct-procedure-and-code/m-p/480106#M24964</link>
    <description>&lt;P&gt;I would appreciate&amp;nbsp;help with how&amp;nbsp;to code the following experiment. I'm using SAS 9.3.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The experiment used blood from six donors.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The blood from each donor&amp;nbsp;was divided into four culture wells, and each well incubated&amp;nbsp;with&amp;nbsp;one of a&amp;nbsp;combination of&amp;nbsp;two drugs (A and B),&amp;nbsp;each drug either&amp;nbsp;absent (i.e., diluent only; coded 0) or present at a predetermined concentration (coded 1). Only blood from one donor can be run at a given time.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've approached this treatment phase as the full factorial of two drugs (A|B) but could see doing it as one treatment factor (trt) with&amp;nbsp;four levels (trt0=A0B0, trt1=A1B0, trt2=A0B1, trt3=A1B1). Is there an advantage of one versus the other?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The activation state (%activated)&amp;nbsp;of two types of T-lymphocyte&amp;nbsp;(T-type = CD4&amp;nbsp;or CD8) is determined from each well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The main interest is the effect of the treatment conditions on %activation within each T-cell type (all comparisons). It is of secondary interest to know if the treatment effects differ between the two types of T-cell.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is&amp;nbsp;MIXED or GLIMMIX&amp;nbsp;more appropriate?&lt;/P&gt;
&lt;P&gt;Does&amp;nbsp;subject=donor or T-type(donor) or should it be subject=donor and group=T-type?&lt;/P&gt;
&lt;P&gt;Should T-type be in the model statement?&lt;/P&gt;
&lt;P&gt;Donor is random but what about T-type? Should T-type be in the model statement?&lt;/P&gt;
&lt;P&gt;Do I need to have a repeated statement?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is something that works but I fear is far too simplistic:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc glimmix data=work.CD4CD8 ;
	class donor T_type A B ;
	model activation = T_type|A|B ;
	random _residual_ / subject=donor group=T_type ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any advice or direction greatly appreciated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Dave&lt;/P&gt;</description>
    <pubDate>Sat, 21 Jul 2018 00:39:54 GMT</pubDate>
    <dc:creator>das</dc:creator>
    <dc:date>2018-07-21T00:39:54Z</dc:date>
    <item>
      <title>Mixed modelling, help with correct procedure and code</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Mixed-modelling-help-with-correct-procedure-and-code/m-p/480106#M24964</link>
      <description>&lt;P&gt;I would appreciate&amp;nbsp;help with how&amp;nbsp;to code the following experiment. I'm using SAS 9.3.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The experiment used blood from six donors.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The blood from each donor&amp;nbsp;was divided into four culture wells, and each well incubated&amp;nbsp;with&amp;nbsp;one of a&amp;nbsp;combination of&amp;nbsp;two drugs (A and B),&amp;nbsp;each drug either&amp;nbsp;absent (i.e., diluent only; coded 0) or present at a predetermined concentration (coded 1). Only blood from one donor can be run at a given time.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've approached this treatment phase as the full factorial of two drugs (A|B) but could see doing it as one treatment factor (trt) with&amp;nbsp;four levels (trt0=A0B0, trt1=A1B0, trt2=A0B1, trt3=A1B1). Is there an advantage of one versus the other?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The activation state (%activated)&amp;nbsp;of two types of T-lymphocyte&amp;nbsp;(T-type = CD4&amp;nbsp;or CD8) is determined from each well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The main interest is the effect of the treatment conditions on %activation within each T-cell type (all comparisons). It is of secondary interest to know if the treatment effects differ between the two types of T-cell.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is&amp;nbsp;MIXED or GLIMMIX&amp;nbsp;more appropriate?&lt;/P&gt;
&lt;P&gt;Does&amp;nbsp;subject=donor or T-type(donor) or should it be subject=donor and group=T-type?&lt;/P&gt;
&lt;P&gt;Should T-type be in the model statement?&lt;/P&gt;
&lt;P&gt;Donor is random but what about T-type? Should T-type be in the model statement?&lt;/P&gt;
&lt;P&gt;Do I need to have a repeated statement?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is something that works but I fear is far too simplistic:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc glimmix data=work.CD4CD8 ;
	class donor T_type A B ;
	model activation = T_type|A|B ;
	random _residual_ / subject=donor group=T_type ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any advice or direction greatly appreciated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Dave&lt;/P&gt;</description>
      <pubDate>Sat, 21 Jul 2018 00:39:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Mixed-modelling-help-with-correct-procedure-and-code/m-p/480106#M24964</guid>
      <dc:creator>das</dc:creator>
      <dc:date>2018-07-21T00:39:54Z</dc:date>
    </item>
    <item>
      <title>Re: Mixed modelling, help with correct procedure and code</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Mixed-modelling-help-with-correct-procedure-and-code/m-p/480148#M24965</link>
      <description>&lt;P&gt;GLIMMIX vs. MIXED - Since the dependent variable is a percentage (and presumably bound by 0 and 100) a linear multilevel model may not be right.&amp;nbsp; You might try changing the % to a proportion and using a BETA distribution (DIST = BETA on the MODEL statement).&lt;/P&gt;</description>
      <pubDate>Sat, 21 Jul 2018 13:37:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Mixed-modelling-help-with-correct-procedure-and-code/m-p/480148#M24965</guid>
      <dc:creator>plf515</dc:creator>
      <dc:date>2018-07-21T13:37:17Z</dc:date>
    </item>
    <item>
      <title>Re: Mixed modelling, help with correct procedure and code</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Mixed-modelling-help-with-correct-procedure-and-code/m-p/480166#M24966</link>
      <description>Thank you. I wondered about that. Yes, in this case this is bounded, values can only be 0 to 100. I'll see how this affects the modeling but it seems correct regardless.</description>
      <pubDate>Sat, 21 Jul 2018 17:30:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Mixed-modelling-help-with-correct-procedure-and-code/m-p/480166#M24966</guid>
      <dc:creator>das</dc:creator>
      <dc:date>2018-07-21T17:30:30Z</dc:date>
    </item>
    <item>
      <title>Re: Mixed modelling, help with correct procedure and code</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Mixed-modelling-help-with-correct-procedure-and-code/m-p/480696#M25013</link>
      <description>&lt;P&gt;The design is definitely a mixed model. The MIXED procedure assumes that the response is normally distributed (conditional on the predictors); GLIMMIX allows other distributional assumptions, among them normal, beta and binomial.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Generally speaking, but there are always exceptions, a percent (or proportion) response uses either a beta or a binomial distribution, so GLIMMIX is typically more appropriate than MIXED. A proportion that is obtained as a ratio of counts (e.g., number of "successes" out of number of "trials") calls for a binomial distribution; a proportion measured directly calls for a beta distribution, as noted by&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15128"&gt;@plf515&lt;/a&gt;.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I have a two-way (here, 2x2) factorial, I usually specify the model as A x B rather than a single factor with 4 levels. But the statistical model is the same either way; it's just a different parameterization, and one form may deliver what you want more directly than the other. You get to choose.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would consider the following model AS A STARTING POINT (for a beta distribution; syntax would differ for binomial):&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 glimmix data= work.cd4cd8 ;
  class donor a b t_type;
  model activation = a | b | t_type / dist=beta;
  random intercept a*b / subject=donor;
  lsmeans a | b | t_type / ilink;
  run;&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Keep in mind that there are a lot of options that might be better than the default options implied in the code above. Default options are not always the best choice for generalized linear mixed models.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You may want to start with a normal distribution assumption within GLIMMIX before attempting more challenging models, even though a normal distribution is probably not a valid choice. It's good to get your feet under you with &lt;EM&gt;general&lt;/EM&gt; linear mixed models before you dive into &lt;EM&gt;generalized&lt;/EM&gt; linear mixed models.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope this helps.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jul 2018 02:59:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Mixed-modelling-help-with-correct-procedure-and-code/m-p/480696#M25013</guid>
      <dc:creator>sld</dc:creator>
      <dc:date>2018-07-24T02:59:53Z</dc:date>
    </item>
    <item>
      <title>Re: Mixed modelling, help with correct procedure and code</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Mixed-modelling-help-with-correct-procedure-and-code/m-p/480697#M25014</link>
      <description>Thanks for all the description. That really helps me learn. I tried the beta distribution today and that definitely improved the fit stats. But your explanation makes me wonder if binomial is the correct distribution since it is the fraction of a population of cells identified as activated by flow cytometry. I'll try that tomorrow and post some code. Thanks for the reply!</description>
      <pubDate>Tue, 24 Jul 2018 03:11:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Mixed-modelling-help-with-correct-procedure-and-code/m-p/480697#M25014</guid>
      <dc:creator>das</dc:creator>
      <dc:date>2018-07-24T03:11:32Z</dc:date>
    </item>
    <item>
      <title>Re: Mixed modelling, help with correct procedure and code</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Mixed-modelling-help-with-correct-procedure-and-code/m-p/480701#M25016</link>
      <description>&lt;P&gt;Some "more friendly" (i.e., less mathematical) introductions into distributional choices:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For the beta distribution,&amp;nbsp;&lt;A href="https://www.ncbi.nlm.nih.gov/pubmed/16594767" target="_self"&gt;A better lemon squeezer? Maximum-likelihood regression with beta-distributed dependent variables&lt;/A&gt;.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For binomial, etc.,&amp;nbsp;&lt;A href="https://esajournals.onlinelibrary.wiley.com/doi/10.1890/10-0340.1" target="_self"&gt;The arcsine is asinine: the analysis of proportions in ecology&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Looking forward to seeing what you find out....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jul 2018 03:27:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Mixed-modelling-help-with-correct-procedure-and-code/m-p/480701#M25016</guid>
      <dc:creator>sld</dc:creator>
      <dc:date>2018-07-24T03:27:36Z</dc:date>
    </item>
    <item>
      <title>Re: Mixed modelling, help with correct procedure and code</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Mixed-modelling-help-with-correct-procedure-and-code/m-p/482649#M25077</link>
      <description>&lt;P&gt;So this is the solution I finally settled on.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc glimmix data=work.CD4CD8 asycov plots=all;
	class donor T_type A B ;
	model activated = T_type|A|B / dist=binomial DDFM=KENWARDROGER ;
	random _residual_ / subject=T_type(donor) type=un ;
	lsmeans T_type*A*B / ilink slicediff=T_type adjust=tukey  ADJDFE=ROW plots=meanplot(ilink join cl sliceby=T_type) ;
	output out=gmxout pred(blup ilink)=pred;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The output indicates very good fit. I really appreciate the input from this community.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Dave&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jul 2018 23:40:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Mixed-modelling-help-with-correct-procedure-and-code/m-p/482649#M25077</guid>
      <dc:creator>das</dc:creator>
      <dc:date>2018-07-30T23:40:13Z</dc:date>
    </item>
    <item>
      <title>Re: Mixed modelling, help with correct procedure and code</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Mixed-modelling-help-with-correct-procedure-and-code/m-p/482695#M25079</link>
      <description>&lt;P&gt;I'm glad you found the Community to be helpful.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Before we drop this topic, I want to follow up because I'm not sure that I am entirely happy with your model.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(1) The response variable is &lt;EM&gt;activated&amp;nbsp;&lt;/EM&gt;and the distribution is &lt;EM&gt;binomial&lt;/EM&gt;. Does &lt;EM&gt;activated&lt;/EM&gt; take values of 0 or 1, or is it a proportion?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(2) An important distinction between the normal distribution and distributions available in generalized linear (mixed) model procedures is that the variance is a function of the mean for these&amp;nbsp;non-normal distributions. Consequently, although there are &lt;EM&gt;residuals&lt;/EM&gt;, there is no such thing as &lt;EM&gt;residual variance&lt;/EM&gt;&amp;nbsp;because once the mean is estimated, the variance is also known.&lt;EM&gt;&amp;nbsp;&lt;/EM&gt;And consequently then, I do not think I would use&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;	random _residual_ / subject=T_type(donor) type=un ;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;at least, not without a lot of thought about what it is doing and whether it is valid.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jul 2018 04:29:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Mixed-modelling-help-with-correct-procedure-and-code/m-p/482695#M25079</guid>
      <dc:creator>sld</dc:creator>
      <dc:date>2018-07-31T04:29:37Z</dc:date>
    </item>
    <item>
      <title>Re: Mixed modelling, help with correct procedure and code</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Mixed-modelling-help-with-correct-procedure-and-code/m-p/482698#M25080</link>
      <description>&lt;P&gt;The response is a proportion varying between 0 and 1. The fit stat Gen. Chi-Square / DF = 1.00.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Dave&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jul 2018 04:43:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Mixed-modelling-help-with-correct-procedure-and-code/m-p/482698#M25080</guid>
      <dc:creator>das</dc:creator>
      <dc:date>2018-07-31T04:43:31Z</dc:date>
    </item>
    <item>
      <title>Re: Mixed modelling, help with correct procedure and code</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Mixed-modelling-help-with-correct-procedure-and-code/m-p/482701#M25082</link>
      <description>&lt;P&gt;If the response is a proportion, then I probably would use the beta distribution rather than the binomial.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The binomial distribution theoretically is appropriate either for binary (Bernoulli) data (taking values of 0 or 1) or for responses specified as "number of successes" out of "number of trials" using the syntax&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="aa-statement"&gt;MODEL&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="aa-statementoptional"&gt;events/trials&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=" aa-keyword"&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&amp;lt;fixed-effects&amp;gt; &amp;lt;/ model-options&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;where "events" is&amp;nbsp;number_of_activated cells and "trials" is&amp;nbsp;total_number_of_cells.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jul 2018 04:57:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Mixed-modelling-help-with-correct-procedure-and-code/m-p/482701#M25082</guid>
      <dc:creator>sld</dc:creator>
      <dc:date>2018-07-31T04:57:55Z</dc:date>
    </item>
  </channel>
</rss>

