<?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: LSmeans multiple control levels in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/LSmeans-multiple-control-levels/m-p/202289#M50503</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I was able to get the error, and I came up with a solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First, the levels in the quotes have to be the formatted values in the dataset.&amp;nbsp; For instance, in my test case, when I had control('1' '1') it failed, as my levels for a were 'Female' and 'Male', so control('Female' '1') works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Second, when multiple factors are present, the separate parts have to be separated by a comma:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This works for me:&lt;/P&gt;&lt;P&gt;lsmeans sex*group group*week/diff=control('Female' '1' , '1' '1');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This does not:&lt;/P&gt;&lt;P&gt;lsmeans sex*group group*week/diff=control('Female' '1'&amp;nbsp; '1' '1');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That comma does not appear in the documentation, and is clearly needed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Steve Denham&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 27 Apr 2015 18:24:09 GMT</pubDate>
    <dc:creator>SteveDenham</dc:creator>
    <dc:date>2015-04-27T18:24:09Z</dc:date>
    <item>
      <title>LSmeans multiple control levels</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/LSmeans-multiple-control-levels/m-p/202286#M50500</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok. This might be a ridiculously stupid question easily solved by experienced users.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SAS PROC mixed documentation states the following. &lt;/P&gt;&lt;P&gt;&lt;IMG alt="Picture1.png" class="jive-image-thumbnail jive-image" src="https://communities.sas.com/legacyfs/online/10139_Picture1.png" width="450" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the life of me I can't seem to get that statement to work in proc mixed. My variables have a similar lay-out. I am able to specify only A*B and the appropriate controls in the LSmeans statement (without B*C in there). When I add the B*C and specify control levels as in the SAS documentation, I get the error "Wrong number of control levels for A*B" and &lt;SPAN style="font-size: 13.3333330154419px;"&gt;"Wrong number of control levels for B*C". Am I missing something???&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Apr 2015 13:06:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/LSmeans-multiple-control-levels/m-p/202286#M50500</guid>
      <dc:creator>DDK</dc:creator>
      <dc:date>2015-04-23T13:06:52Z</dc:date>
    </item>
    <item>
      <title>Re: LSmeans multiple control levels</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/LSmeans-multiple-control-levels/m-p/202287#M50501</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you share your PROC MIXED code?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This does make a really good case for the use of the LSMESTIMATE statement, though...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Steve Denham&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Apr 2015 17:14:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/LSmeans-multiple-control-levels/m-p/202287#M50501</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2015-04-24T17:14:30Z</dc:date>
    </item>
    <item>
      <title>Re: LSmeans multiple control levels</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/LSmeans-multiple-control-levels/m-p/202288#M50502</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello SteveDenham,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code is really simplified because I wanted to try it out:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc mixed data=test.testdata;&lt;/P&gt;&lt;P&gt;class a b c;&lt;/P&gt;&lt;P&gt;model y = a b c a*b a*c;&lt;/P&gt;&lt;P&gt;lsmeans a b / pdiff=control('1' '1');&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;The same problem occurs with the lsmeans statement:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;lsmeans a*b&amp;nbsp; b*c/ pdiff=control('1' '1' '1' '1');&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;I get output from (each separately):&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;lsmeans a*b / pdiff=control('1' '1');&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;or&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;lsmeans a / pdiff=control('1');&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;or&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;lsmeans b*c / pdiff=control('1' '1');&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;or&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;lsmeans b / pdiff=control('1');&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;Once I try to add a factor in the same line as SAS suggests (i.e. &lt;SPAN style="font-size: 13.3333330154419px;"&gt;lsmeans a*b&amp;nbsp; b*c/ pdiff=control('1' '1' '1' '1');) &lt;/SPAN&gt;, it doesn't work.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;If I use :&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;lsmeans a*b&amp;nbsp; b*c/ pdiff=control('1' '1');&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;or&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;lsmeans a b / pdiff=control('1');&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;I only get output for a*b or a but not for b*c or b.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;It's not a major problem as I of course can specify it separately, but as SAS indicates it is a possibility I wondered why it is not working for me.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Apr 2015 12:09:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/LSmeans-multiple-control-levels/m-p/202288#M50502</guid>
      <dc:creator>DDK</dc:creator>
      <dc:date>2015-04-27T12:09:20Z</dc:date>
    </item>
    <item>
      <title>Re: LSmeans multiple control levels</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/LSmeans-multiple-control-levels/m-p/202289#M50503</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I was able to get the error, and I came up with a solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First, the levels in the quotes have to be the formatted values in the dataset.&amp;nbsp; For instance, in my test case, when I had control('1' '1') it failed, as my levels for a were 'Female' and 'Male', so control('Female' '1') works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Second, when multiple factors are present, the separate parts have to be separated by a comma:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This works for me:&lt;/P&gt;&lt;P&gt;lsmeans sex*group group*week/diff=control('Female' '1' , '1' '1');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This does not:&lt;/P&gt;&lt;P&gt;lsmeans sex*group group*week/diff=control('Female' '1'&amp;nbsp; '1' '1');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That comma does not appear in the documentation, and is clearly needed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Steve Denham&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Apr 2015 18:24:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/LSmeans-multiple-control-levels/m-p/202289#M50503</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2015-04-27T18:24:09Z</dc:date>
    </item>
    <item>
      <title>Re: LSmeans multiple control levels</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/LSmeans-multiple-control-levels/m-p/202290#M50504</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Aha! Thanks Steve!!!! With the comma in there I now can get it to work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Apr 2015 06:38:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/LSmeans-multiple-control-levels/m-p/202290#M50504</guid>
      <dc:creator>DDK</dc:creator>
      <dc:date>2015-04-28T06:38:40Z</dc:date>
    </item>
  </channel>
</rss>

