<?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 Construct a jackknife sample based on groups (leave kth-group) in SAS/IML Software and Matrix Computations</title>
    <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Construct-a-jackknife-sample-based-on-groups-leave-kth-group/m-p/476538#M4273</link>
    <description>&lt;P&gt;I have data with some categorical variables with missing values in them. I need variance estimates of the data based on leave i-th observation out within each group inside a categorical variable. (So in the end, I would have the number of estimates same as the&amp;nbsp;number of observations in each group and k variance estimates for k groups in a categorical variable).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is using ROC SURVEYFREQ with strata statement&amp;nbsp;and VARMETHOD=JACKKNIFE specification a correct way to do this? Or do I need to make a loop like this: &lt;A href="https://blogs.sas.com/content/iml/2017/06/21/jackknife-estimate-standard-error-sas.html" target="_blank"&gt;https://blogs.sas.com/content/iml/2017/06/21/jackknife-estimate-standard-error-sas.html&lt;/A&gt; ?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, if I need to make a loop like that for k groups, how do we construct proc iml&amp;nbsp;codes?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance! I would greatly appreciate any help.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 09 Jul 2018 19:17:41 GMT</pubDate>
    <dc:creator>gsk</dc:creator>
    <dc:date>2018-07-09T19:17:41Z</dc:date>
    <item>
      <title>Construct a jackknife sample based on groups (leave kth-group)</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Construct-a-jackknife-sample-based-on-groups-leave-kth-group/m-p/476538#M4273</link>
      <description>&lt;P&gt;I have data with some categorical variables with missing values in them. I need variance estimates of the data based on leave i-th observation out within each group inside a categorical variable. (So in the end, I would have the number of estimates same as the&amp;nbsp;number of observations in each group and k variance estimates for k groups in a categorical variable).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is using ROC SURVEYFREQ with strata statement&amp;nbsp;and VARMETHOD=JACKKNIFE specification a correct way to do this? Or do I need to make a loop like this: &lt;A href="https://blogs.sas.com/content/iml/2017/06/21/jackknife-estimate-standard-error-sas.html" target="_blank"&gt;https://blogs.sas.com/content/iml/2017/06/21/jackknife-estimate-standard-error-sas.html&lt;/A&gt; ?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, if I need to make a loop like that for k groups, how do we construct proc iml&amp;nbsp;codes?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance! I would greatly appreciate any help.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Jul 2018 19:17:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Construct-a-jackknife-sample-based-on-groups-leave-kth-group/m-p/476538#M4273</guid>
      <dc:creator>gsk</dc:creator>
      <dc:date>2018-07-09T19:17:41Z</dc:date>
    </item>
    <item>
      <title>Re: Construct a jackknife sample based on groups (leave kth-group)</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Construct-a-jackknife-sample-based-on-groups-leave-kth-group/m-p/476555#M4274</link>
      <description>&lt;P&gt;I'm confused. Do you have a reference for what you are trying to do? Or can you provide data and explain what you are attempting?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SURVEYFREQ is used to estimate proportions. For example, you can use PROC SURVEYFREQ to estimate that your population is 40% white, 40% black, 10% Hispanic, and 10% Asian, and to get standard errors for those estimates. Is that what you want?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Usually,&amp;nbsp;"jackknife" refers to estimates that leave out one observation. However, you seem to imply that you want to leave out an entire level of a categorical variable such as dropping the "Hispanic" level for a RACE variable. I am&amp;nbsp;not familiar with that method. There are cross-validation techniques that leave out a portion of the data, but that&amp;nbsp;is a different method than the jackknife.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Jul 2018 18:25:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Construct-a-jackknife-sample-based-on-groups-leave-kth-group/m-p/476555#M4274</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2018-07-09T18:25:22Z</dc:date>
    </item>
    <item>
      <title>Re: Construct a jackknife sample based on groups (leave kth-group)</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Construct-a-jackknife-sample-based-on-groups-leave-kth-group/m-p/476562#M4275</link>
      <description>&lt;P class="aaresumebody"&gt;-Edited reply-&lt;/P&gt;&lt;P class="aaresumebody"&gt;&lt;SPAN&gt;Data would consist of 50 observations from each group. Then,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;I would like to calculate a statistic of the observations within each group while excluding one observation from the group at a time.&amp;nbsp;Then, in the end, I would be able to calculate a&amp;nbsp;variance estimate&amp;nbsp;for each group.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="aaresumebody"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="aaresumebody"&gt;&lt;SPAN&gt;Hm, I see.. Then I don't think I should use SURVEYFREQ. Sorry, I can't provide data but I think any data should work.&amp;nbsp;I think I should use codes like &lt;A href="https://blogs.sas.com/content/iml/2017/06/21/jackknife-estimate-standard-error-sas.html" target="_blank"&gt;https://blogs.sas.com/content/iml/2017/06/21/jackknife-estimate-standard-error-sas.html&lt;/A&gt; but instead, do leave one out within a group.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Jul 2018 19:13:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Construct-a-jackknife-sample-based-on-groups-leave-kth-group/m-p/476562#M4275</guid>
      <dc:creator>gsk</dc:creator>
      <dc:date>2018-07-09T19:13:23Z</dc:date>
    </item>
    <item>
      <title>Re: Construct a jackknife sample based on groups (leave kth-group)</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Construct-a-jackknife-sample-based-on-groups-leave-kth-group/m-p/476755#M4277</link>
      <description>&lt;P&gt;I don't fully understand what you are saying, but I guess I don't have to. Your question seems to be "how can I compute k variances in SAS/IML where each one is computed by leaving out one of the k groups."&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Attached&amp;nbsp;is a program that I hope will demonstrate the programming technique,&amp;nbsp;even if I am misinterpreting some of the details. For background, I suggest you read &lt;A href="https://blogs.sas.com/content/iml/2011/11/01/the-unique-loc-trick-a-real-treat.html" target="_self"&gt;my article about the "UNIQUE-LOC" technique.&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data Have;
call streaminit(1234);
do Group = 1 to 10;
   StdDev = round(1 + rand("Uniform"), 0.05);  /* Group-specific Std Dev */
   do i = 1 to 50;
      x = rand("Normal", 0, StdDev);
      output;
   end;
end;
run;

proc iml;
use Have;
read all var {Group x};
close;
OverallVar = var(x);

u = unique(Group);
k = ncol(u);                /* number of groups */
variance = j(1, k, .);
do i = 1 to k;
   idx = loc( Group ^= u[i] );   /* omit the i_th group */
   variance[i] = var( x[idx] );  /* compute statistic on remaining k-1 groups */
end;
print variance;

est = ssq( OverallVar - variance ) / (k/(k-1));
print est;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 10 Jul 2018 12:17:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Construct-a-jackknife-sample-based-on-groups-leave-kth-group/m-p/476755#M4277</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2018-07-10T12:17:40Z</dc:date>
    </item>
  </channel>
</rss>

