<?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 Obtaining P-value from bootstrap samples in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Obtaining-P-value-from-bootstrap-samples/m-p/810823#M39946</link>
    <description>&lt;P&gt;Hello everyone,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I ran proc logistic on a bootstrapped sample, does anyone please know how I can obtain p-values? I will appreciate your help, thanks&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc surveyselect data=melanoma.nomiss NOPRINT seed=12345
out=Bootout
method=urs /*resample with replacement*/
samprate=1 /*each bootstrap sample has N observations*/
reps=1000; /*generate 1000 bootstrap resamples */

%macro ODSOff(); /* Call prior to BY-group processing */
ods graphics off;
ods exclude all;
ods noresults;
%mend;
 
%macro ODSOn(); /* Call after BY-group processing */
ods graphics on;
ods exclude none;
ods results;
%mend;

%ODSOff;

*B. run log reg on bootstrap samples;

proc logistic data=Bootout plots=ROC outest = estimate; /** N = 1372**/
BY REPLICATE;
title "multivariable logistic regression-bootstrapped sample";
class sexcat (param=ref ref = "2") racethc(param=ref ref = "0") insurcatb (param=ref ref = "2") 
              location (param=ref ref = "0") povertycat (param=ref ref = "0") cci (param=ref ref = "0") 
              surgcat(param=ref ref = "0") hormcat (param=ref ref = "1")  radicat (param=ref ref = "0") 
              chemocat (param=ref ref = "0") histology (ref = "amelanotic") primary (ref = "head_neck");;
              
	   
model immunocat (event='1') = agenum sexcat racethc insurcatb povertycat intervalb 
                              cci location surgcat hormcat radicat chemocat histology primary
							  dxdateyearnum/ rl selection = backward include=6  
                              clodds=pl;
							  ods output CLoddsPL=CL_boot_Mort_mod_1  ;
run;

proc univariate data=cl_boot_mort_mod_1 noprint;
   class Effect;
   var  OddsRatioEst;
   output out=WidePctls1 pctlpre=P_ pctlpts=2.5 97.5 mean=Mean Std=Std P ; 
run; 


proc print data=WidePctls1 noobs label;
   format Mean Std P_2_5 P_97_5 6.4;
   label Mean="BootMean" Std="BootStdErr" P_2_5="95% Lower CL" P_97_5="95% Upper CL";
run;&lt;BR /&gt;%ODSOn;&lt;BR /&gt;proc print data = WidePctls1;&lt;BR /&gt;run;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Output" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/71026i764D7E1117FFB63B/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2022-04-30 111518.png" alt="Output" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Output&lt;/span&gt;&lt;/span&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sat, 30 Apr 2022 16:16:07 GMT</pubDate>
    <dc:creator>Banke</dc:creator>
    <dc:date>2022-04-30T16:16:07Z</dc:date>
    <item>
      <title>Obtaining P-value from bootstrap samples</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Obtaining-P-value-from-bootstrap-samples/m-p/810823#M39946</link>
      <description>&lt;P&gt;Hello everyone,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I ran proc logistic on a bootstrapped sample, does anyone please know how I can obtain p-values? I will appreciate your help, thanks&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc surveyselect data=melanoma.nomiss NOPRINT seed=12345
out=Bootout
method=urs /*resample with replacement*/
samprate=1 /*each bootstrap sample has N observations*/
reps=1000; /*generate 1000 bootstrap resamples */

%macro ODSOff(); /* Call prior to BY-group processing */
ods graphics off;
ods exclude all;
ods noresults;
%mend;
 
%macro ODSOn(); /* Call after BY-group processing */
ods graphics on;
ods exclude none;
ods results;
%mend;

%ODSOff;

*B. run log reg on bootstrap samples;

proc logistic data=Bootout plots=ROC outest = estimate; /** N = 1372**/
BY REPLICATE;
title "multivariable logistic regression-bootstrapped sample";
class sexcat (param=ref ref = "2") racethc(param=ref ref = "0") insurcatb (param=ref ref = "2") 
              location (param=ref ref = "0") povertycat (param=ref ref = "0") cci (param=ref ref = "0") 
              surgcat(param=ref ref = "0") hormcat (param=ref ref = "1")  radicat (param=ref ref = "0") 
              chemocat (param=ref ref = "0") histology (ref = "amelanotic") primary (ref = "head_neck");;
              
	   
