<?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 input grouped data into SAS in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-input-grouped-data-into-SAS/m-p/772550#M245310</link>
    <description>&lt;P&gt;How about this...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data example;
   do trt = 'Placebo','Drug';
      do outcome = 'Sick','Well';
         input count @;
         output;
         end;
      end;
   stop;
   datalines;
30 10
15 40
;;;;
   run;
proc print;
   run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2021-10-06 143018.png" style="width: 186px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/64424i912837AC86DB33A3/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2021-10-06 143018.png" alt="Screenshot 2021-10-06 143018.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 06 Oct 2021 19:32:34 GMT</pubDate>
    <dc:creator>data_null__</dc:creator>
    <dc:date>2021-10-06T19:32:34Z</dc:date>
    <item>
      <title>How to input grouped data into SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-input-grouped-data-into-SAS/m-p/772538#M245304</link>
      <description>&lt;P&gt;I want to input this information into SAS&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="h.PNG" style="width: 273px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/64422iCC8D2B01F470D430/image-size/large?v=v2&amp;amp;px=999" role="button" title="h.PNG" alt="h.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;So far I have&amp;nbsp;&lt;/P&gt;&lt;P&gt;data RCT;&lt;/P&gt;&lt;P&gt;input treatment $ outcome $;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm not sure how to enter the information under datalines, and I'm not sure if I have the input statement in correctly. How do I go about doing this?&lt;/P&gt;</description>
      <pubDate>Wed, 06 Oct 2021 19:12:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-input-grouped-data-into-SAS/m-p/772538#M245304</guid>
      <dc:creator>westbestern</dc:creator>
      <dc:date>2021-10-06T19:12:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to input grouped data into SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-input-grouped-data-into-SAS/m-p/772545#M245307</link>
      <description>You have two column headers in your INPUT but three in the table....&lt;BR /&gt;Type the data below the INPUT statement separated by a single space with 4 semicolons to end the lines. Note that $ indicates a character variable, ie values like A, B, C. If you read in your numbers as characters you cannot do math on those fields.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;data want;&lt;BR /&gt;input trt sick well;&lt;BR /&gt;cards;&lt;BR /&gt;1 5 6&lt;BR /&gt;2 5 30&lt;BR /&gt;;;;;;&lt;BR /&gt;run;</description>
      <pubDate>Wed, 06 Oct 2021 19:21:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-input-grouped-data-into-SAS/m-p/772545#M245307</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-10-06T19:21:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to input grouped data into SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-input-grouped-data-into-SAS/m-p/772550#M245310</link>
      <description>&lt;P&gt;How about this...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data example;
   do trt = 'Placebo','Drug';
      do outcome = 'Sick','Well';
         input count @;
         output;
         end;
      end;
   stop;
   datalines;
30 10
15 40
;;;;
   run;
proc print;
   run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2021-10-06 143018.png" style="width: 186px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/64424i912837AC86DB33A3/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2021-10-06 143018.png" alt="Screenshot 2021-10-06 143018.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Oct 2021 19:32:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-input-grouped-data-into-SAS/m-p/772550#M245310</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2021-10-06T19:32:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to input grouped data into SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-input-grouped-data-into-SAS/m-p/772551#M245311</link>
      <description>&lt;P&gt;It may help to decide/ show what the output data set looks like or tell us how you expect to use the data.&lt;/P&gt;
&lt;P&gt;This looks like a summary table where the numbers are likely counts of the outcome.&lt;/P&gt;
&lt;P&gt;If this were my data, and that is all there is perhaps:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data want;
   input treatment $ outcome $ count;
datalines;
Placebo  Sick 30
Placebo  Well 10
Drug     Sick 15
Drug     Well 40
;
&lt;/PRE&gt;
&lt;P&gt;In many forms of analysis a variable that indicates the number of results, using either a WEIGHT or FREQ statement will use the count.&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;PRE&gt;Proc freq data=want;
   tables treatment*outcome/ chisq expected;
   weight count;
run;&lt;/PRE&gt;
&lt;P&gt;Which generates a table of the counts comparing treatment and outcome, with percentages, the expected count if there were no differences in the distribution of outcomes between the two treatments and a chi-squared test for similarity of distribution (not similar in this case).&lt;/P&gt;</description>
      <pubDate>Wed, 06 Oct 2021 19:32:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-input-grouped-data-into-SAS/m-p/772551#M245311</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-10-06T19:32:59Z</dc:date>
    </item>
  </channel>
</rss>

