<?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: one-sided test for mean equal to 0 in proc lifereg in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/one-sided-test-for-mean-equal-to-0-in-proc-lifereg/m-p/739465#M35930</link>
    <description>&lt;P&gt;That looks like tval is not defined, which in turn says something about the variable names in the dataset lsmestimates. I pulled the variable names from a dataset created by a different PROC, which resulted in what was expected.&amp;nbsp; It may be that when LIFEREG creates the ODS dataset, either the mean or the standard error has a different variable name.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SteveDenham&lt;/P&gt;</description>
    <pubDate>Thu, 06 May 2021 12:35:10 GMT</pubDate>
    <dc:creator>SteveDenham</dc:creator>
    <dc:date>2021-05-06T12:35:10Z</dc:date>
    <item>
      <title>one-sided test for mean equal to 0 in proc lifereg</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/one-sided-test-for-mean-equal-to-0-in-proc-lifereg/m-p/739134#M35916</link>
      <description>&lt;P&gt;I know how to do one-sided t test for mean equal to 0 in proc ttest but I am using another procedure in which for some of the data one of two means is zero.&amp;nbsp; In these cases, I want to test using proc lifereg if the non-zero mean is equal to a specified value, such as zero.&amp;nbsp; The reason for using lifereg is left censoring of the data.&amp;nbsp; Any thoughts on how this can be done by modifying the estimate statement and maybe adding / testvalue=0; ?&amp;nbsp; Thank you, Brad&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p1"&gt;proc lifereg data&lt;SPAN class="s1"&gt;=three;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p2"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="s2"&gt;class&lt;/SPAN&gt; season;&lt;/P&gt;&lt;P class="p2"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="s2"&gt;model&lt;/SPAN&gt; (lnymiss, lnydl)=season / distribution = &lt;SPAN class="s2"&gt;normal&lt;/SPAN&gt;;&lt;/P&gt;&lt;P class="p2"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;estimate &lt;SPAN class="s3"&gt;'Fall mean - Spring ANOVA'&lt;/SPAN&gt; season &lt;SPAN class="s4"&gt;1&lt;/SPAN&gt; -&lt;SPAN class="s4"&gt;1&lt;/SPAN&gt;;&lt;/P&gt;&lt;P class="p2"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="s2"&gt;lsmeans&lt;/SPAN&gt; season;&lt;/P&gt;&lt;P class="p2"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 05 May 2021 04:17:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/one-sided-test-for-mean-equal-to-0-in-proc-lifereg/m-p/739134#M35916</guid>
      <dc:creator>didymo</dc:creator>
      <dc:date>2021-05-05T04:17:48Z</dc:date>
    </item>
    <item>
      <title>Re: one-sided test for mean equal to 0 in proc lifereg</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/one-sided-test-for-mean-equal-to-0-in-proc-lifereg/m-p/739210#M35917</link>
      <description>&lt;P&gt;You could use an LSMESTIMATE statement and some DATA step programming.&amp;nbsp; For instance, suppose you wanted to test if the mean for the Spring level of season is zero (as an example), you would write in LIFEREG:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;lsmestimate season 'One-tailed test of Spring &amp;gt;=0' 0 1;&lt;BR /&gt;ODS output&amp;nbsp;lsmestimates=lsmestimates;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The DATA step would use the CDF function to find the probability in the right hand tail of the t distribution.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data testlsmest;
set lsmestimates;
tval=estimate/stderr;
probrighttailrejected =  cdf('t',tval, df);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;SteveDenham&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 May 2021 13:39:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/one-sided-test-for-mean-equal-to-0-in-proc-lifereg/m-p/739210#M35917</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2021-05-05T13:39:23Z</dc:date>
    </item>
    <item>
      <title>Re: one-sided test for mean equal to 0 in proc lifereg</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/one-sided-test-for-mean-equal-to-0-in-proc-lifereg/m-p/739219#M35918</link>
      <description>Thank you! However, SAS did not provide the probrighttailrejected or df, just “.” In the output table.&lt;BR /&gt;&lt;BR /&gt;data testlsmest;&lt;BR /&gt;set lsmestimates;&lt;BR /&gt;tval=estimate/stderr;&lt;BR /&gt;probrighttailrejected = cdf('t',tval, df);&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 05 May 2021 14:06:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/one-sided-test-for-mean-equal-to-0-in-proc-lifereg/m-p/739219#M35918</guid>
      <dc:creator>didymo</dc:creator>
      <dc:date>2021-05-05T14:06:57Z</dc:date>
    </item>
    <item>
      <title>Re: one-sided test for mean equal to 0 in proc lifereg</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/one-sided-test-for-mean-equal-to-0-in-proc-lifereg/m-p/739222#M35919</link>
      <description>SteveDenham, Thanks. If I add "/ upper" to the lmestimate statement that should provide the one-tailed test, right?&lt;BR /&gt;&lt;BR /&gt;lsmestimate season 'One-tailed test of Spring &amp;gt;=0, when fall mean=0' 0 1 / upper;</description>
      <pubDate>Wed, 05 May 2021 14:24:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/one-sided-test-for-mean-equal-to-0-in-proc-lifereg/m-p/739222#M35919</guid>
      <dc:creator>didymo</dc:creator>
      <dc:date>2021-05-05T14:24:45Z</dc:date>
    </item>
    <item>
      <title>Re: one-sided test for mean equal to 0 in proc lifereg</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/one-sided-test-for-mean-equal-to-0-in-proc-lifereg/m-p/739461#M35929</link>
      <description>&lt;P&gt;That should do it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I should read the documentation before I recommend a work-around&lt;span class="lia-unicode-emoji" title=":face_with_rolling_eyes:"&gt;🙄&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SteveDenham&lt;/P&gt;</description>
      <pubDate>Thu, 06 May 2021 12:29:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/one-sided-test-for-mean-equal-to-0-in-proc-lifereg/m-p/739461#M35929</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2021-05-06T12:29:53Z</dc:date>
    </item>
    <item>
      <title>Re: one-sided test for mean equal to 0 in proc lifereg</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/one-sided-test-for-mean-equal-to-0-in-proc-lifereg/m-p/739465#M35930</link>
      <description>&lt;P&gt;That looks like tval is not defined, which in turn says something about the variable names in the dataset lsmestimates. I pulled the variable names from a dataset created by a different PROC, which resulted in what was expected.&amp;nbsp; It may be that when LIFEREG creates the ODS dataset, either the mean or the standard error has a different variable name.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SteveDenham&lt;/P&gt;</description>
      <pubDate>Thu, 06 May 2021 12:35:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/one-sided-test-for-mean-equal-to-0-in-proc-lifereg/m-p/739465#M35930</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2021-05-06T12:35:10Z</dc:date>
    </item>
    <item>
      <title>Re: one-sided test for mean equal to 0 in proc lifereg</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/one-sided-test-for-mean-equal-to-0-in-proc-lifereg/m-p/739466#M35931</link>
      <description>Thank you again!</description>
      <pubDate>Thu, 06 May 2021 12:41:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/one-sided-test-for-mean-equal-to-0-in-proc-lifereg/m-p/739466#M35931</guid>
      <dc:creator>didymo</dc:creator>
      <dc:date>2021-05-06T12:41:58Z</dc:date>
    </item>
  </channel>
</rss>