model immunocat (event='1') = agenum sexcat racethc insurcatb povertycat intervalb 
                              cci location surgcat hormcat radicat chemocat histology primary
							  dxdateyearnum/ rl selection = backward include=6  
                              clodds=pl;
							  ods output CLoddsPL=CL_boot_Mort_mod_1  ;
run;

proc univariate data=cl_boot_mort_mod_1 noprint;
   class Effect;
   var  OddsRatioEst;
   output out=WidePctls1 pctlpre=P_ pctlpts=2.5 97.5 mean=Mean Std=Std P ; 
run; 


proc print data=WidePctls1 noobs label;
   format Mean Std P_2_5 P_97_5 6.4;
   label Mean="BootMean" Std="BootStdErr" P_2_5="95% Lower CL" P_97_5="95% Upper CL";
run;&lt;BR /&gt;%ODSOn;&lt;BR /&gt;proc print data = WidePctls1;&lt;BR /&gt;run;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Output" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/71026i764D7E1117FFB63B/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2022-04-30 111518.png" alt="Output" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Output&lt;/span&gt;&lt;/span&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 30 Apr 2022 16:16:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Obtaining-P-value-from-bootstrap-samples/m-p/810823#M39946</guid>
      <dc:creator>Banke</dc:creator>
      <dc:date>2022-04-30T16:16:07Z</dc:date>
    </item>
    <item>
      <title>Re: Obtaining P-value from bootstrap samples</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Obtaining-P-value-from-bootstrap-samples/m-p/811030#M39950</link>
      <description>&lt;P&gt;For a discussion of bootstrap p-values, see&lt;A href="https://blogs.sas.com/content/iml/2011/11/02/how-to-compute-p-values-for-a-bootstrap-distribution.html" target="_self"&gt; "How to compute p-values for a bootstrap distribution."&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To compute a p-value, you need to have a hypotheses test. What is the test here? OddRatio=1?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here are the steps:&lt;/P&gt;
&lt;P&gt;1. Compute the statistic on the original data. Call the value T0.&lt;/P&gt;
&lt;P&gt;2. For a one-sided p-value, compute the proportion of bootstrap statistics that exceed T0. For example,&amp;nbsp; if T0=2, you can write a DATA step to count how many bootstrap samples have OddsRatioEst &amp;gt; 2. The estimated p-value is (Count / NumBootSamples), where NumBootSamples=1000 for your example.&lt;/P&gt;
&lt;P&gt;3. For a two-sided p-value, you need to figure out what value to use for the lower bound. For an odds ratio, I think the correct value is T1 = 1/T0. Then you would count how many bootstrap samples have statistics that are outside of the interval [T1, T2]. Again, the p-value is computed from this count as the proportion (Count / NumBootSamples).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 May 2022 12:01:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Obtaining-P-value-from-bootstrap-samples/m-p/811030#M39950</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2022-05-02T12:01:32Z</dc:date>
    </item>
    <item>
      <title>Re: Obtaining P-value from bootstrap samples</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Obtaining-P-value-from-bootstrap-samples/m-p/811033#M39951</link>
      <description>Thank you, I will try this. Yes, my hypothesis is OR  = 1&lt;BR /&gt;</description>
      <pubDate>Mon, 02 May 2022 10:22:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Obtaining-P-value-from-bootstrap-samples/m-p/811033#M39951</guid>
      <dc:creator>Banke</dc:creator>
      <dc:date>2022-05-02T10:22:24Z</dc:date>
    </item>
    <item>
      <title>Re: Obtaining P-value from bootstrap samples</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Obtaining-P-value-from-bootstrap-samples/m-p/811038#M39952</link>
      <description>&lt;P&gt;Hi &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684"&gt;@Rick_SAS&lt;/a&gt;, I think you meant to link to your 2011 blog post &lt;A href="https://blogs.sas.com/content/iml/2011/11/02/how-to-compute-p-values-for-a-bootstrap-distribution.html" target="_blank" rel="noopener"&gt;"How to compute p-values for a bootstrap distribution."&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Always impressive how many questions can be answered by referring to an article from your great, ever-growing blog.&lt;/P&gt;</description>
      <pubDate>Mon, 02 May 2022 11:21:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Obtaining-P-value-from-bootstrap-samples/m-p/811038#M39952</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2022-05-02T11:21:22Z</dc:date>
    </item>
  </channel>
</rss>

