<?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 make calculations with individual values within columns? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-make-calculations-with-individual-values-within-columns/m-p/804263#M316700</link>
    <description>Hi, thanks for taking time to explain the information I'm missing from the perspective of someone trying to answer the question. You're right, there is not enough details to answer this question. Fortunately, I was able to code it using a macro that dealt with the tedious calculations. &lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Sat, 26 Mar 2022 14:08:31 GMT</pubDate>
    <dc:creator>Hello_there</dc:creator>
    <dc:date>2022-03-26T14:08:31Z</dc:date>
    <item>
      <title>How do I make calculations with individual values within columns?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-make-calculations-with-individual-values-within-columns/m-p/804189#M316649</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
infile datalines dsd dlm=",";
	input method $ stand_ $ rdr $ cnt1 cnt2 cnt3;
datalines;
a, pos, neg, 34, 29, 15
a, pos, neg, 32, 21, 19
a, neg, pos, 21, 39, 49
a, neg, neg, 20, 38, 32
;
run;

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Hi, I'm trying to have it so that I can calculate true positive, false negative, false positive, and true negative.&lt;/P&gt;
&lt;P&gt;How would I go about doing this to create a 3 new columns with 4 rows called val1 val2 val3?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So for example, I would have to do&lt;/P&gt;
&lt;P&gt;obs. &amp;nbsp; val1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;val2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; val3&lt;/P&gt;
&lt;P&gt;&amp;nbsp;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;34/(34+21). &amp;nbsp; &amp;nbsp; 29/(29+39) &amp;nbsp; &amp;nbsp; &amp;nbsp;15/(15+49)&lt;/P&gt;
&lt;P&gt;2. &amp;nbsp; &amp;nbsp; &amp;nbsp; 32/(32+20). &amp;nbsp; &amp;nbsp; &amp;nbsp;21/(21+38)&lt;/P&gt;
&lt;P&gt;3. &amp;nbsp; &amp;nbsp; &amp;nbsp; 21/(34+21)&lt;/P&gt;
&lt;P&gt;4. &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Mar 2022 21:56:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-make-calculations-with-individual-values-within-columns/m-p/804189#M316649</guid>
      <dc:creator>Hello_there</dc:creator>
      <dc:date>2022-03-25T21:56:31Z</dc:date>
    </item>
    <item>
      <title>Re: How do I make calculations with individual values within columns?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-make-calculations-with-individual-values-within-columns/m-p/804228#M316681</link>
      <description>&lt;P&gt;If the only data you have is what you show then do it by hand.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Otherwise you need to provide some more details. How do we know what value to pick as any of those denominators? How to pick the numerator?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or define exactly what a "true positive, false negative, false positive, and true negative" may be using general rules.&lt;/P&gt;
&lt;P&gt;This is one of those cases that you know a lot more (hopefully) about your data than we do and so are skipping some steps that you think are obvious. To code a solution we need to know the generic rules to apply to any data. A specific example without any description of why which values are placed where in your calculation is nearly meaningless.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;IF what you show is the result of summarizing another data set it may well be that other pre-summarized data is actually what we need to work with.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your rules should also state what the role of the Method variable might be. You don't mention why it is there at all. If it will affect the calculations we need to know how.&lt;/P&gt;</description>
      <pubDate>Sat, 26 Mar 2022 05:32:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-make-calculations-with-individual-values-within-columns/m-p/804228#M316681</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-03-26T05:32:38Z</dc:date>
    </item>
    <item>
      <title>Re: How do I make calculations with individual values within columns?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-make-calculations-with-individual-values-within-columns/m-p/804263#M316700</link>
      <description>Hi, thanks for taking time to explain the information I'm missing from the perspective of someone trying to answer the question. You're right, there is not enough details to answer this question. Fortunately, I was able to code it using a macro that dealt with the tedious calculations. &lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Sat, 26 Mar 2022 14:08:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-make-calculations-with-individual-values-within-columns/m-p/804263#M316700</guid>
      <dc:creator>Hello_there</dc:creator>
      <dc:date>2022-03-26T14:08:31Z</dc:date>
    </item>
  </channel>
</rss>

