<?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: How do I Bootstrap a Custom-Made Statistic?? in SAS Studio</title>
    <link>https://communities.sas.com/t5/SAS-Studio/How-do-I-Bootstrap-a-Custom-Made-Statistic/m-p/537991#M7115</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/263605"&gt;@MeasuringHealth&lt;/a&gt;&amp;nbsp;and welcome to the SAS Support Communities!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Create your bootstrap samples (&lt;EM&gt;not&lt;/EM&gt; using a macro, see&amp;nbsp;&lt;SPAN&gt;David L. Cassell's paper&amp;nbsp;&lt;/SPAN&gt;&lt;A href="http://support.sas.com/resources/papers/proceedings10/268-2010.pdf" target="_blank" rel="noopener nofollow noopener noreferrer"&gt;BootstrapMania!: Re-Sampling the SAS® Way&lt;/A&gt;&lt;SPAN&gt;).&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt; Compute the means and standard deviations using PROC SUMMARY (or PROC MEANS) with BY-group processing.&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;Perform the SRM calculation in a DATA step based on the output dataset from step 2.&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;Using PROC UNIVARIATE, determine the 2.5th and 97.5th percentile of the SRM values in the dataset&amp;nbsp;resulting from step 3 in order to obtain the bootstrap 95% CI.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&lt;SPAN&gt;Alternatively, a single PROC SQL step (with a GROUP BY clause) could replace steps 2 and 3.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 23 Feb 2019 16:46:36 GMT</pubDate>
    <dc:creator>FreelanceReinh</dc:creator>
    <dc:date>2019-02-23T16:46:36Z</dc:date>
    <item>
      <title>How do I Bootstrap a Custom-Made Statistic??</title>
      <link>https://communities.sas.com/t5/SAS-Studio/How-do-I-Bootstrap-a-Custom-Made-Statistic/m-p/537974#M7112</link>
      <description>&lt;P&gt;Hi all, (I am using SAS Studio&amp;nbsp;&lt;STRONG&gt;Release: 3.6 (Enterprise Edition),&lt;/STRONG&gt;&amp;nbsp;Engine 9)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have computed the simple Standardized Response Mean (SRM) for my sample: mean/std=SRM. Now, I need to bootstrap this SRM to get the 95% confidence intervals. Unfortunately, the SRM is a &lt;EM&gt;function&lt;/EM&gt; of the mean and standard deviation, so I am not able to simply use PROC MEANS with a BY statement. Or can I? What is the best way for me to do this??? I have little experience with macro writing...but am willing to learn if there is a simple macro to write.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my code (again, my goal is to bootstrap the SRM variable, which is now in my output as a single observation):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* ----------------------------------------------------------- */
/*     Bootstrapping the Standardized Response Mean (SRM)      */
/* ----------------------------------------------------------- */
PROC MEANS DATA=Sample noprint;
	VAR ChangeScore;
	OUTPUT out=preSRM mean(ChangeScore)=mean std(ChangeScore)=std;
RUN;
DATA SRM;
	SET preSRM;
	SRM=DIVIDE(mean,std);
RUN;

