<?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 type in a 2 by 2 table without a real data set to answer a question on hw? in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/How-Do-I-type-in-a-2-by-2-table-without-a-real-data-set-to/m-p/792741#M32676</link>
    <description>&lt;P&gt;Just type the counts in. Make sure you also create the other two variables.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data summary;
  length group result $8 count 8;
  do group='case','control';
    do result='good','bad';
      input count @@;
      output;
    end;
  end;
cards;
10 50 49 11 
;

proc freq;
  tables group*result / cmh ;
  weight count;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;The FREQ Procedure

Table of group by result

group     result

Frequency|
Percent  |
Row Pct  |
Col Pct  |bad     |good    |  Total
---------+--------+--------+
case     |     50 |     10 |     60
         |  41.67 |   8.33 |  50.00
         |  83.33 |  16.67 |
         |  81.97 |  16.95 |
---------+--------+--------+
control  |     11 |     49 |     60
         |   9.17 |  40.83 |  50.00
         |  18.33 |  81.67 |
         |  18.03 |  83.05 |
---------+--------+--------+
Total          61       59      120
            50.83    49.17   100.00

The FREQ Procedure

Summary Statistics for group by result

  Cochran-Mantel-Haenszel Statistics (Based on Table Scores)

Statistic    Alternative Hypothesis    DF       Value      Prob
---------------------------------------------------------------
    1        Nonzero Correlation        1     50.2915    &amp;lt;.0001
    2        Row Mean Scores Differ     1     50.2915    &amp;lt;.0001
    3        General Association        1     50.2915    &amp;lt;.0001


                        Common Odds Ratio and Relative Risks

Statistic                   Method                  Value       95% Confidence Limits
-------------------------------------------------------------------------------------
Odds Ratio                  Mantel-Haenszel       22.2727        8.6773       57.1693
                            Logit                 22.2727        8.6773       57.1693

Relative Risk (Column 1)    Mantel-Haenszel        4.5455        2.6333        7.8462
                            Logit                  4.5455        2.6333        7.8462

Relative Risk (Column 2)    Mantel-Haenszel        0.2041        0.1145        0.3639
                            Logit                  0.2041        0.1145        0.3639


Total Sample Size = 120
&lt;/PRE&gt;</description>
    <pubDate>Thu, 27 Jan 2022 03:58:08 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2022-01-27T03:58:08Z</dc:date>
    <item>
      <title>How Do I type in a 2 by 2 table without a real data set to answer a question on hw?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-Do-I-type-in-a-2-by-2-table-without-a-real-data-set-to/m-p/792726#M32674</link>
      <description>&lt;P&gt;Is it even possible to do in sas studio?&lt;/P&gt;&lt;P&gt;If I know all the numbers in the two by two table of a case-control study.&amp;nbsp; Could sas calculate the percentages of each number and the odds ratio?&amp;nbsp; Thank you.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jan 2022 01:33:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-Do-I-type-in-a-2-by-2-table-without-a-real-data-set-to/m-p/792726#M32674</guid>
      <dc:creator>zhawasli1</dc:creator>
      <dc:date>2022-01-27T01:33:24Z</dc:date>
    </item>
    <item>
      <title>Re: How Do I type in a 2 by 2 table without a real data set to answer a question on hw?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-Do-I-type-in-a-2-by-2-table-without-a-real-data-set-to/m-p/792740#M32675</link>
      <description>&lt;P&gt;You will need to create a small dataset with three columns: 1. columns values 2. row values, 3 cell counts.&amp;nbsp; For a 2x2 table you will have four rows with all possible combinations of row and column values: 00, 01, 10, 11.&amp;nbsp; Then run PROC FREQ with WEIGHT as cell counts.&amp;nbsp; That's it.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jan 2022 03:49:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-Do-I-type-in-a-2-by-2-table-without-a-real-data-set-to/m-p/792740#M32675</guid>
      <dc:creator>Haris</dc:creator>
      <dc:date>2022-01-27T03:49:24Z</dc:date>
    </item>
    <item>
      <title>Re: How Do I type in a 2 by 2 table without a real data set to answer a question on hw?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-Do-I-type-in-a-2-by-2-table-without-a-real-data-set-to/m-p/792741#M32676</link>
      <description>&lt;P&gt;Just type the counts in. Make sure you also create the other two variables.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data summary;
  length group result $8 count 8;
  do group='case','control';
    do result='good','bad';
      input count @@;
      output;
    end;
  end;
cards;
10 50 49 11 
;

proc freq;
  tables group*result / cmh ;
  weight count;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;The FREQ Procedure

Table of group by result

group     result

Frequency|
Percent  |
Row Pct  |
Col Pct  |bad     |good    |  Total
---------+--------+--------+
case     |     50 |     10 |     60
         |  41.67 |   8.33 |  50.00
         |  83.33 |  16.67 |
         |  81.97 |  16.95 |
---------+--------+--------+
control  |     11 |     49 |     60
         |   9.17 |  40.83 |  50.00
         |  18.33 |  81.67 |
         |  18.03 |  83.05 |
---------+--------+--------+
Total          61       59      120
            50.83    49.17   100.00

The FREQ Procedure

Summary Statistics for group by result

  Cochran-Mantel-Haenszel Statistics (Based on Table Scores)

Statistic    Alternative Hypothesis    DF       Value      Prob
---------------------------------------------------------------
    1        Nonzero Correlation        1     50.2915    &amp;lt;.0001
    2        Row Mean Scores Differ     1     50.2915    &amp;lt;.0001
    3        General Association        1     50.2915    &amp;lt;.0001


                        Common Odds Ratio and Relative Risks

