<?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 Problems writing an ESTIMATE statement in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Problems-writing-an-ESTIMATE-statement/m-p/33904#M8218</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; For the continuous variable dropoutofschool, you need to provide some value at which you wish to estimate the function.&amp;nbsp; A good starting point would be to add &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;lsmeans dropoutofschool*year2 move*year2 dropoutofschool*move*year2/e;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The 'e' option will print the L matrix associated with each of the least squares means, including the slope coefficient for dropoutofschool.&amp;nbsp; From this, the estimates can be correctly constructed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck.&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, 19 Mar 2012 11:56:21 GMT</pubDate>
    <dc:creator>SteveDenham</dc:creator>
    <dc:date>2012-03-19T11:56:21Z</dc:date>
    <item>
      <title>Problems writing an ESTIMATE statement</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Problems-writing-an-ESTIMATE-statement/m-p/33903#M8217</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm using PROC SURVEYREG and am trying to figure out how to write an ESTIMATE statement to set up a hypothesis test that beta7+beta8+beta9 = 0.&amp;nbsp; Beta7 is the term DROPOUTOFSCHOOL*YEAR2 (continous by dichotomous), Beta8 is MOVE*YEAR2 (dichotomous by dichotomous), Beta9 is DROPOUTOFSCHOOL*MOVE*YEAR2 (continuous by dichotomous by dichotomous).&amp;nbsp; [The full code is at the bottom of this post].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've been able to write an ESTIMATE statement for a bunch of hypothesis tests that are close to what I want (note here BETA1 is the coefficient for the term YEAR2, if you're curious).&amp;nbsp; &lt;/P&gt;&lt;P&gt;/*This is B7+B9*/&lt;/P&gt;&lt;P&gt;estimate 'Beta7+Beta9' dropoutofschool*year2 1 -1 dropoutofschool*move*year2 1 -1 0 0&amp;nbsp; /e;&lt;/P&gt;&lt;P&gt;estimate 'Beta1+Beta8' year2 1 -1 move*year2 1 -1 0 0 /e;&lt;/P&gt;&lt;P&gt;estimate 'Beta1+Beta7+Beta8+Beta9' dropoutofschool*year2 1 -1 dropoutofschool*move*year2 1 -1 0 0 year2 1 -1 move*year2 1 -1 0 0 /e;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would think the estimate statement for the hypothesis that beta7+beta8+beta9 = 0 would look like this:&lt;/P&gt;&lt;P&gt;estimate 'Beta7+Beta8+Beta9' dropoutofschool*year2 1 -1 dropoutofschool*move*year2 1 -1 0 0 move*year2 1 -1 0 0 /e;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;...but SAS says this is not estimable.&amp;nbsp; What am I doing wrong here?&amp;nbsp; Thanks - I've spent the better part of half a day on this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc surveyreg data = asthmatics_1619;&lt;/P&gt;&lt;P&gt;weight longwt;&lt;/P&gt;&lt;P&gt;strata varstr;&lt;/P&gt;&lt;P&gt;cluster varpsu;&lt;/P&gt;&lt;P&gt;class move year2 sex race regiony1 msay1 panel;&lt;/P&gt;&lt;P&gt;model haveusc = dropoutofschool lossofinsurance move year2 dropoutofschool * move&lt;/P&gt;&lt;P&gt;lossofinsurance * year2 dropoutofschool * year2 move * year2 dropoutofschool * move * year2&lt;/P&gt;&lt;P&gt;agebeginning_years sex race regiony1 msay1 panel /solution;&lt;/P&gt;&lt;P&gt;format move movefmt. year2 yearfmt. sex sex. race racethnx. regiony1 regin08f. msay1 msa08f.; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;estimate 'Beta7+Beta8+Beta9' dropoutofschool*year2 1 -1 dropoutofschool*move*year2 1 -1 0 0 move*year2 1 -1 0 0 /e;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Mar 2012 13:53:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Problems-writing-an-ESTIMATE-statement/m-p/33903#M8217</guid>
      <dc:creator>chuakp</dc:creator>
      <dc:date>2012-03-16T13:53:54Z</dc:date>
    </item>
    <item>
      <title>Problems writing an ESTIMATE statement</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Problems-writing-an-ESTIMATE-statement/m-p/33904#M8218</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; For the continuous variable dropoutofschool, you need to provide some value at which you wish to estimate the function.&amp;nbsp; A good starting point would be to add &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;lsmeans dropoutofschool*year2 move*year2 dropoutofschool*move*year2/e;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The 'e' option will print the L matrix associated with each of the least squares means, including the slope coefficient for dropoutofschool.&amp;nbsp; From this, the estimates can be correctly constructed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck.&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, 19 Mar 2012 11:56:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Problems-writing-an-ESTIMATE-statement/m-p/33904#M8218</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2012-03-19T11:56:21Z</dc:date>
    </item>
    <item>
      <title>Problems writing an ESTIMATE statement</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Problems-writing-an-ESTIMATE-statement/m-p/33905#M8219</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, Steve.&amp;nbsp; Unfortunately, lsmeans is not supported by SURVEYREG in my version of SAS (9.2).&amp;nbsp; I believe I want to evaluate the effect of dropoutofschool at the value of 1.&amp;nbsp; What would be the syntax for this?&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Mar 2012 14:36:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Problems-writing-an-ESTIMATE-statement/m-p/33905#M8219</guid>
      <dc:creator>chuakp</dc:creator>
      <dc:date>2012-03-19T14:36:33Z</dc:date>
    </item>
    <item>
      <title>Problems writing an ESTIMATE statement</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Problems-writing-an-ESTIMATE-statement/m-p/33906#M8220</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; I'm horrible at this--that's why I always use the /e terminology to write estimates.&amp;nbsp; I would also take a look at SAS System for Mixed Models by Littell et al. in the section on analysis of covariance.&amp;nbsp; George Milliken has a TON of examples using ESTIMATE statements in there.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here would be my workaround--shift to PROC GLM or MIXED, which do support the LSMeans statement, and use the /e option there.&amp;nbsp; From those L matrix printouts, work out the code for the estimates, then drop those back into SURVEYREG.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, my version of 9.2 (9.22 for the documentation, 9.2 (TS2M3)) does support LSMEANS.&amp;nbsp; This is a simple upgrade/hotfix and may be well worth your time.&amp;nbsp; Besides the LSMEANS statement, you will have access to the LSMESTIMATE statement, which may be of use in this project.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck.&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>Tue, 20 Mar 2012 11:22:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Problems-writing-an-ESTIMATE-statement/m-p/33906#M8220</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2012-03-20T11:22:38Z</dc:date>
    </item>
  </channel>
</rss>

