<?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: match data find means in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/match-data-find-means/m-p/127177#M25932</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;From the little I understand, I looks like you want to do this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data test;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;input firm $ year industry disclose;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;datalines; &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;a 2000 1 0 &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;a 2001 1 0 &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;b 2000 1 0 &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;c 2001 1 0 &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;d 2001 2 0 &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;d 2002 2 0 &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;e 2001 2 0 &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;a 2002 1 1 &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;a 2003 1 1 &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;b 2001 1 1 &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;c 2000 1 1 &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;c 2002 1 1 &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;c 2003 1 1 &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;c 2004 1 1 &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;d 2002 2 1 &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;e 2002 2 1 &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;e 2003 2 1 &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;e 2004 2 1 &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc sql;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;create table disc as&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;select t1.disclose, t1.industry, t1.firm, t1.year, &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mean(t2.disclose) as meanCompetitorDisclosure&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;from test as t1 left join test as t2&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; on t1.year=t2.year and t1.industry=t2.industry and t1.firm ne t2.firm&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;group by t1.disclose, t1.industry, t1.firm, t1.year;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;select * from disc;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;quit;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc ttest data=disc;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;class disclose;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;var&amp;nbsp; meanCompetitorDisclosure;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 03 Sep 2013 02:24:00 GMT</pubDate>
    <dc:creator>PGStats</dc:creator>
    <dc:date>2013-09-03T02:24:00Z</dc:date>
    <item>
      <title>match data find means</title>
      <link>https://communities.sas.com/t5/SAS-Programming/match-data-find-means/m-p/127173#M25928</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;My unit of analysis is firm-year. main interest is variable disclose (binary 0,1). &lt;/P&gt;&lt;P&gt;First, I will partition the sample into two sets : set ONE contains firm-year observations that have disclose=0, and&amp;nbsp; set TWO contains firm-year observations that have disclose=1,&lt;/P&gt;&lt;P&gt;What I want to know is : for set ONE observations that share the same industry code with set ONE observations, what is the mean value of disclose, &lt;/P&gt;&lt;P&gt;Similarly, for set TWO observations that share the same industry code with set ONE observations, what is the mean value of disclose,&lt;/P&gt;&lt;P&gt;that is, I try to show whether industry peers in set ONE are more or less likely to disclose compared with industry peers in set TWO. &lt;/P&gt;&lt;P&gt;What would be the best way of coding this? Attached is hypothetical data. Feel free to expand it. &lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="margin-left: 4.65pt;" width="187"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="33"&gt;&lt;P align="center" style="margin-bottom: .0001pt; text-align: center;"&gt;&lt;SPAN style="color: black;"&gt;firm&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="margin-bottom: .0001pt; text-align: center;"&gt;&lt;SPAN style="color: black;"&gt;year&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="59"&gt;&lt;P align="center" style="margin-bottom: .0001pt; text-align: center;"&gt;&lt;SPAN style="color: black;"&gt;industry&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="57"&gt;&lt;P align="center" style="margin-bottom: .0001pt; text-align: center;"&gt;&lt;SPAN style="color: black;"&gt;disclose&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="33"&gt;&lt;P align="center" style="margin-bottom: .0001pt; text-align: center;"&gt;&lt;SPAN style="color: black;"&gt;a&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="margin-bottom: .0001pt; text-align: center;"&gt;&lt;SPAN style="color: black;"&gt;2000&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="59"&gt;&lt;P align="center" style="margin-bottom: .0001pt; text-align: center;"&gt;&lt;SPAN style="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="57"&gt;&lt;P align="center" style="margin-bottom: .0001pt; text-align: center;"&gt;&lt;SPAN style="color: black;"&gt;0&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="33"&gt;&lt;P align="center" style="margin-bottom: .0001pt; text-align: center;"&gt;&lt;SPAN style="color: black;"&gt;a&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="margin-bottom: .0001pt; text-align: center;"&gt;&lt;SPAN style="color: black;"&gt;2001&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="59"&gt;&lt;P align="center" style="margin-bottom: .0001pt; text-align: center;"&gt;&lt;SPAN style="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="57"&gt;&lt;P align="center" style="margin-bottom: .0001pt; text-align: center;"&gt;&lt;SPAN style="color: black;"&gt;0&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="33"&gt;&lt;P align="center" style="margin-bottom: .0001pt; text-align: center;"&gt;&lt;SPAN style="color: black;"&gt;a&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="margin-bottom: .0001pt; text-align: center;"&gt;&lt;SPAN style="color: black;"&gt;2002&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="59"&gt;&lt;P align="center" style="margin-bottom: .0001pt; text-align: center;"&gt;&lt;SPAN style="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="57"&gt;&lt;P align="center" style="margin-bottom: .0001pt; text-align: center;"&gt;&lt;SPAN style="color: black;"&gt;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="33"&gt;&lt;P align="center" style="margin-bottom: .0001pt; text-align: center;"&gt;&lt;SPAN style="color: black;"&gt;a&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="margin-bottom: .0001pt; text-align: center;"&gt;&lt;SPAN style="color: black;"&gt;2003&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="59"&gt;&lt;P align="center" style="margin-bottom: .0001pt; text-align: center;"&gt;&lt;SPAN style="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="57"&gt;&lt;P align="center" style="margin-bottom: .0001pt; text-align: center;"&gt;&lt;SPAN style="color: black;"&gt;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="33"&gt;&lt;P align="center" style="margin-bottom: .0001pt; text-align: center;"&gt;&lt;SPAN style="color: black;"&gt;b&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="margin-bottom: .0001pt; text-align: center;"&gt;&lt;SPAN style="color: black;"&gt;2000&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="59"&gt;&lt;P align="center" style="margin-bottom: .0001pt; text-align: center;"&gt;&lt;SPAN style="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="57"&gt;&lt;P align="center" style="margin-bottom: .0001pt; text-align: center;"&gt;&lt;SPAN style="color: black;"&gt;0&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="33"&gt;&lt;P align="center" style="margin-bottom: .0001pt; text-align: center;"&gt;&lt;SPAN style="color: black;"&gt;b&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="margin-bottom: .0001pt; text-align: center;"&gt;&lt;SPAN style="color: black;"&gt;2001&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="59"&gt;&lt;P align="center" style="margin-bottom: .0001pt; text-align: center;"&gt;&lt;SPAN style="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="57"&gt;&lt;P align="center" style="margin-bottom: .0001pt; text-align: center;"&gt;&lt;SPAN style="color: black;"&gt;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="33"&gt;&lt;P align="center" style="margin-bottom: .0001pt; text-align: center;"&gt;&lt;SPAN style="color: black;"&gt;c&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="margin-bottom: .0001pt; text-align: center;"&gt;&lt;SPAN style="color: black;"&gt;2001&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="59"&gt;&lt;P align="center" style="margin-bottom: .0001pt; text-align: center;"&gt;&lt;SPAN style="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="57"&gt;&lt;P align="center" style="margin-bottom: .0001pt; text-align: center;"&gt;&lt;SPAN style="color: black;"&gt;0&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="33"&gt;&lt;P align="center" style="margin-bottom: .0001pt; text-align: center;"&gt;&lt;SPAN style="color: black;"&gt;c&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="margin-bottom: .0001pt; text-align: center;"&gt;&lt;SPAN style="color: black;"&gt;2002&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="59"&gt;&lt;P align="center" style="margin-bottom: .0001pt; text-align: center;"&gt;&lt;SPAN style="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="57"&gt;&lt;P align="center" style="margin-bottom: .0001pt; text-align: center;"&gt;&lt;SPAN style="color: black;"&gt;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="33"&gt;&lt;P align="center" style="margin-bottom: .0001pt; text-align: center;"&gt;&lt;SPAN style="color: black;"&gt;c&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="margin-bottom: .0001pt; text-align: center;"&gt;&lt;SPAN style="color: black;"&gt;2003&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="59"&gt;&lt;P align="center" style="margin-bottom: .0001pt; text-align: center;"&gt;&lt;SPAN style="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="57"&gt;&lt;P align="center" style="margin-bottom: .0001pt; text-align: center;"&gt;&lt;SPAN style="color: black;"&gt;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="33"&gt;&lt;P align="center" style="margin-bottom: .0001pt; text-align: center;"&gt;&lt;SPAN style="color: black;"&gt;c&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="margin-bottom: .0001pt; text-align: center;"&gt;&lt;SPAN style="color: black;"&gt;2004&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="59"&gt;&lt;P align="center" style="margin-bottom: .0001pt; text-align: center;"&gt;&lt;SPAN style="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="57"&gt;&lt;P align="center" style="margin-bottom: .0001pt; text-align: center;"&gt;&lt;SPAN style="color: black;"&gt;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="33"&gt;&lt;P align="center" style="margin-bottom: .0001pt; text-align: center;"&gt;&lt;SPAN style="color: black;"&gt;d&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="margin-bottom: .0001pt; text-align: center;"&gt;&lt;SPAN style="color: black;"&gt;2001&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="59"&gt;&lt;P align="center" style="margin-bottom: .0001pt; text-align: center;"&gt;&lt;SPAN style="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="57"&gt;&lt;P align="center" style="margin-bottom: .0001pt; text-align: center;"&gt;&lt;SPAN style="color: black;"&gt;0&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="33"&gt;&lt;P align="center" style="margin-bottom: .0001pt; text-align: center;"&gt;&lt;SPAN style="color: black;"&gt;d&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="margin-bottom: .0001pt; text-align: center;"&gt;&lt;SPAN style="color: black;"&gt;2002&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="59"&gt;&lt;P align="center" style="margin-bottom: .0001pt; text-align: center;"&gt;&lt;SPAN style="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="57"&gt;&lt;P align="center" style="margin-bottom: .0001pt; text-align: center;"&gt;&lt;SPAN style="color: black;"&gt;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="33"&gt;&lt;P align="center" style="margin-bottom: .0001pt; text-align: center;"&gt;&lt;SPAN style="color: black;"&gt;d&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="margin-bottom: .0001pt; text-align: center;"&gt;&lt;SPAN style="color: black;"&gt;2003&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="59"&gt;&lt;P align="center" style="margin-bottom: .0001pt; text-align: center;"&gt;&lt;SPAN style="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="57"&gt;&lt;P align="center" style="margin-bottom: .0001pt; text-align: center;"&gt;&lt;SPAN style="color: black;"&gt;0&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="33"&gt;&lt;P align="center" style="margin-bottom: .0001pt; text-align: center;"&gt;&lt;SPAN style="color: black;"&gt;e&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="margin-bottom: .0001pt; text-align: center;"&gt;&lt;SPAN style="color: black;"&gt;2001&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="59"&gt;&lt;P align="center" style="margin-bottom: .0001pt; text-align: center;"&gt;&lt;SPAN style="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="57"&gt;&lt;P align="center" style="margin-bottom: .0001pt; text-align: center;"&gt;&lt;SPAN style="color: black;"&gt;0&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="33"&gt;&lt;P align="center" style="margin-bottom: .0001pt; text-align: center;"&gt;&lt;SPAN style="color: black;"&gt;e&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="margin-bottom: .0001pt; text-align: center;"&gt;&lt;SPAN style="color: black;"&gt;2002&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="59"&gt;&lt;P align="center" style="margin-bottom: .0001pt; text-align: center;"&gt;&lt;SPAN style="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="57"&gt;&lt;P align="center" style="margin-bottom: .0001pt; text-align: center;"&gt;&lt;SPAN style="color: black;"&gt;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="33"&gt;&lt;P align="center" style="margin-bottom: .0001pt; text-align: center;"&gt;&lt;SPAN style="color: black;"&gt;e&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="margin-bottom: .0001pt; text-align: center;"&gt;&lt;SPAN style="color: black;"&gt;2003&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="59"&gt;&lt;P align="center" style="margin-bottom: .0001pt; text-align: center;"&gt;&lt;SPAN style="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="57"&gt;&lt;P align="center" style="margin-bottom: .0001pt; text-align: center;"&gt;&lt;SPAN style="color: black;"&gt;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="33"&gt;&lt;P align="center" style="margin-bottom: .0001pt; text-align: center;"&gt;&lt;SPAN style="color: black;"&gt;e&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="margin-bottom: .0001pt; text-align: center;"&gt;&lt;SPAN style="color: black;"&gt;2004&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="padding: 0 5.4pt 0 5.4pt;" valign="bottom" width="59"&gt;&lt;P align="center" style="margin-bottom: .0001pt; text-align: center;"&gt;&lt;SPAN style="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="57"&gt;&lt;P align="center" style="margin-bottom: .0001pt; text-align: center;"&gt;&lt;SPAN style="color: black;"&gt;1&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;Lan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 01 Sep 2013 01:46:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/match-data-find-means/m-p/127173#M25928</guid>
      <dc:creator>LanMin</dc:creator>
      <dc:date>2013-09-01T01:46:41Z</dc:date>
    </item>
    <item>
      <title>Re: match data find means</title>
      <link>https://communities.sas.com/t5/SAS-Programming/match-data-find-means/m-p/127174#M25929</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It sounds like splitting the data is too drastic a step.&amp;nbsp; For example, the mean DISCLOSE for any subset of ONE observations has to be 0.&amp;nbsp; And the mean DISCLOSE for any subset of TWO observations has to be 1.&amp;nbsp; Maybe a better starting point would be to create two summaries:&amp;nbsp; which industry codes have any DISCLOSE=0 observations, and which industry codes have any DISCLOSE=1 observations.&amp;nbsp; It's a little unclear to me whether that should be at the industry code level or the industry code + year level.&amp;nbsp; At any rate, if you were to take your sample data and show what numbers you would like to end up with, that would help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 01 Sep 2013 15:25:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/match-data-find-means/m-p/127174#M25929</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2013-09-01T15:25:29Z</dc:date>
    </item>
    <item>
      <title>Re: match data find means</title>
      <link>https://communities.sas.com/t5/SAS-Programming/match-data-find-means/m-p/127175#M25930</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi LanMin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is this what you are trying to achieve?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROC MEANS DATA=HAVE NONOBS NOPRINT NWAY MISSING;&lt;/P&gt;&lt;P&gt;CLASS INDUSTRY;&lt;/P&gt;&lt;P&gt;VAR DISCLOSE;&lt;/P&gt;&lt;P&gt;OUTPUT OUT=WANT (DROP =_:) MEAN=;&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Scott&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Sep 2013 05:10:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/match-data-find-means/m-p/127175#M25930</guid>
      <dc:creator>Scott_Mitchell</dc:creator>
      <dc:date>2013-09-02T05:10:24Z</dc:date>
    </item>
    <item>
      <title>Re: match data find means</title>
      <link>https://communities.sas.com/t5/SAS-Programming/match-data-find-means/m-p/127176#M25931</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks to both of you. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Scott, your code is not what I want exactly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i paste my question again here, and give an example (see ********** in the end):&lt;/P&gt;&lt;P&gt;My unit of analysis is firm-year. main interest is variable disclose (binary 0,1). &lt;/P&gt;&lt;P&gt;First, I will partition the sample into two sets : set ONE contains firm-year observations that have disclose=0, and&amp;nbsp; set TWO contains firm-year observations that have disclose=1,&lt;/P&gt;&lt;P&gt;What I want to know is : for set ONE observations that share the same industry code with set ONE observations, what is the mean value of disclose, &lt;/P&gt;&lt;P&gt;Similarly, for set TWO observations that share the same industry code with set ONE observations, what is the mean value of disclose,&lt;/P&gt;&lt;P&gt;that is, I try to show whether industry peers in set ONE are more or less likely to disclose compared with industry peers in set TWO. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;***************&lt;/P&gt;&lt;P&gt;example:&lt;/P&gt;&lt;P&gt;My original data would be partition into &lt;/P&gt;&lt;P&gt;disclose =0&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="256"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl63" height="20" width="64"&gt;firm&lt;/TD&gt;&lt;TD class="xl63" width="64"&gt;year&lt;/TD&gt;&lt;TD class="xl63" width="64"&gt;industry&lt;/TD&gt;&lt;TD class="xl63" width="64"&gt;disclose&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="20"&gt;a&lt;/TD&gt;&lt;TD class="xl63"&gt;2000&lt;/TD&gt;&lt;TD class="xl63"&gt;1&lt;/TD&gt;&lt;TD class="xl63"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="20"&gt;a&lt;/TD&gt;&lt;TD class="xl63"&gt;2001&lt;/TD&gt;&lt;TD class="xl63"&gt;1&lt;/TD&gt;&lt;TD class="xl63"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="20"&gt;b&lt;/TD&gt;&lt;TD class="xl63"&gt;2000&lt;/TD&gt;&lt;TD class="xl63"&gt;1&lt;/TD&gt;&lt;TD class="xl63"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="20"&gt;c&lt;/TD&gt;&lt;TD class="xl63"&gt;2001&lt;/TD&gt;&lt;TD class="xl63"&gt;1&lt;/TD&gt;&lt;TD class="xl63"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="20"&gt;d&lt;/TD&gt;&lt;TD class="xl63"&gt;2001&lt;/TD&gt;&lt;TD class="xl63"&gt;2&lt;/TD&gt;&lt;TD class="xl63"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="20"&gt;d&lt;/TD&gt;&lt;TD class="xl63"&gt;2002&lt;/TD&gt;&lt;TD class="xl63"&gt;2&lt;/TD&gt;&lt;TD class="xl63"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="20"&gt;e&lt;/TD&gt;&lt;TD class="xl63"&gt;2001&lt;/TD&gt;&lt;TD class="xl63"&gt;2&lt;/TD&gt;&lt;TD class="xl63"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;disclose =1&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="256"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl65" height="20" width="64"&gt;firm&lt;/TD&gt;&lt;TD class="xl65" width="64"&gt;year&lt;/TD&gt;&lt;TD class="xl65" width="64"&gt;industry&lt;/TD&gt;&lt;TD class="xl65" width="64"&gt;disclose&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;a&lt;/TD&gt;&lt;TD class="xl65"&gt;2002&lt;/TD&gt;&lt;TD class="xl65"&gt;1&lt;/TD&gt;&lt;TD class="xl65"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;a&lt;/TD&gt;&lt;TD class="xl65"&gt;2003&lt;/TD&gt;&lt;TD class="xl65"&gt;1&lt;/TD&gt;&lt;TD class="xl65"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;b&lt;/TD&gt;&lt;TD class="xl65"&gt;2001&lt;/TD&gt;&lt;TD class="xl65"&gt;1&lt;/TD&gt;&lt;TD class="xl65"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;c&lt;/TD&gt;&lt;TD class="xl65"&gt;2000&lt;/TD&gt;&lt;TD class="xl65"&gt;1&lt;/TD&gt;&lt;TD class="xl65"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;c&lt;/TD&gt;&lt;TD class="xl65"&gt;2002&lt;/TD&gt;&lt;TD class="xl65"&gt;1&lt;/TD&gt;&lt;TD class="xl65"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;c&lt;/TD&gt;&lt;TD class="xl65"&gt;2003&lt;/TD&gt;&lt;TD class="xl65"&gt;1&lt;/TD&gt;&lt;TD class="xl65"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;c&lt;/TD&gt;&lt;TD class="xl65"&gt;2004&lt;/TD&gt;&lt;TD class="xl65"&gt;1&lt;/TD&gt;&lt;TD class="xl65"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;d&lt;/TD&gt;&lt;TD class="xl65"&gt;2002&lt;/TD&gt;&lt;TD class="xl65"&gt;2&lt;/TD&gt;&lt;TD class="xl65"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;e&lt;/TD&gt;&lt;TD class="xl65"&gt;2002&lt;/TD&gt;&lt;TD class="xl65"&gt;2&lt;/TD&gt;&lt;TD class="xl65"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;e&lt;/TD&gt;&lt;TD class="xl65"&gt;2003&lt;/TD&gt;&lt;TD class="xl65"&gt;2&lt;/TD&gt;&lt;TD class="xl65"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;e&lt;/TD&gt;&lt;TD class="xl65"&gt;2004&lt;/TD&gt;&lt;TD class="xl65"&gt;2&lt;/TD&gt;&lt;TD class="xl65"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for firm a in year 2000, industry=1, it has 2 competitors in year 2000, b and c, b's disclose=0 and c's disclose=1, so what I want is to output the average&amp;nbsp; disclose value of these two competitors as 0.5. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what I want as final results is a table with mean values in 2 cells below,&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 330px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl65" height="20" width="182"&gt; &lt;/TD&gt;&lt;TD class="xl66" style="border-left: none;" width="74"&gt;disclose =1&lt;/TD&gt;&lt;TD class="xl66" style="border-left: none;" width="74"&gt;disclose =0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl67" height="20" style="border-top: none;"&gt;peers average diclose value&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt; &lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&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;then do a t-test&amp;nbsp; to see if peers are more or less likely to disclose in each subsample (i.e. disclose =1 vs. disclose =0 subset)..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks,&lt;/P&gt;&lt;P&gt;Lan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Sep 2013 14:56:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/match-data-find-means/m-p/127176#M25931</guid>
      <dc:creator>LanMin</dc:creator>
      <dc:date>2013-09-02T14:56:22Z</dc:date>
    </item>
    <item>
      <title>Re: match data find means</title>
      <link>https://communities.sas.com/t5/SAS-Programming/match-data-find-means/m-p/127177#M25932</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;From the little I understand, I looks like you want to do this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data test;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;input firm $ year industry disclose;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;datalines; &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;a 2000 1 0 &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;a 2001 1 0 &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;b 2000 1 0 &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;c 2001 1 0 &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;d 2001 2 0 &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;d 2002 2 0 &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;e 2001 2 0 &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;a 2002 1 1 &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;a 2003 1 1 &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;b 2001 1 1 &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;c 2000 1 1 &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;c 2002 1 1 &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;c 2003 1 1 &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;c 2004 1 1 &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;d 2002 2 1 &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;e 2002 2 1 &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;e 2003 2 1 &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;e 2004 2 1 &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc sql;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;create table disc as&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;select t1.disclose, t1.industry, t1.firm, t1.year, &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mean(t2.disclose) as meanCompetitorDisclosure&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;from test as t1 left join test as t2&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; on t1.year=t2.year and t1.industry=t2.industry and t1.firm ne t2.firm&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;group by t1.disclose, t1.industry, t1.firm, t1.year;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;select * from disc;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;quit;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc ttest data=disc;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;class disclose;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;var&amp;nbsp; meanCompetitorDisclosure;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Sep 2013 02:24:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/match-data-find-means/m-p/127177#M25932</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2013-09-03T02:24:00Z</dc:date>
    </item>
    <item>
      <title>Re: match data find means</title>
      <link>https://communities.sas.com/t5/SAS-Programming/match-data-find-means/m-p/127178#M25933</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks so much PG !!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Sep 2013 13:12:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/match-data-find-means/m-p/127178#M25933</guid>
      <dc:creator>LanMin</dc:creator>
      <dc:date>2013-09-04T13:12:13Z</dc:date>
    </item>
  </channel>
</rss>

