<?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: Post hoc z-tests with a Bonferroni correction in SAS? in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Post-hoc-z-tests-with-a-Bonferroni-correction-in-SAS/m-p/721252#M34934</link>
    <description>I should have realized that earlier. Thank you very much for all your help, it's very much appreciated!</description>
    <pubDate>Tue, 23 Feb 2021 12:28:05 GMT</pubDate>
    <dc:creator>monsterpie</dc:creator>
    <dc:date>2021-02-23T12:28:05Z</dc:date>
    <item>
      <title>Post hoc z-tests with a Bonferroni correction in SAS?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Post-hoc-z-tests-with-a-Bonferroni-correction-in-SAS/m-p/720905#M34902</link>
      <description>&lt;P&gt;Hi everyone,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a 5x3 table, as shown below (letters and numbers are not my actual variable names, my variables are categorical but not ordinal). I have conducted a Fisher's exact test with Monte Carlo estimation and it is significant, but I was wondering if it's possible to apply post hoc z test of proportions with a Bonferroni adjustment? I have not been able to find an answer online/any example of SAS code online for this. Any help is appreciated!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;TABLE:&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;C&lt;/TD&gt;&lt;TD&gt;D&lt;/TD&gt;&lt;TD&gt;E&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Mon, 22 Feb 2021 14:15:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Post-hoc-z-tests-with-a-Bonferroni-correction-in-SAS/m-p/720905#M34902</guid>
      <dc:creator>monsterpie</dc:creator>
      <dc:date>2021-02-22T14:15:53Z</dc:date>
    </item>
    <item>
      <title>Re: Post hoc z-tests with a Bonferroni correction in SAS?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Post-hoc-z-tests-with-a-Bonferroni-correction-in-SAS/m-p/720911#M34903</link>
      <description>&lt;P&gt;You can use PROC MULTTEST as illustrated in &lt;A href="http://support.sas.com/kb/22565" target="_self"&gt;this note&lt;/A&gt;. Many multiple testing adjustments are available, with some that are less conservative than the Bonferroni.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Feb 2021 14:33:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Post-hoc-z-tests-with-a-Bonferroni-correction-in-SAS/m-p/720911#M34903</guid>
      <dc:creator>StatDave</dc:creator>
      <dc:date>2021-02-22T14:33:19Z</dc:date>
    </item>
    <item>
      <title>Re: Post hoc z-tests with a Bonferroni correction in SAS?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Post-hoc-z-tests-with-a-Bonferroni-correction-in-SAS/m-p/720971#M34906</link>
      <description>&lt;P&gt;Thank you! I've modified some of the code included in the link you provided but I'm stuck on how to make this work for a Fisher's test.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ODS OUTPUT fishersexact(PERSIST)=fisher(WHERE=(name1="XP2_FISH") rename=(nvalue1=raw_p));
PROC FREQ DATA= winter_t1;
WHERE platform in ('Facebook', 'Twitter');
TABLES platform*account_type;
exact fisher/mc;
RUN;

PROC FREQ DATA= winter_t1;
WHERE platform in ('Facebook', 'Instagram');
TABLES platform*account_type;
exact fisher/mc;
RUN;

PROC FREQ DATA= winter_t1;
WHERE platform in ('Twitter', 'Instagram');
TABLES platform*account_type;
exact fisher/mc;
RUN;
ODS OUTPUT CLEAR;
proc print noobs;
var value raw_p;
run;
proc multtest pdata=fisher bon;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 22 Feb 2021 17:10:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Post-hoc-z-tests-with-a-Bonferroni-correction-in-SAS/m-p/720971#M34906</guid>
      <dc:creator>monsterpie</dc:creator>
      <dc:date>2021-02-22T17:10:48Z</dc:date>
    </item>
    <item>
      <title>Re: Post hoc z-tests with a Bonferroni correction in SAS?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Post-hoc-z-tests-with-a-Bonferroni-correction-in-SAS/m-p/720977#M34908</link>
      <description>&lt;P&gt;You didn't say what problem you ran into, but this basic example works - note the newer option INPVALUES= which is a bit easier to work with.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ODS OUTPUT fishersexact(PERSIST)=fisher(WHERE=(name1="XP2_FISH"));
