<?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: Odd results of confidence intervals with proc surveymeans in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Odd-results-of-confidence-intervals-with-proc-surveymeans/m-p/427279#M22458</link>
    <description>Thank you. I can add some data on Monday.&lt;BR /&gt;&lt;BR /&gt;So far I haven't found any report procedures which give me the results from "data outlier" onwards. I am happy to receive any ideas on this.</description>
    <pubDate>Fri, 12 Jan 2018 17:06:42 GMT</pubDate>
    <dc:creator>MsGeritO</dc:creator>
    <dc:date>2018-01-12T17:06:42Z</dc:date>
    <item>
      <title>Odd results of confidence intervals with proc surveymeans</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Odd-results-of-confidence-intervals-with-proc-surveymeans/m-p/427146#M22437</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a small survey with stratified sampling and differing sampling ratios.&amp;nbsp;&lt;/P&gt;&lt;P&gt;total population is 1.600, sampling was 801 overall with rations from 0.25 to 1, non-respond was high with overall 200 respondents. (The joys of field work!!)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Nonetheless, I need to work with this data. I calculated growth rates of costs per employee&amp;nbsp;per respondent and I would like to identify outliers on 95% confidence interval with proc surveymeans. However, my results don't meet my expectations. Where am I going wrong? Code is below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for any pointers!&lt;/P&gt;&lt;P&gt;Gerit&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;* Calculating&lt;/P&gt;&lt;P&gt;&amp;nbsp; desweight =&amp;nbsp;&lt;SPAN&gt;total_population_per_strata /&amp;nbsp;sampling_per_strata&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; within dataset "ratepk"&lt;/P&gt;&lt;P&gt;_total_ =&amp;nbsp;&lt;SPAN&gt;total_population_per_strata&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;_rate_ = sampling_per_strata / _total_;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc surveymeans data=respondents clm alpha=0.05 t rate=ratepk;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;by year;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;var growth_cost_per_empl;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;weight desweight ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;strata finalstrata;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;ods output Statistics=outlier_with_t;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;data outlier; set outlier_with_t (drop t probt); run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc transpose data=outlier out = toutlier; by year; run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data lower (drop= _name_), set toutlier (rename=(col1=ratelower));&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;if _name_ = "LowerCLMean";&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;data upper&amp;nbsp;(drop= _name_), set toutlier (rename=(col1=rateupper));&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;if _name_ = "UpperCLMean";&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data confidenceintervals; merge upper lower; by year; run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data respondents; merge respondents confidenceintervals;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;by year;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;dummy = 0;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;if ratelower &amp;lt;&amp;nbsp;&lt;SPAN&gt;growth_cost_per_empl and&amp;nbsp;growth_cost_per_empl &amp;lt;&amp;nbsp;&lt;/SPAN&gt;rateupper then dummy = 1;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sort data=respondents;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;by year dummy;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data test; set respondents;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;by year dummy;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;retain testvariable;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;if first.dummy then testvariable = 0;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;testvariable + desweight;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;if last.dummy;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; keep year dummy testvariable;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;* And here I would expect that the sum of weights roughly 95% with dummy = 1 and roughly 5 % with dummy = 0;&lt;/P&gt;&lt;P&gt;* However, I have around 20 - 30 % with dummy = 1;&lt;/P&gt;&lt;P&gt;* graphically speaking it looks similar:;&lt;/P&gt;&lt;P&gt;ods graphics on;&lt;/P&gt;&lt;P&gt;proc ag-lot data= respondents;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;bubble x=year, y=&lt;SPAN&gt;growth_cost_per_empl size = desweight;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;series x=year y= ratelower;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;series x=year y= rateupper;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;run;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jan 2018 10:16:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Odd-results-of-confidence-intervals-with-proc-surveymeans/m-p/427146#M22437</guid>
      <dc:creator>MsGeritO</dc:creator>
      <dc:date>2018-01-12T10:16:32Z</dc:date>
    </item>
    <item>
      <title>Re: Odd results of confidence intervals with proc surveymeans</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Odd-results-of-confidence-intervals-with-proc-surveymeans/m-p/427243#M22452</link>
      <description>&lt;P&gt;Without data we really can't tell what you may be "doing wrong".&lt;/P&gt;
&lt;P&gt;When you say "However, my results don't meet my expectations". it would help to show 1) the results that don't match your expectations and 2) what your expectations were.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With such a high rate of non-response I might suggest looking at your approach to weights. You have what appears to be a design weight but you may need to adjust that for actual responses per stratum.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If everything from the data outlier step onwards is just to get a table to look at then you need to learn how to use some of the report procedures.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jan 2018 16:15:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Odd-results-of-confidence-intervals-with-proc-surveymeans/m-p/427243#M22452</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-01-12T16:15:59Z</dc:date>
    </item>
    <item>
      <title>Re: Odd results of confidence intervals with proc surveymeans</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Odd-results-of-confidence-intervals-with-proc-surveymeans/m-p/427279#M22458</link>
      <description>Thank you. I can add some data on Monday.&lt;BR /&gt;&lt;BR /&gt;So far I haven't found any report procedures which give me the results from "data outlier" onwards. I am happy to receive any ideas on this.</description>
      <pubDate>Fri, 12 Jan 2018 17:06:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Odd-results-of-confidence-intervals-with-proc-surveymeans/m-p/427279#M22458</guid>
      <dc:creator>MsGeritO</dc:creator>
      <dc:date>2018-01-12T17:06:42Z</dc:date>
    </item>
    <item>
      <title>Re: Odd results of confidence intervals with proc surveymeans</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Odd-results-of-confidence-intervals-with-proc-surveymeans/m-p/427403#M22468</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/150610"&gt;@MsGeritO&lt;/a&gt; wrote:&lt;BR /&gt;Thank you. I can add some data on Monday.&lt;BR /&gt;&lt;BR /&gt;So far I haven't found any report procedures which give me the results from "data outlier" onwards. I am happy to receive any ideas on this.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Are you trying to identify the specific records that have outlier values for a specific response?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You may also want to request plots for the response variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 13 Jan 2018 00:36:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Odd-results-of-confidence-intervals-with-proc-surveymeans/m-p/427403#M22468</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-01-13T00:36:39Z</dc:date>
    </item>
  </channel>
</rss>

