<?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: jackknife macro in GLM in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/jackknife-macro-in-GLM/m-p/645257#M31039</link>
    <description>&lt;P&gt;Calling&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684"&gt;@Rick_SAS&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 05 May 2020 12:11:17 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2020-05-05T12:11:17Z</dc:date>
    <item>
      <title>jackknife macro in GLM</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/jackknife-macro-in-GLM/m-p/645019#M31036</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm new at using SAS so maybe my problem is easy to solve. I'm trying to implement a jackknife approach in a GLM analysis. For this purpose, I used the jackknife macro&amp;nbsp;&lt;FONT&gt;&lt;A href="https://support.sas.com/kb/24/982.html" target="_blank" rel="noopener"&gt;https://support.sas.com/kb/24/982.html&lt;/A&gt; so that the code was (variables in the model are not real, just to make it easy to read):&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;FONT&gt;%macro analyze (data=, out=);&lt;BR /&gt;PROC GLM DATA= GLM;&lt;BR /&gt;MODEL Y = X + Z;&lt;BR /&gt;out=out(rename=(_type_=stat _name_=with));&lt;BR /&gt;%bystmt;&lt;BR /&gt;RUN;&lt;BR /&gt;%mend;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT&gt;%inc "C:\route to macro";&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT&gt;&amp;nbsp;&amp;nbsp; %jack(data=GLM,id=stat with)&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT&gt;When running the syntax, two errors appeared: WORK.JACKDIST.DATA does not exist and&lt;/FONT&gt;&lt;FONT&gt; WORK.JACKACT.DATA does not exist.&lt;BR /&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Any help?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;thanks in advance&lt;/DIV&gt;</description>
      <pubDate>Mon, 04 May 2020 15:23:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/jackknife-macro-in-GLM/m-p/645019#M31036</guid>
      <dc:creator>Loredov</dc:creator>
      <dc:date>2020-05-04T15:23:57Z</dc:date>
    </item>
    <item>
      <title>Re: jackknife macro in GLM</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/jackknife-macro-in-GLM/m-p/645063#M31037</link>
      <description>&lt;P&gt;You have likely oversimplified things.&lt;/P&gt;
&lt;P&gt;You should provide at an absolute minimum the the macro call that you used.&lt;/P&gt;
&lt;P&gt;Best would be to copy the call from the LOG along with the error message(s) and paste into a code box opened on the forum with the &amp;lt;/&amp;gt; icon to preserve formatting of the messages.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the macro call looked like:&lt;/P&gt;
&lt;P&gt;%jackdist(data=jackdist,&amp;lt;other parameters here&amp;gt;)&lt;/P&gt;
&lt;P&gt;then you do not have a data set named Jackdist in the WORK library.&lt;/P&gt;
&lt;P&gt;You may either need to add the library name to the data set such as&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%jackdist(data=mylib.jackdist, &amp;lt;other parameters&amp;gt;)&lt;/P&gt;
&lt;P&gt;or you need to check the spelling of the data set name that you provided.&lt;/P&gt;
&lt;P&gt;It is very likely the second data set missing could be that the result was supposed to be created but if it was a parameter to the macro call then the same issues apply.&lt;/P&gt;</description>
      <pubDate>Mon, 04 May 2020 17:51:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/jackknife-macro-in-GLM/m-p/645063#M31037</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-05-04T17:51:30Z</dc:date>
    </item>
    <item>
      <title>Re: jackknife macro in GLM</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/jackknife-macro-in-GLM/m-p/645071#M31038</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/326993"&gt;@Loredov&lt;/a&gt;&amp;nbsp;and welcome to the SAS Support Communities!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Before trying to run your own code (the PROC GLM step in this case) in a macro, you should run it outside a macro and make sure that the desired output is produced and the log is "clean" (no error messages, warnings, etc.). In your example you would notice that&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;The syntax of the &lt;A href="https://documentation.sas.com/?docsetId=statug&amp;amp;docsetTarget=statug_glm_syntax16.htm&amp;amp;docsetVersion=14.3&amp;amp;locale=en" target="_blank" rel="noopener"&gt;MODEL statement&lt;/A&gt; must not contain plus signs (but maybe your real code uses correct syntax, i.e. Y = X Z).&lt;/LI&gt;