PROC FREQ DATA= test;
TABLES a*b;
exact fisher/mc;
RUN;
PROC FREQ DATA= test;
TABLES b*c;
exact fisher/mc;
RUN;
ODS OUTPUT CLEAR;
proc multtest inpvalues(nvalue1)=fisher bon;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 22 Feb 2021 17:22:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Post-hoc-z-tests-with-a-Bonferroni-correction-in-SAS/m-p/720977#M34908</guid>
      <dc:creator>StatDave</dc:creator>
      <dc:date>2021-02-22T17:22:48Z</dc:date>
    </item>
    <item>
      <title>Re: Post hoc z-tests with a Bonferroni correction in SAS?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Post-hoc-z-tests-with-a-Bonferroni-correction-in-SAS/m-p/720991#M34909</link>
      <description>When I run that code I get this error: ERROR: INPVALUES= must have the NVALUE1 variable.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 22 Feb 2021 18:49:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Post-hoc-z-tests-with-a-Bonferroni-correction-in-SAS/m-p/720991#M34909</guid>
      <dc:creator>monsterpie</dc:creator>
      <dc:date>2021-02-22T18:49:43Z</dc:date>
    </item>
    <item>
      <title>Re: Post hoc z-tests with a Bonferroni correction in SAS?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Post-hoc-z-tests-with-a-Bonferroni-correction-in-SAS/m-p/720996#M34911</link>
      <description>&lt;P&gt;You probably still have that RENAME= option in the ODS OUTPUT line. Note that my code removes it.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Feb 2021 19:01:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Post-hoc-z-tests-with-a-Bonferroni-correction-in-SAS/m-p/720996#M34911</guid>
      <dc:creator>StatDave</dc:creator>
      <dc:date>2021-02-22T19:01:26Z</dc:date>
    </item>
    <item>
      <title>Re: Post hoc z-tests with a Bonferroni correction in SAS?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Post-hoc-z-tests-with-a-Bonferroni-correction-in-SAS/m-p/721001#M34912</link>
      <description>&lt;P&gt;This is what my code looks like, I have the rename statement removed.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ODS OUTPUT fishersexact(PERSIST)=winter_t1 (WHERE=(name1="XP2_FISH"));
PROC FREQ DATA= winter_t1;
WHERE platform in ('Facebook', 'Twitter');
TABLES platform*account_type;
exact fisher/mc;
RUN;

PROC FREQ DATA= winter_t1;
WHERE platform in ('Facebook', 'Instagram');
TABLES platform*account_type;
exact fisher/mc;
RUN;

PROC FREQ DATA= winter_t1;
WHERE platform in ('Twitter', 'Instagram');
TABLES platform*account_type;
exact fisher/mc;
RUN;
ODS OUTPUT CLEAR;

