<?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 obtain the standard deviation of statistics calculated using SQL aggregate functions such as count(). in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-obtain-the-standard-deviation-of-statistics-calculated/m-p/152407#M298360</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The standard deviation of a proportion is sqrt(p*(1-p)/n), where p is the estimated proportion; should be easy enough to compute from PROC SQL or otherwise.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 21 Nov 2013 21:28:09 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2013-11-21T21:28:09Z</dc:date>
    <item>
      <title>How do I obtain the standard deviation of statistics calculated using SQL aggregate functions such as count().</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-obtain-the-standard-deviation-of-statistics-calculated/m-p/152406#M298359</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello all,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can’t seem to wrap my mind around this and was wondering if anyone could help clarify things.&amp;nbsp; How do I calculate the standard deviation of calculations of SQL count data that was collapsed across observations and then how do I carry that through the calculations I’m executing in SQL?&amp;nbsp; This is hard to explain so I made an illustrative example and tried to describe clearly the calculation I’m doing and the standard deviation I’m looking for.&amp;nbsp; I have a hunch I’m overlooking some fundamental concept here.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let’s assume I have a cohort of 20 people (8 exposed, 12 unexposed) and I am interested in determining the proportion of people that had each of three procedures, stratified by exposure status.&amp;nbsp; &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;I can only see claims for 13 people here, 7 had no procedure and so don’t appear in this data table. My eventual goal is to generate the usual Table 1 comparing exposed to unexposed and including a standardized difference (of procedure rates).&amp;nbsp; Unfortunately, I can't accomplish the first step of generating standard deviation estimates.&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;My data is in the following format:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;TABLE 1. DATA_SET_A&lt;/STRONG&gt;&lt;/P&gt;&lt;TABLE align="left" border="0" cellpadding="0" cellspacing="0" height="602" style="margin-left: 6pt; margin-right: 6pt; width: 215px; height: 602px;" width="215"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="74"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;Procedure&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="65"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;Exposed&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="65"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;Subject&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="74"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;1&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="65"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;1&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="65"&gt;&lt;P&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;Person 1&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="74"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;1&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="65"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;1&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="65"&gt;&lt;P&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;Person 2&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="74"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;1&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="65"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;1&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="65"&gt;&lt;P&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;Person 3&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="74"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;1&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="65"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;1&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="65"&gt;&lt;P&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;Person 4&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="74"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;1&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="65"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;0&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="65"&gt;&lt;P&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;Person 5&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="74"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;1&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="65"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;0&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="65"&gt;&lt;P&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;Person 6&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="74"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;1&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="65"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;0&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="65"&gt;&lt;P&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;Person 7&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="74"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;1&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="65"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;0&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="65"&gt;&lt;P&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;Person 8&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="74"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;2&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="65"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;1&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="65"&gt;&lt;P&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;Person 1&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="74"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;2&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="65"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;1&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="65"&gt;&lt;P&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;Person 3&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="74"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;2&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="65"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;0&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="65"&gt;&lt;P&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;Person 6&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="74"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;2&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="65"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;0&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="65"&gt;&lt;P&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;Person 8&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="74"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;2&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="65"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;1&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="65"&gt;&lt;P&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;Person 9&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="74"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;2&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="65"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;1&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="65"&gt;&lt;P&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;Person 10&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="74"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;2&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="65"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;0&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="65"&gt;&lt;P&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;Person 11&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="74"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;2&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="65"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;1&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="65"&gt;&lt;P&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;Person 12&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="74"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;2&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="65"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;0&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="65"&gt;&lt;P&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;Person 13&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="74"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;3&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="65"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;0&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="65"&gt;&lt;P&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;Person 5&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="74"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;3&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="65"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;0&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="65"&gt;&lt;P&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;Person 8&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="74"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;3&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="65"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;1&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="65"&gt;&lt;P&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;Person 10&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="74"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;3&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="65"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;0&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="65"&gt;&lt;P&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;Person 11&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="74"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;3&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="65"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;0&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="65"&gt;&lt;P&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;Person 13&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;First, I use PROC SQL to pull population counts (stratified by exposure) from my source population, which contains records for all people [STEP 1].&lt;/LI&gt;&lt;LI&gt;Next, I use PROC SQL to collapse DATA_SET_A so each procedure is listed, for each exposure status, with the count [STEP 2].&lt;/LI&gt;&lt;LI&gt;Finally, I use LEFT JOIN to link procedure/exposure numerators with their appropriate denominators and perform the proportion calculation [STEP 3].&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Please refer to the SAS code I've pasted at the bottom of this post.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This code generates Table 2 (see below).&amp;nbsp; &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;STRONG&gt;How do obtain the standard deviations for these proportion estimates (see ? in the table below)? &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt; I don’t know how to obtain the standard deviation of a count that I’ve collapsed in SQL.&amp;nbsp; I tried using aggregate functions such as std(count(*)) AS StdDev, but SAS didn’t like that.&amp;nbsp; Do I have to obtain the standard deviation during the count step and then carry it forward or can I somehow obtain it during my proportion step?&amp;nbsp; I know how to calculate the standard deviation if I transform my dataset such that each procedure is a variable instead of having a procedure variable that aligns with the counts.&amp;nbsp; The problem is that my real problem involves hundreds of procedures so I can't switch them all over manually.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;TABLE 2. DATA_SET_B &lt;/STRONG&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" height="175" style="margin-left: 4.65pt; width: 557px; height: 168px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="52"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;Procedure&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="65"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;Exposed&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="37"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;Count&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="75"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;Denominator&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD colspan="2" nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="72"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;Proportion&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="65"&gt;&lt;OL style="list-style-type: upper-alpha;"&gt;&lt;LI&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;Std. Dev.&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="52"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;1&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="65"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;1&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="37"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;4&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="75"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;8&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="37"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;4/8&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="35"&gt;&lt;OL style="list-style-type: decimal;"&gt;&lt;LI&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;0.50&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="65"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;?&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="52"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;1&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="65"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;0&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="37"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;4&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="75"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;12&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="37"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;4/12&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="35"&gt;&lt;OL style="list-style-type: decimal;"&gt;&lt;LI&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;0.33&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="65"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;?&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="52"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;2&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="65"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;1&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="37"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;5&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="75"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;8&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="37"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;5/8&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="35"&gt;&lt;OL style="list-style-type: decimal;"&gt;&lt;LI&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;0.63&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="65"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;?&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="52"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;2&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="65"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;0&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="37"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;4&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="75"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;12&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="37"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;4/12&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="35"&gt;&lt;OL style="list-style-type: decimal;"&gt;&lt;LI&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;0.33&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="65"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;?&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="52"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;3&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="65"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;1&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="37"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;1&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="75"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;8&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="37"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;1/8&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="35"&gt;&lt;OL style="list-style-type: decimal;"&gt;&lt;LI&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;0.13&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="65"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;?&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="52"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;3&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="65"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;0&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="37"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;4&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="75"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;12&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="37"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;4/12&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="35"&gt;&lt;OL style="list-style-type: decimal;"&gt;&lt;LI&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;0.33&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="65"&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="font-family: Calibri; color: black;"&gt;?&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;Thanks for your help. Please be blunt if I’m missing something obvious.&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;CODE BELOW:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: green; background: white;"&gt;*CALCULATING THE PROPORTION OF PATIENTS THAT WERE CODED FOR EACH PROCEDURE AT LEAST ONCE IN THE FOLLOW-UP PERIOD*;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;STEP 1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: green; background: white;"&gt;*COUNTS FOR DENOMENATORS*;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&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; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: green; background: white;"&gt;*COUNT UNIQUE PATIENTS*;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;PROC&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;SQL&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="text-indent: .5in;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;CREATE&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;TABLE&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; work.Denominators &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;AS&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;SELECT&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;DISTINCT&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; exposed, count(*) &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;AS&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; Denominator&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;FROM&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; (&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;SELECT&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;DISTINCT&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; exposed, subject &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;FROM&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; work.SourcePopn)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="text-indent: .5in;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;GROUP&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;BY&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; exposed;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;QUIT&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;STEP 2&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: green; background: white;"&gt;*COUNT UP PROCEDURS FOR NUMERATOR*;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;PROC&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;SQL&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;CREATE&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;TABLE&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; work.Numerators &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;AS&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;SELECT&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;DISTINCT&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; exposed, procedure, count(*) &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;AS&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; count&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;FROM&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; (&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;SELECT&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;DISTINCT&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; subject, procedure, exposed &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;FROM&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; work.DATA_SET_A)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;GROUP&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;BY&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; exposed, procedure&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;ORDER&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;BY&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; exposed &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;DESC&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;, count &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;DESC&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;QUIT&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;STEP 3&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: green; background: white;"&gt;*THIS CODE ATTACHES THE DENOMENATOR AND DOES PROPORTION CALCULATION*;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;PROC&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;SQL&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;CREATE&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;TABLE&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; work.DATA_SET_B &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;AS&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="text-indent: .5in;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;SELECT&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; a.procedure, a.exposed, a.count, b.denominator, &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: 1.0in;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;(a.count/b.denominator) &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;AS&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; Proportion&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;FROM&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; work.Numerators &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;AS&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; a &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;LEFT&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;JOIN&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; work.Denominators &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; b&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;ON&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; a.exposed=b.exposed&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;ORDER&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;BY&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; exposed &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;DESC&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;, count &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;DESC&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;RUN&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Nov 2013 20:22:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-obtain-the-standard-deviation-of-statistics-calculated/m-p/152406#M298359</guid>
      <dc:creator>SasUser324</dc:creator>
      <dc:date>2013-11-21T20:22:23Z</dc:date>
    </item>
    <item>
      <title>Re: How do I obtain the standard deviation of statistics calculated using SQL aggregate functions such as count().</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-obtain-the-standard-deviation-of-statistics-calculated/m-p/152407#M298360</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The standard deviation of a proportion is sqrt(p*(1-p)/n), where p is the estimated proportion; should be easy enough to compute from PROC SQL or otherwise.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Nov 2013 21:28:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-obtain-the-standard-deviation-of-statistics-calculated/m-p/152407#M298360</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2013-11-21T21:28:09Z</dc:date>
    </item>
  </channel>
</rss>