&lt;LI&gt;There is no OUT= &lt;EM&gt;statement&lt;/EM&gt; in PROC GLM, only an OUT= &lt;EM&gt;option&lt;/EM&gt; of the &lt;A href="https://documentation.sas.com/?docsetId=statug&amp;amp;docsetTarget=statug_glm_syntax17.htm&amp;amp;docsetVersion=14.3&amp;amp;locale=en" target="_blank" rel="noopener"&gt;OUTPUT statement&lt;/A&gt;, but that output dataset would normally not contain variables named &lt;FONT face="courier new,courier"&gt;_type_&lt;/FONT&gt; or &lt;FONT face="courier new,courier"&gt;_name_&lt;/FONT&gt;.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;I guess you copied the OUT= option from the example using PROC CORR, but the syntax of PROC GLM is different.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, the dataset names, &lt;FONT face="courier new,courier"&gt;GLM&lt;/FONT&gt; and &lt;FONT face="courier new,courier"&gt;out&lt;/FONT&gt; in your example, must not be hardcoded, but replaced by macro variable references &lt;FONT face="courier new,courier"&gt;&amp;amp;data&lt;/FONT&gt; and &lt;FONT face="courier new,courier"&gt;&amp;amp;out&lt;/FONT&gt;, respectively. Otherwise, macro &lt;FONT face="courier new,courier"&gt;jack&lt;/FONT&gt; cannot create the datasets JACKDIST and JACKACT, which causes the error messages you've reported.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's an example that works:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc glm data=sashelp.class;
model weight=height age;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Now let's compute jackknife estimates of, say, the parameter estimates of &lt;FONT face="courier new,courier"&gt;height&lt;/FONT&gt; and &lt;FONT face="courier new,courier"&gt;age&lt;/FONT&gt; in the above linear regression.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro analyze(data=,out=);
ods output parameterestimates=&amp;amp;out(where=(parameter ne 'Intercept') drop=stderr tvalue probt);
proc glm data=&amp;amp;data;
model weight=height age;
%bystmt;
run;
%mend;

%jack(data=sashelp.class, id=parameter)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;In this case, the statistics of interest are contained in an ODS output dataset, which is requested with an ODS OUTPUT statement. By default, this output dataset would look like this:&lt;/P&gt;
&lt;PRE&gt;Dependent    Parameter        Estimate          StdErr     tValue     Probt

 Weight      Intercept    -141.2237635     33.38309350      -4.23    0.0006
 Weight      Height          3.5970265      0.90546072       3.97    0.0011
 Weight      Age             1.2783925      3.11010374       0.41    0.6865&lt;/PRE&gt;
&lt;P&gt;We see that variable &lt;FONT face="courier new,courier"&gt;Parameter&lt;/FONT&gt; is suitable for identifying the observations of interest, hence it is specified in the second parameter in the &lt;FONT face="courier new,courier"&gt;%jack&lt;/FONT&gt; macro call. The first observation will be excluded (arbitrarily) by the WHERE= dataset option. The last three variables are excluded by the DROP= dataset option because we decided (arbitrarily) not to compute jackknife estimates for them.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Result (excerpt):&lt;/P&gt;
&lt;PRE&gt;                             Observed       Jackknife
parameter      Name         Statistic            Mean

 Age         Estimate       1.2783925       &lt;STRONG&gt;1.3112812&lt;/STRONG&gt;
 Height      Estimate       3.5970265       &lt;STRONG&gt;3.5832738&lt;/STRONG&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 May 2020 18:21:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/jackknife-macro-in-GLM/m-p/645071#M31038</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2020-05-04T18:21:55Z</dc:date>
    </item>
    <item>
      <title>Re: jackknife macro in GLM</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/jackknife-macro-in-GLM/m-p/645257#M31039</link>
      <description>&lt;P&gt;Calling&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684"&gt;@Rick_SAS&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 May 2020 12:11:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/jackknife-macro-in-GLM/m-p/645257#M31039</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2020-05-05T12:11:17Z</dc:date>
    </item>
    <item>
      <title>Re: jackknife macro in GLM</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/jackknife-macro-in-GLM/m-p/646867#M31044</link>
      <description>&lt;P&gt;Number 1: See what&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp;said about posting the log.&lt;/P&gt;
&lt;P&gt;Number 2:&amp;nbsp; See what&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/32733"&gt;@FreelanceReinh&lt;/a&gt;&amp;nbsp; said about the syntax of PROC GLM.&lt;/P&gt;
&lt;P&gt;Number 3: Jackknifing/resampling is a lot easier now with PROC SURVEYSELECT to generate data sets.&amp;nbsp; You can then set all of the resampled datasets with an indicator variable that you use in PROC GLM as an argument to the BY statement.&amp;nbsp; Using an OUTPUT OUT= statement, you then have all of the parameters/pvalues/other things of interest in one dataset from which you can calculate all of the jackknifed estimates.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SteveDenham&lt;/P&gt;</description>
      <pubDate>Mon, 11 May 2020 19:56:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/jackknife-macro-in-GLM/m-p/646867#M31044</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2020-05-11T19:56:39Z</dc:date>
    </item>
  </channel>
</rss>