proc multtest inpvalues(nvalue1)=winter_t1 bon;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 22 Feb 2021 19:16:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Post-hoc-z-tests-with-a-Bonferroni-correction-in-SAS/m-p/721001#M34912</guid>
      <dc:creator>monsterpie</dc:creator>
      <dc:date>2021-02-22T19:16:18Z</dc:date>
    </item>
    <item>
      <title>Re: Post hoc z-tests with a Bonferroni correction in SAS?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Post-hoc-z-tests-with-a-Bonferroni-correction-in-SAS/m-p/721036#M34917</link>
      <description>You should not use the input data set for FREQ (winter_t1) in the ODS OUTPUT statement. The data set name you use in the ODS OUTPUT statement should be a new name for the data set you are creating when you save the table from the Fisher Exact test.</description>
      <pubDate>Mon, 22 Feb 2021 20:10:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Post-hoc-z-tests-with-a-Bonferroni-correction-in-SAS/m-p/721036#M34917</guid>
      <dc:creator>StatDave</dc:creator>
      <dc:date>2021-02-22T20:10:37Z</dc:date>
    </item>
    <item>
      <title>Re: Post hoc z-tests with a Bonferroni correction in SAS?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Post-hoc-z-tests-with-a-Bonferroni-correction-in-SAS/m-p/721046#M34922</link>
      <description>&lt;P&gt;Okay, I've changed the dataset in the ODS OUTPUT statement, I still seem to be getting an error from the proc multtest statement: ERROR: No valid observations.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And to clarify, I get output for the proc freq statements, so that's why I think the error has to do with the multtest statement.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Feb 2021 20:41:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Post-hoc-z-tests-with-a-Bonferroni-correction-in-SAS/m-p/721046#M34922</guid>
      <dc:creator>monsterpie</dc:creator>
      <dc:date>2021-02-22T20:41:57Z</dc:date>
    </item>
    <item>
      <title>Re: Post hoc z-tests with a Bonferroni correction in SAS?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Post-hoc-z-tests-with-a-Bonferroni-correction-in-SAS/m-p/721091#M34923</link>
      <description>Show the contents of the ODS OUTPUT data set. Assuming it is called FISHER, like it was originally:&lt;BR /&gt;proc print data=fisher; run;</description>
      <pubDate>Mon, 22 Feb 2021 21:47:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Post-hoc-z-tests-with-a-Bonferroni-correction-in-SAS/m-p/721091#M34923</guid>
      <dc:creator>StatDave</dc:creator>
      <dc:date>2021-02-22T21:47:59Z</dc:date>
    </item>
    <item>
      <title>Re: Post hoc z-tests with a Bonferroni correction in SAS?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Post-hoc-z-tests-with-a-Bonferroni-correction-in-SAS/m-p/721133#M34924</link>
      <description>Hmmm... even when I do a proc print, it tells me there are no observations in the 'fisher' dataset</description>
      <pubDate>Mon, 22 Feb 2021 23:45:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Post-hoc-z-tests-with-a-Bonferroni-correction-in-SAS/m-p/721133#M34924</guid>
      <dc:creator>monsterpie</dc:creator>
      <dc:date>2021-02-22T23:45:12Z</dc:date>
    </item>
    <item>
      <title>Re: Post hoc z-tests with a Bonferroni correction in SAS?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Post-hoc-z-tests-with-a-Bonferroni-correction-in-SAS/m-p/721148#M34925</link>
      <description>Then either the created data set has zero observations (see the log note following the ODS OUTPUT CLEAR statement) or all the p-values in the data set are missing. Post your input data set (winter_t1) and the code you used that resulted in this error. Run that code to verify that you reproduce the error with that data set before posting.</description>
      <pubDate>Tue, 23 Feb 2021 00:51:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Post-hoc-z-tests-with-a-Bonferroni-correction-in-SAS/m-p/721148#M34925</guid>
      <dc:creator>StatDave</dc:creator>
      <dc:date>2021-02-23T00:51:10Z</dc:date>
    </item>
    <item>
      <title>Re: Post hoc z-tests with a Bonferroni correction in SAS?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Post-hoc-z-tests-with-a-Bonferroni-correction-in-SAS/m-p/721159#M34926</link>
      <description>&lt;P&gt;Ok I have double checked and I still receive an error message saying there are 0 observations in the fisher dataset. My SAS code is below and my dataset attached. Thank you for all your help&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13633"&gt;@StatDave&lt;/a&gt;&amp;nbsp;!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname winterd "C:/Feb 2021"; 

proc import datafile="C:/Feb 2021/Winter_TEST.csv" out=table1
dbms=csv replace;
run;


*recoding 6 (formally coded as "other") to 4;
data table1;
set table1;
if account_type=6 then account_type=4; 
run;
*checking to see this worked;
proc freq data=table1;
table account_type;
run;
*Frequency output of ACCOUNT_TYPE should be
1: 37 
2: 198 
3: 7 
4: 40 
5: 450;

