<?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 to calculate P Value in SAS in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-calculate-P-Value-in-SAS/m-p/181303#M265169</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jacob,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have used used the below code for my data and i am getting the below result, its saying that chi square is not a valid test.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Proc freq data=indegene.sensorysuite;&lt;/P&gt;&lt;P&gt;tables (Age)*(Anxiety_before) / chisq&lt;/P&gt;&lt;P&gt;plots=(freqplot(twoway=grouphorizontal&lt;/P&gt;&lt;P&gt;scale=percent));&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.JPG" class="jive-image" src="https://communities.sas.com/legacyfs/online/7253_Capture.JPG" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help&amp;nbsp; and suggest me on this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ratan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 01 Sep 2014 09:19:38 GMT</pubDate>
    <dc:creator>Ratanroy</dc:creator>
    <dc:date>2014-09-01T09:19:38Z</dc:date>
    <item>
      <title>How to calculate P Value in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-calculate-P-Value-in-SAS/m-p/181300#M265166</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;could you please tell me how would i calculate p-value in SAS ? is there any direct formula for this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;suppose i have four columns :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Age&amp;nbsp;&amp;nbsp;&amp;nbsp; Satisfaction Rate&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Recommended&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Pain&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;45&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Stongly Agree(5)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Stongly Agree(5)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;/P&gt;&lt;P&gt;40&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Agree(4)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Disagree(3)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5&lt;/P&gt;&lt;P&gt;46&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Disagree(3)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Disagree(3)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4&lt;/P&gt;&lt;P&gt;47&amp;nbsp;&amp;nbsp;&amp;nbsp; strongly Disagree(1)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Stongly Agree(5)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3 &lt;/P&gt;&lt;P&gt;28&amp;nbsp;&amp;nbsp;&amp;nbsp; Stongly Agree(5)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Stongly Agree(5 )&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please help me to calculate P-value for each fields Age, Satisfaction rate, Recommended and Pain.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ratan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 31 Aug 2014 17:20:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-calculate-P-Value-in-SAS/m-p/181300#M265166</guid>
      <dc:creator>Ratanroy</dc:creator>
      <dc:date>2014-08-31T17:20:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate P Value in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-calculate-P-Value-in-SAS/m-p/181301#M265167</link>
      <description>&lt;P&gt;Dear Ratan,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You have to give some more information. To calculate a p-value we need to know what statistical hypothesis you want to test, and what test you want to use.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jacob&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Editor's note: this is a popular topic, so we've included some helpful resources here.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp;reminds us that that you first need a hypothesis, and then you can determine the proper test.&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;A best practice for statistical analysis is first determine what type of test you need based on your hypothesis and then figure out how to do it in whatever application you have, SAS, R, SPSS.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;Step 1. What is your hypothesis?&lt;/P&gt;