Statistic                   Method                  Value       95% Confidence Limits
-------------------------------------------------------------------------------------
Odds Ratio                  Mantel-Haenszel       22.2727        8.6773       57.1693
                            Logit                 22.2727        8.6773       57.1693

Relative Risk (Column 1)    Mantel-Haenszel        4.5455        2.6333        7.8462
                            Logit                  4.5455        2.6333        7.8462

Relative Risk (Column 2)    Mantel-Haenszel        0.2041        0.1145        0.3639
                            Logit                  0.2041        0.1145        0.3639


Total Sample Size = 120
&lt;/PRE&gt;</description>
      <pubDate>Thu, 27 Jan 2022 03:58:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-Do-I-type-in-a-2-by-2-table-without-a-real-data-set-to/m-p/792741#M32676</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-01-27T03:58:08Z</dc:date>
    </item>
    <item>
      <title>Re: How Do I type in a 2 by 2 table without a real data set to answer a question on hw?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-Do-I-type-in-a-2-by-2-table-without-a-real-data-set-to/m-p/792888#M32688</link>
      <description>If I have the frequency for each cell, does that mean I type it in SAS in the two by two table?</description>
      <pubDate>Thu, 27 Jan 2022 15:33:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-Do-I-type-in-a-2-by-2-table-without-a-real-data-set-to/m-p/792888#M32688</guid>
      <dc:creator>zhawasli1</dc:creator>
      <dc:date>2022-01-27T15:33:05Z</dc:date>
    </item>
    <item>
      <title>Re: How Do I type in a 2 by 2 table without a real data set to answer a question on hw?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-Do-I-type-in-a-2-by-2-table-without-a-real-data-set-to/m-p/792889#M32689</link>
      <description>Also, why can't I copy and paste your data entry and proc onto my sas studio?</description>
      <pubDate>Thu, 27 Jan 2022 15:35:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-Do-I-type-in-a-2-by-2-table-without-a-real-data-set-to/m-p/792889#M32689</guid>
      <dc:creator>zhawasli1</dc:creator>
      <dc:date>2022-01-27T15:35:16Z</dc:date>
    </item>
    <item>
      <title>Re: How Do I type in a 2 by 2 table without a real data set to answer a question on hw?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-Do-I-type-in-a-2-by-2-table-without-a-real-data-set-to/m-p/792895#M32691</link>
      <description>&lt;BR /&gt;The FREQ Procedure&lt;BR /&gt;&lt;BR /&gt;Frequency&lt;BR /&gt;Percent&lt;BR /&gt;Row Pct&lt;BR /&gt;Col Pct&lt;BR /&gt;Table of group by result&lt;BR /&gt;group result&lt;BR /&gt;east west Total&lt;BR /&gt;notuberc&lt;BR /&gt;141&lt;BR /&gt;42.73&lt;BR /&gt;50.36&lt;BR /&gt;77.90&lt;BR /&gt;139&lt;BR /&gt;42.12&lt;BR /&gt;49.64&lt;BR /&gt;93.29&lt;BR /&gt;280&lt;BR /&gt;84.85&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;tubercul&lt;BR /&gt;40&lt;BR /&gt;12.12&lt;BR /&gt;80.00&lt;BR /&gt;22.10&lt;BR /&gt;10&lt;BR /&gt;3.03&lt;BR /&gt;20.00&lt;BR /&gt;6.71&lt;BR /&gt;50&lt;BR /&gt;15.15&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Total&lt;BR /&gt;181&lt;BR /&gt;54.85&lt;BR /&gt;149&lt;BR /&gt;45.15&lt;BR /&gt;330&lt;BR /&gt;100.00&lt;BR /&gt;Summary Statistics for group by result&lt;BR /&gt;&lt;BR /&gt;Cochran-Mantel-Haenszel Statistics (Based on Table Scores)&lt;BR /&gt;Statistic Alternative Hypothesis DF Value Prob&lt;BR /&gt;1 Nonzero Correlation 1 15.0072 0.0001&lt;BR /&gt;2 Row Mean Scores Differ 1 15.0072 0.0001&lt;BR /&gt;3 General Association 1 15.0072 0.0001&lt;BR /&gt;Common Odds Ratio and Relative Risks&lt;BR /&gt;Statistic Method Value 95% Confidence Limits&lt;BR /&gt;Odds Ratio Mantel-Haenszel 0.2536 0.1220 0.5270&lt;BR /&gt;Logit 0.2536 0.1220 0.5270&lt;BR /&gt;Relative Risk (Column 1) Mantel-Haenszel 0.6295 0.5253 0.7543&lt;BR /&gt;Logit 0.6295 0.5253 0.7543&lt;BR /&gt;Relative Risk (Column 2) Mantel-Haenszel 2.4821 1.4082 4.3750&lt;BR /&gt;Logit 2.4821 1.4082 4.3750&lt;BR /&gt;Total Sample Size = 330</description>
      <pubDate>Thu, 27 Jan 2022 15:43:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-Do-I-type-in-a-2-by-2-table-without-a-real-data-set-to/m-p/792895#M32691</guid>
      <dc:creator>zhawasli1</dc:creator>
      <dc:date>2022-01-27T15:43:08Z</dc:date>
    </item>
    <item>
      <title>Re: How Do I type in a 2 by 2 table without a real data set to answer a question on hw?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-Do-I-type-in-a-2-by-2-table-without-a-real-data-set-to/m-p/792900#M32693</link>
      <description>NVMInd I figured it out&lt;BR /&gt;</description>
      <pubDate>Thu, 27 Jan 2022 15:57:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-Do-I-type-in-a-2-by-2-table-without-a-real-data-set-to/m-p/792900#M32693</guid>
      <dc:creator>zhawasli1</dc:creator>
      <dc:date>2022-01-27T15:57:54Z</dc:date>
    </item>
  </channel>
</rss>