*Fisher's exact test with MC. Resulting p value is significant;
proc freq data=table1;
tables platform*account_type;
exact fisher/mc;
run;


*proc multtest with bonferonni correction;
ODS OUTPUT fishersexact(PERSIST)=fisher(WHERE=(name1="XP2_FISH"));
    PROC FREQ DATA= table1;
         WHERE platform in (1,2);
         TABLES platform*account_type;
		 exact fisher/mc;
		 RUN;

	PROC FREQ DATA= table1;
         WHERE platform in (1,3);
         TABLES platform*account_type;
		 exact fisher/mc;
		 RUN;

	PROC FREQ DATA= table1;
         WHERE platform in (2,3);
         TABLES platform*account_type;
		 exact fisher/mc;
		 RUN;
ODS OUTPUT CLEAR;

proc multtest inpvalues(nvalue1)=fisher bon;
	run;
proc print data=fisher;
run;
	&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;@&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Feb 2021 01:45:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Post-hoc-z-tests-with-a-Bonferroni-correction-in-SAS/m-p/721159#M34926</guid>
      <dc:creator>monsterpie</dc:creator>
      <dc:date>2021-02-23T01:45:52Z</dc:date>
    </item>
    <item>
      <title>Re: Post hoc z-tests with a Bonferroni correction in SAS?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Post-hoc-z-tests-with-a-Bonferroni-correction-in-SAS/m-p/721167#M34927</link>
      <description>&lt;P&gt;Anytime you do something like this, you need to run the procedure once with your data to see exactly what tables are produced, which you want to work with, and exactly what its name is. Since these tables are larger than 2x2, you get a FisherExact table and a separate Monte Carlo table named FisherExactMC. Each has a p-value variable. If you save both of those tables with ODS OUTPUT, you will see that neither of them has a p-value variable called "XP2_FISH". That is the name of the variable in the FisherExact table if the table being analyzed is a 2x2 table. Depending on which p-value you want to use, this code does them both, using the correct variable names found by examining the tables that were produced for your data.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ODS OUTPUT fishersexact(PERSIST)=fisher(WHERE=(name1="P_TABLE"))
           fishersexactmc(PERSIST)=fishmc(WHERE=(name1="MCP_FISH"));
    PROC FREQ DATA= table1;
         WHERE platform in (1,2);
         TABLES platform*account_type;
		 exact fisher/mc; 
		 RUN;

	PROC FREQ DATA= table1;
         WHERE platform in (1,3);
         TABLES platform*account_type;
		 exact fisher/mc;
		 RUN;

	PROC FREQ DATA= table1;
         WHERE platform in (2,3);
         TABLES platform*account_type;
		 exact fisher/mc;
		 RUN;
ODS OUTPUT CLEAR;
proc multtest inpvalues(nvalue1)=fisher bon;
	run;
proc multtest inpvalues(nvalue1)=fishmc bon;
	run;

&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 23 Feb 2021 02:34:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Post-hoc-z-tests-with-a-Bonferroni-correction-in-SAS/m-p/721167#M34927</guid>
      <dc:creator>StatDave</dc:creator>
      <dc:date>2021-02-23T02:34:18Z</dc:date>
    </item>
    <item>
      <title>Re: Post hoc z-tests with a Bonferroni correction in SAS?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Post-hoc-z-tests-with-a-Bonferroni-correction-in-SAS/m-p/721252#M34934</link>
      <description>I should have realized that earlier. Thank you very much for all your help, it's very much appreciated!</description>
      <pubDate>Tue, 23 Feb 2021 12:28:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Post-hoc-z-tests-with-a-Bonferroni-correction-in-SAS/m-p/721252#M34934</guid>
      <dc:creator>monsterpie</dc:creator>
      <dc:date>2021-02-23T12:28:05Z</dc:date>
    </item>
  </channel>
</rss>