&lt;P&gt;Step 2. What type of data do you have?&lt;/P&gt;
&lt;P&gt;Step 3. What type of statistical tests are available/appropriate?&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For this data and the stated goal,&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18408"&gt;@Ksharp&lt;/a&gt;&amp;nbsp;suggests PROC FREQ with Fisher's EXACT test.&amp;nbsp; See guidance in this blog post:&amp;nbsp;&lt;A href="https://blogs.sas.com/content/iml/2015/10/26/exact-tests-proc-freq.html" target="_self"&gt;Exact tests in PROC FREQ: What, when, and how&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Another useful post for beginners: &lt;A href="https://blogs.sas.com/content/iml/2017/07/03/summary-statistics-t-tests-sas.html" target="_self"&gt;Summary statistics and t tests in SAS&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Oct 2017 12:34:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-calculate-P-Value-in-SAS/m-p/181301#M265167</guid>
      <dc:creator>JacobSimonsen</dc:creator>
      <dc:date>2017-10-24T12:34:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate P Value in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-calculate-P-Value-in-SAS/m-p/181302#M265168</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jacob,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using Chi Square test for this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ratan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Sep 2014 06:50:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-calculate-P-Value-in-SAS/m-p/181302#M265168</guid>
      <dc:creator>Ratanroy</dc:creator>
      <dc:date>2014-09-01T06:50:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate P Value in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-calculate-P-Value-in-SAS/m-p/181303#M265169</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jacob,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have used used the below code for my data and i am getting the below result, its saying that chi square is not a valid test.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Proc freq data=indegene.sensorysuite;&lt;/P&gt;&lt;P&gt;tables (Age)*(Anxiety_before) / chisq&lt;/P&gt;&lt;P&gt;plots=(freqplot(twoway=grouphorizontal&lt;/P&gt;&lt;P&gt;scale=percent));&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.JPG" class="jive-image" src="https://communities.sas.com/legacyfs/online/7253_Capture.JPG" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help&amp;nbsp; and suggest me on this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ratan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Sep 2014 09:19:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-calculate-P-Value-in-SAS/m-p/181303#M265169</guid>
      <dc:creator>Ratanroy</dc:creator>
      <dc:date>2014-09-01T09:19:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate P Value in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-calculate-P-Value-in-SAS/m-p/181304#M265170</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Ratan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It was not obviously from your original question that you wanted to test the hypothesis of no association between&amp;nbsp; the four collumns and some other variable which you did not mention. But now I understand your question:-)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What kind of variable is thes "anxiety_before" variable? If it is discrete with few distinct values (for example 'low', 'medium' and 'high') then you can test the hyphothises as in the program you wrote. If it is a contionous variable, what I think it is since the number of freedom (DF) is huge, then you can test the hyphotesis by assuming some distribution of the&amp;nbsp; "anxiety_before", for example normal distributed with different mean for different values of&amp;nbsp; "pain". This assumption should also be validated (use a qqplot). Then ANOVA analysis can be used,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc glm data=indegene.sensorysuite;&lt;/P&gt;&lt;P&gt;&amp;nbsp; class pain;&lt;/P&gt;&lt;P&gt;model anxiety_before=pain/ss3;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can do the same for the other predictors. Though, age is reasonable a contionous variable, and therefore you can test association between age and anxiety_before by testing the slope=0 in a linear regression&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc glm data=indegene.sensorysuite;&lt;/P&gt;&lt;P&gt;model anxiety_before=age/ss3;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Sep 2014 09:35:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-calculate-P-Value-in-SAS/m-p/181304#M265170</guid>
      <dc:creator>JacobSimonsen</dc:creator>
      <dc:date>2014-09-01T09:35:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate P Value in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-calculate-P-Value-in-SAS/m-p/181305#M265171</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jacob,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;anxiety_before is a ordinal variable. its nothing but the scale of 1-10 , 1 for lowest and 10 for maximum anxiety. I am attaching one dummy data for your reference.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you please help me to understand what code i have to use to find the p-value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ratan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Sep 2014 11:17:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-calculate-P-Value-in-SAS/m-p/181305#M265171</guid>
      <dc:creator>Ratanroy</dc:creator>
      <dc:date>2014-09-01T11:17:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate P Value in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-calculate-P-Value-in-SAS/m-p/181306#M265172</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Ratan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I see the problem, and I now also understand why you can not perform a chi^2 test. The chi-Square test will not Work since there are too many cells (number of different values of outcome times number of different values of the predictor). Also, even if it worked the chi-Square test is not efficient since it does not use that the outcome and predictors are ordinal.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A simple way to test association is the Spearman correlation. Here it is enough to have an ordinal scale since it is a rank test.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc corr data=indegene.sensorysuite spearman;&lt;/P&gt;&lt;P&gt;var age anxiety_before;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To do this you need to convert all you predictors to numerical values. It is not so important how you do this, if just the ordering is correct. This works because the Spearman correlation is only based on the ranks and not the values. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;jacob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Sep 2014 11:55:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-calculate-P-Value-in-SAS/m-p/181306#M265172</guid>
      <dc:creator>JacobSimonsen</dc:creator>
      <dc:date>2014-09-01T11:55:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate P Value in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-calculate-P-Value-in-SAS/m-p/181307#M265173</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your data is too sparse . use Fisher Exact Test.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc freq data=sashelp.class;&lt;/P&gt;&lt;P&gt;table age*sex /&lt;STRONG&gt;fisher&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc freq data=sashelp.class;&lt;/P&gt;&lt;P&gt;table age*sex /chisq relrisk;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;exact&lt;/STRONG&gt; pchi or;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Xia Keshan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Sep 2014 12:17:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-calculate-P-Value-in-SAS/m-p/181307#M265173</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2014-09-01T12:17:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate P Value in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-calculate-P-Value-in-SAS/m-p/181308#M265174</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Jacob,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have ran the code and i have got the below o/p. can u pls tell me which one is the P-value?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.JPG" class="jive-image-thumbnail jive-image" src="https://communities.sas.com/legacyfs/online/7256_Capture.JPG" width="450" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ratan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Sep 2014 12:20:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-calculate-P-Value-in-SAS/m-p/181308#M265174</guid>
      <dc:creator>Ratanroy</dc:creator>
      <dc:date>2014-09-01T12:20:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate P Value in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-calculate-P-Value-in-SAS/m-p/181309#M265175</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The number 0.1749 is test for correlation=0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;By the way, I aggre with Ksharp Ksharp that the data is too sparse to perform the chisq test, that was what I meant with "too many cells".&lt;/P&gt;&lt;P&gt;You should also try the exact test as he suggest, but be aware that the two test does not test the same hypothesis. Both test are meaning full. The Fisher's exact test does not assume an ordinal scale as the test for correlation does.&lt;/P&gt;&lt;P&gt;Jacob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Sep 2014 12:27:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-calculate-P-Value-in-SAS/m-p/181309#M265175</guid>
      <dc:creator>JacobSimonsen</dc:creator>
      <dc:date>2014-09-01T12:27:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate P Value in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-calculate-P-Value-in-SAS/m-p/181310#M265176</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jacob,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your suggestion.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will use the suggested test and will let u know if i will have any query. I have one more query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="7257" alt="Capture.JPG" class="jive-image-thumbnail jive-image" src="https://communities.sas.com/legacyfs/online/7257_Capture.JPG" width="450" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i have to show the result like this. i have two machine, Machine A is the old and Machine B is the new machine and whatever you are seeing in the screenshot is the count and i have to find out the P-value for this. I have understood for overall data how i have to calculate but in this how would i calculate the p-Value..?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have attached the file for your reference.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ratan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Sep 2014 12:55:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-calculate-P-Value-in-SAS/m-p/181310#M265176</guid>
      <dc:creator>Ratanroy</dc:creator>
      <dc:date>2014-09-01T12:55:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate P Value in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-calculate-P-Value-in-SAS/m-p/181311#M265177</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are calculating a spearman correlation coefficient , not a P-value . P-value is for a statistical test , you need a H0&amp;nbsp; as Jacob said .&lt;/P&gt;&lt;P&gt;You need firstly to know what statistical method I should use for these data .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Xia Keshan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Sep 2014 13:01:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-calculate-P-Value-in-SAS/m-p/181311#M265177</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2014-09-01T13:01:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate P Value in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-calculate-P-Value-in-SAS/m-p/181312#M265178</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Keshan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for helping me on this. i have ordinal scale data here, so is it appropriate to use F-test? (Sorry I am new in this)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have one new requirement which i have posted on the above and also attached the data. Could u pls help how would i accomplish this..?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ratan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Sep 2014 13:04:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-calculate-P-Value-in-SAS/m-p/181312#M265178</guid>
      <dc:creator>Ratanroy</dc:creator>
      <dc:date>2014-09-01T13:04:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate P Value in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-calculate-P-Value-in-SAS/m-p/181313#M265179</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Keshan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;could you please let me know in this scenario which method i need to use..?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ratan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Sep 2014 13:08:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-calculate-P-Value-in-SAS/m-p/181313#M265179</guid>
      <dc:creator>Ratanroy</dc:creator>
      <dc:date>2014-09-01T13:08:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate P Value in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-calculate-P-Value-in-SAS/m-p/181314#M265180</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you are trying to do Chi-square Test ,then use my Fisher Exact Test code and that is going to be only one P-value for H0:&amp;nbsp; row variable and column variable are not correlated .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Xia Keshan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Sep 2014 13:16:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-calculate-P-Value-in-SAS/m-p/181314#M265180</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2014-09-01T13:16:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate P Value in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-calculate-P-Value-in-SAS/m-p/181315#M265181</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Xia,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for the suggestion, i will use Fisher Exact test to calculate the P-value. here i am getting the overall P-value i.e 0.0109&lt;/P&gt;&lt;P&gt;Also, i am getting warning saying that Chi Square may not be a valid test . Please advice.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.JPG" class="jive-image-thumbnail jive-image" src="https://communities.sas.com/legacyfs/online/7260_Capture.JPG" width="450" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How would i calculate the individual p value for each category, One p-value for Strongly Agree, one p-value for Disagree etc. (Sorry to bother u so much)&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.JPG" class="jive-image-thumbnail jive-image" src="https://communities.sas.com/legacyfs/online/7259_Capture.JPG" width="450" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ratan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Sep 2014 14:39:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-calculate-P-Value-in-SAS/m-p/181315#M265181</guid>
      <dc:creator>Ratanroy</dc:creator>
      <dc:date>2014-09-01T14:39:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate P Value in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-calculate-P-Value-in-SAS/m-p/181316#M265182</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Oh , that is not Fish 's p-value that is still chi-squre's p-value , see Fisher's Exact Test Part of output , and also try to run my second code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt; individual p value for each category, One p-value for Strongly Agree, one p-value for Disagree&lt;/SPAN&gt;"&lt;/P&gt;&lt;P&gt;I don't understand what you mean , do you mean Risk for the first column1. I would like to leave it to&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" class="j-avatar jiveTT-hover-user" data-avatarid="1627" data-externalid="" data-presence="null" data-userid="455729" data-username="SteveDenham" href="https://communities.sas.com/people/SteveDenham" style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #0e66ba; background-color: #ffffff;"&gt;&lt;IMG alt="SteveDenham" border="0" class="jive-avatar jiveImage" data-avatarid="1627" data-height="22" data-username="SteveDenham" height="22" src="https://communities.sas.com/people/SteveDenham/avatar/22.png?a=1627" style="margin: 2px 6px 0 0; border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;" width="22" /&gt;&lt;/A&gt;&lt;SPAN style="margin: 5px 0 0; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;A _jive_internal="true" class="jiveTT-hover-user jive-username-link" data-avatarid="1627" data-externalid="" data-presence="null" data-userid="455729" data-username="SteveDenham" href="https://communities.sas.com/people/SteveDenham" id="jive-45572924963558577579186" style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #0e66ba;"&gt;SteveDenham&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; . He is an expert about statistical theory . I am going to sleep now. Bye . &lt;/P&gt;&lt;P&gt;Have a nice day.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Xia Keshan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Sep 2014 15:01:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-calculate-P-Value-in-SAS/m-p/181316#M265182</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2014-09-01T15:01:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate P Value in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-calculate-P-Value-in-SAS/m-p/181317#M265183</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What you're asking for doesn't seem to make statistical or logical sense, though perhaps its simply not clear.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The way to get multiple p-values is multiple tests, which have its own issues, from a statistical perspective.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Assuming you understand what you want to do, and it makes some sense to you here's how you might calculate it in SAS:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sort data=have;&lt;/P&gt;&lt;P&gt;by var1 var2 var3;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc freq data=have;&lt;/P&gt;&lt;P&gt;by var1 var2 var3;&lt;/P&gt;&lt;P&gt;table var4/chisquare;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Sep 2014 16:52:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-calculate-P-Value-in-SAS/m-p/181317#M265183</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2014-09-01T16:52:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate P Value in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-calculate-P-Value-in-SAS/m-p/181318#M265184</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Reeza,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have the below table. i have two machines A, B. for Felt pain field, patients are giving the feedback that how convenient the screening was.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, here i have to calculate the p value for individual fields. i.e strongly Agree, Agree etc. I am new to statistics so i am not able to interpret which test i have top use for this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.JPG" class="jive-image-thumbnail jive-image" src="https://communities.sas.com/legacyfs/online/7266_Capture.JPG" width="450" /&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ratan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Sep 2014 06:38:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-calculate-P-Value-in-SAS/m-p/181318#M265184</guid>
      <dc:creator>Ratanroy</dc:creator>
      <dc:date>2014-09-02T06:38:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate P Value in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-calculate-P-Value-in-SAS/m-p/181319#M265185</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could try this , since you only care about row variable .&lt;/P&gt;&lt;P&gt;NOTE: it tested the &lt;STRONG&gt;H0 :&amp;nbsp; proportion is 0.5&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And you'd better post it at&amp;nbsp;&amp;nbsp; &lt;A _jive_internal="true" data-containerid="2007" data-containertype="14" data-objectid="46" data-objecttype="14" href="https://communities.sas.com/community/support-communities/sas_statistical_procedures" style="color: #0e66ba; background-color: #f0f8fb;"&gt;SAS Statistical Procedures&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Steve will help you a lot .&lt;/P&gt;&lt;PRE&gt;data have;
do a='S' ,'D', 'A', 'N';
 do b='A', 'B';
&amp;nbsp; input count @@; output;
 end;
end;
cards;
7 7 3 3&amp;nbsp; 7 9 2 2
;
run;

proc freq data=have order=freq;
tables a / binomial(ac wilson exact level=1) alpha=.1;
tables a / binomial(ac wilson exact level=2) alpha=.1;
tables a / binomial(ac wilson exact level=3) alpha=.1;
tables a / binomial(ac wilson exact level=4) alpha=.1;
weight Count;
run;


&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Xia Keshan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Sep 2014 12:55:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-calculate-P-Value-in-SAS/m-p/181319#M265185</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2014-09-02T12:55:37Z</dc:date>
    </item>
  </channel>
</rss>