*NOW I NEED TO BOOTSTRAP THE SRM VARIABLE...;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Help!!!!&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;MeasuringHealth&lt;/P&gt;</description>
      <pubDate>Sat, 23 Feb 2019 15:19:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/How-do-I-Bootstrap-a-Custom-Made-Statistic/m-p/537974#M7112</guid>
      <dc:creator>MeasuringHealth</dc:creator>
      <dc:date>2019-02-23T15:19:58Z</dc:date>
    </item>
    <item>
      <title>Re: How do I Bootstrap a Custom-Made Statistic??</title>
      <link>https://communities.sas.com/t5/SAS-Studio/How-do-I-Bootstrap-a-Custom-Made-Statistic/m-p/537976#M7113</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data want;&lt;BR /&gt;if _n_=1 then set SRM;&lt;BR /&gt;set sample;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Sat, 23 Feb 2019 15:32:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/How-do-I-Bootstrap-a-Custom-Made-Statistic/m-p/537976#M7113</guid>
      <dc:creator>stat_sas</dc:creator>
      <dc:date>2019-02-23T15:32:06Z</dc:date>
    </item>
    <item>
      <title>Re: How do I Bootstrap a Custom-Made Statistic??</title>
      <link>https://communities.sas.com/t5/SAS-Studio/How-do-I-Bootstrap-a-Custom-Made-Statistic/m-p/537983#M7114</link>
      <description>Okay, I'll try...any hint on the code I should write after that?</description>
      <pubDate>Sat, 23 Feb 2019 16:00:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/How-do-I-Bootstrap-a-Custom-Made-Statistic/m-p/537983#M7114</guid>
      <dc:creator>MeasuringHealth</dc:creator>
      <dc:date>2019-02-23T16:00:58Z</dc:date>
    </item>
    <item>
      <title>Re: How do I Bootstrap a Custom-Made Statistic??</title>
      <link>https://communities.sas.com/t5/SAS-Studio/How-do-I-Bootstrap-a-Custom-Made-Statistic/m-p/537991#M7115</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/263605"&gt;@MeasuringHealth&lt;/a&gt;&amp;nbsp;and welcome to the SAS Support Communities!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Create your bootstrap samples (&lt;EM&gt;not&lt;/EM&gt; using a macro, see&amp;nbsp;&lt;SPAN&gt;David L. Cassell's paper&amp;nbsp;&lt;/SPAN&gt;&lt;A href="http://support.sas.com/resources/papers/proceedings10/268-2010.pdf" target="_blank" rel="noopener nofollow noopener noreferrer"&gt;BootstrapMania!: Re-Sampling the SAS® Way&lt;/A&gt;&lt;SPAN&gt;).&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt; Compute the means and standard deviations using PROC SUMMARY (or PROC MEANS) with BY-group processing.&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;Perform the SRM calculation in a DATA step based on the output dataset from step 2.&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;Using PROC UNIVARIATE, determine the 2.5th and 97.5th percentile of the SRM values in the dataset&amp;nbsp;resulting from step 3 in order to obtain the bootstrap 95% CI.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&lt;SPAN&gt;Alternatively, a single PROC SQL step (with a GROUP BY clause) could replace steps 2 and 3.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 23 Feb 2019 16:46:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/How-do-I-Bootstrap-a-Custom-Made-Statistic/m-p/537991#M7115</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2019-02-23T16:46:36Z</dc:date>
    </item>
    <item>
      <title>Re: How do I Bootstrap a Custom-Made Statistic??</title>
      <link>https://communities.sas.com/t5/SAS-Studio/How-do-I-Bootstrap-a-Custom-Made-Statistic/m-p/537998#M7116</link>
      <description>&lt;P&gt;Thank you very much,&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/32733"&gt;@FreelanceReinh&lt;/a&gt;!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I should have called upon you sooner. For anyone that may benefit from seeing it, here is my successful code (built by using &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/32733"&gt;@FreelanceReinh&lt;/a&gt;'s suggestion):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* ----------------------------------------------------------- */
/*     Bootstrapping the Standardized Response Mean (SRM)      */
/* ----------------------------------------------------------- */

/*--- Bootstrapping the samples ---*/
SASFILE SEVERITY load; /* 1 */
PROC SURVEYSELECT DATA=SEVERITY out=outboot /* 2 */
	SEED=1 /* 3 */
	METHOD=urs /* 4 */
	SAMPRATE=1 /* 5 */
	OUTHITS /* 6 */
	rep=1000; /* 7 */
RUN;
SASFILE SEVERITY close; /* 8 */

/*--- Compute means &amp;amp; standard deviations from bootstrap samples ---*/
PROC MEANS DATA=outboot noprint;
	BY Replicate;
	VAR GASIchange;
	OUTPUT out=preSRM mean(GASIchange)=mean std(GASIchange)=std;
RUN;

/*--- Perform SRM calculation on bootstrapped statistics ---*/
DATA bootSRM;
	SET preSRM;
	bootSRM=DIVIDE(mean,std);
RUN;

/*--- Compute 95% bootstrap confidence interval ---*/
PROC UNIVARIATE DATA=bootSRM;
	VAR bootSRM;
	HISTOGRAM bootSRM;
	OUTPUT out=Pctl pctlpre=CI95_
		pctlpts=2.5 97.5       
		pctlname=Lower Upper;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;MeasuringHealth&lt;/P&gt;</description>
      <pubDate>Sat, 23 Feb 2019 17:53:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/How-do-I-Bootstrap-a-Custom-Made-Statistic/m-p/537998#M7116</guid>
      <dc:creator>MeasuringHealth</dc:creator>
      <dc:date>2019-02-23T17:53:38Z</dc:date>
    </item>
  </channel>
</rss>

