<?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 Confidence limits in tabulate in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Confidence-limits-in-tabulate/m-p/204147#M50900</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I was asked to report the % of some event occurring and the 95% confidence interval about that %.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this sample, a flag variable 'replied' is 0 or 1, and represents wether or not some survey question was answered.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'replied' is used categorically as a CLASS variable in table so that an across percentage can be specified in the table statement.&lt;/P&gt;&lt;P&gt;'replied' can not be reused analytically as a VAR variable, so replied_CL is created to have a something to work with in tabulate.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My question is this... is there any statistical problems with computing a LCLM UCLM from a two-valued variable ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for listening.&lt;/P&gt;&lt;P&gt;Richard&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;do region = 'A', 'B';&lt;/P&gt;&lt;P&gt;&amp;nbsp; do year = 2005 to 2015;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; do _i = 1 to 100 + 50 *ranuni(123);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; id + 1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; replied = ranuni(123) &amp;lt; 0.15;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; replied_CL = 100 * replied;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; output;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;drop _:;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc format;&lt;/P&gt;&lt;P&gt;&amp;nbsp; value replied 0='No Reply' 1='Reply';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;options nocenter;&lt;/P&gt;&lt;P&gt;proc tabulate data=have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; class region year replied;&lt;/P&gt;&lt;P&gt;&amp;nbsp; var replied_CL;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; table &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; year&lt;/P&gt;&lt;P&gt;&amp;nbsp; , region &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; * (replied='' * (N pctn&amp;lt;replied&amp;gt;=' % of region')&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; replied_CL = '% of region Replied(*ESC*){newline}confidence interval' * ( LCLM='95% CI LB' UCLM='95% CI UB' )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;/P&gt;&lt;P&gt;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; format replied replied.;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;* i guess this is a more 'canonical' way to get CI;&lt;/P&gt;&lt;P&gt;proc freq;&lt;/P&gt;&lt;P&gt;&amp;nbsp; by region year;&lt;/P&gt;&lt;P&gt;&amp;nbsp; table replied / binomial;&lt;/P&gt;&lt;P&gt;&amp;nbsp; table replied_CL / binomial;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 21 Aug 2015 08:05:09 GMT</pubDate>
    <dc:creator>RichardDeVen</dc:creator>
    <dc:date>2015-08-21T08:05:09Z</dc:date>
    <item>
      <title>Confidence limits in tabulate</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Confidence-limits-in-tabulate/m-p/204147#M50900</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I was asked to report the % of some event occurring and the 95% confidence interval about that %.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this sample, a flag variable 'replied' is 0 or 1, and represents wether or not some survey question was answered.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'replied' is used categorically as a CLASS variable in table so that an across percentage can be specified in the table statement.&lt;/P&gt;&lt;P&gt;'replied' can not be reused analytically as a VAR variable, so replied_CL is created to have a something to work with in tabulate.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My question is this... is there any statistical problems with computing a LCLM UCLM from a two-valued variable ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for listening.&lt;/P&gt;&lt;P&gt;Richard&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;do region = 'A', 'B';&lt;/P&gt;&lt;P&gt;&amp;nbsp; do year = 2005 to 2015;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; do _i = 1 to 100 + 50 *ranuni(123);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; id + 1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; replied = ranuni(123) &amp;lt; 0.15;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; replied_CL = 100 * replied;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; output;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;drop _:;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc format;&lt;/P&gt;&lt;P&gt;&amp;nbsp; value replied 0='No Reply' 1='Reply';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;options nocenter;&lt;/P&gt;&lt;P&gt;proc tabulate data=have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; class region year replied;&lt;/P&gt;&lt;P&gt;&amp;nbsp; var replied_CL;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; table &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; year&lt;/P&gt;&lt;P&gt;&amp;nbsp; , region &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; * (replied='' * (N pctn&amp;lt;replied&amp;gt;=' % of region')&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; replied_CL = '% of region Replied(*ESC*){newline}confidence interval' * ( LCLM='95% CI LB' UCLM='95% CI UB' )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;/P&gt;&lt;P&gt;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; format replied replied.;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;* i guess this is a more 'canonical' way to get CI;&lt;/P&gt;&lt;P&gt;proc freq;&lt;/P&gt;&lt;P&gt;&amp;nbsp; by region year;&lt;/P&gt;&lt;P&gt;&amp;nbsp; table replied / binomial;&lt;/P&gt;&lt;P&gt;&amp;nbsp; table replied_CL / binomial;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Aug 2015 08:05:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Confidence-limits-in-tabulate/m-p/204147#M50900</guid>
      <dc:creator>RichardDeVen</dc:creator>
      <dc:date>2015-08-21T08:05:09Z</dc:date>
    </item>
    <item>
      <title>Re: Confidence limits in tabulate</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Confidence-limits-in-tabulate/m-p/204148#M50901</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I was surprised by you can use LCLM ,UCLM in proc tabulate , so I quickly check the documentation . Here is :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"Use both LCLM and UCLM to compute a two-sided confidence limit for the mean."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;According to documentation, LCLM ,UCLM is for T statistical estimator, in other words, it test the H0: mu=0 .&lt;/P&gt;&lt;P&gt;It is not the confidence limit you are talking about (univariate's binormial distribution ) . I think you should merge it back to your original dataset.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Aug 2015 12:00:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Confidence-limits-in-tabulate/m-p/204148#M50901</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2015-08-21T12:00:02Z</dc:date>
    </item>
    <item>
      <title>Re: Confidence limits in tabulate</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Confidence-limits-in-tabulate/m-p/204149#M50902</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Other concerns with any tabulate output involving confidence limits and a survey relates to weights and which divisor to use in calculations of variance / standard deviation. The VARDEF option on the Proc Tabulate statement indicates&amp;nbsp; which divisor to use.&lt;/P&gt;&lt;P&gt;Second is if your survey design involved any form of sampling other than a simple random sample then the weights aren't quite applied correctly and should use one of the Survey procedures to generate confidence limits.&lt;/P&gt;&lt;P&gt;And since you didn't include a weight statement at all your results cannot be applied to the population only the respondent pool unless your data is an actual census of the population of interest.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Aug 2015 15:35:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Confidence-limits-in-tabulate/m-p/204149#M50902</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-08-21T15:35:18Z</dc:date>
    </item>
  </channel>
</rss>

