<?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: Coding for 2 Regressions in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Coding-for-2-Regressions/m-p/204059#M50849</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In your first step you are using a set statement and an input statement (that reads from the cards section).&lt;/P&gt;&lt;P&gt;With this code you are basically merging row-by-row etr.combined and the 5 rows that you have in cards.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;In etr,combined&lt;/STRONG&gt; the variable &lt;STRONG&gt;fpi is already defined as character&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;Probably you want to rename this variable in the etr.combined dataset or use some other name in the input statement.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 28 Apr 2015 09:46:21 GMT</pubDate>
    <dc:creator>gergely_batho</dc:creator>
    <dc:date>2015-04-28T09:46:21Z</dc:date>
    <item>
      <title>Coding for 2 Regressions</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Coding-for-2-Regressions/m-p/204058#M50848</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.8000001907349px; background-color: #ffffff;"&gt;Hello SAS support,&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.8000001907349px; background-color: #ffffff;"&gt;Step 3 of the following code is not working.&amp;nbsp; I want fqtr=4 and fpi=9.&amp;nbsp; The first 2 steps work fine, but the problem is with the 3rd step (fpi=9).&amp;nbsp; SAS gives me an error message saying ERROR: WHERE clause operator requires compatible variables.&amp;nbsp; If this gets fixed, then I would think the rest of this code would work.&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.8000001907349px; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Arial',sans-serif; color: #222222;"&gt;data etr.d;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Arial',sans-serif; color: #222222;"&gt;set etr.combined;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Arial',sans-serif; color: #222222;"&gt;input permno fqtr fpi fyear rdq date9.;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Arial',sans-serif; color: #222222;"&gt;cards;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Arial',sans-serif; color: #222222;"&gt;10001 2 9 2012 05jul2014&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Arial',sans-serif; color: #222222;"&gt;10001 4 9 2010 08nov2015&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Arial',sans-serif; color: #222222;"&gt;10002 4 9 2009 09oct2015&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Arial',sans-serif; color: #222222;"&gt;10003 1 9 2012 002jan2015&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Arial',sans-serif; color: #222222;"&gt;10004 4 9 2013 01Dec2015&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Arial',sans-serif; color: #222222;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Arial',sans-serif; color: #222222;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Arial',sans-serif; color: #222222;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Arial',sans-serif; color: #222222;"&gt;data etr.e;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Arial',sans-serif; color: #222222;"&gt;set etr.d(where=(fqtr=4));&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Arial',sans-serif; color: #222222;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Arial',sans-serif; color: #222222;"&gt;data etr.f;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Arial',sans-serif; color: #222222;"&gt;set etr.e(where=(fpi=9));&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Arial',sans-serif; color: #222222;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Arial',sans-serif; color: #222222;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Arial',sans-serif; color: #222222;"&gt;proc sort data=etr.f; by permno rdq;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Arial',sans-serif; color: #222222;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Arial',sans-serif; color: #222222;"&gt;proc sort data=etr.e; by permno rdq;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Arial',sans-serif; color: #222222;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Arial',sans-serif; color: #222222;"&gt;proc sort data=etr.crspmont; by permno;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Arial',sans-serif; color: #222222;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Arial',sans-serif; color: #222222;"&gt;data etr.g;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Arial',sans-serif; color: #222222;"&gt;merge etr.f etr.e etr.crspmont;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Arial',sans-serif; color: #222222;"&gt;by permno;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Arial',sans-serif; color: #222222;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.8000001907349px; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.8000001907349px; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.8000001907349px; background-color: #ffffff;"&gt;After the step above works, I need to calculate the 3 highlighted items from the models below.&amp;nbsp; Then, I will need to merge these 3 calculations into the etr.combined dataset by permno.&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.8000001907349px; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P&gt;Model 1 = Analyst’s Forecast Errors = β&lt;SUB&gt;1&lt;/SUB&gt;Dummy ETR + β&lt;SUB&gt;2&lt;/SUB&gt;SIZE + β&lt;SUB&gt;3&lt;/SUB&gt;COV + β&lt;SUB&gt;4&lt;/SUB&gt;EVOL + β&lt;SUB&gt;5&lt;/SUB&gt;RETVOL + β&lt;SUB&gt;6&lt;/SUB&gt;ROA + β&lt;SUB&gt;7&lt;/SUB&gt;EP + β&lt;SUB&gt;8&lt;/SUB&gt;EPxD&lt;SUB&gt;EP&lt;/SUB&gt; + β&lt;SUB&gt;9&lt;/SUB&gt;BM + β&lt;SUB&gt;10&lt;/SUB&gt;SGR + β&lt;SUB&gt;11&lt;/SUB&gt;Change in PPE + β&lt;SUB&gt;12&lt;/SUB&gt;RET12 + β&lt;SUB&gt;13&lt;/SUB&gt;ACC&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Analyst’s Forecast Errors = Earnings/price (E/P) ratio less the median analysts’ E/P forecast made 8 months before fiscal year-end, divided by the closing share price at the prior year-end, which is formalized below: &lt;/P&gt;&lt;P&gt;Analyst’s Forecast Errors = ((NI/CSHO) – MEDEST)/PRCC_F 1 year before FYEAR&lt;/P&gt;&lt;P&gt;If MEASURE =”EPS”&lt;/P&gt;&lt;P&gt;If FISCALP = “ANN”&lt;/P&gt;&lt;P&gt;If month(datadate) = 12 and month (statpers) ne 4 then delete;&lt;/P&gt;&lt;P&gt;If month(datadate) = 11 and month (statpers) ne 3 then delete;&lt;/P&gt;&lt;P&gt;If month(datadate) = 10 and month (statpers) ne 2 then delete;&lt;/P&gt;&lt;P&gt;If month(datadate) = 9 and month (statpers) ne 1 then delete;&lt;/P&gt;&lt;P&gt;If month(datadate) = 8 and month (statpers) ne 12 then delete;&lt;/P&gt;&lt;P&gt;If month(datadate) = 7 and month (statpers) ne 11 then delete;&lt;/P&gt;&lt;P&gt;If month(datadate) = 6 and month (statpers) ne 10 then delete;&lt;/P&gt;&lt;P&gt;If month(datadate) = 5 and month (statpers) ne 9 then delete;&lt;/P&gt;&lt;P&gt;If month(datadate) = 4 and month (statpers) ne 8 then delete;&lt;/P&gt;&lt;P&gt;If month(datadate) = 3 and month (statpers) ne 7 then delete;&lt;/P&gt;&lt;P&gt;If month(datadate) = 2 and month (statpers) ne 6 then delete;&lt;/P&gt;&lt;P&gt;If month(datadate) = 1 and month (statpers) ne 5 then delete;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dummy ETR = Conditions that need to be met (FISCALP=”ANN”):&lt;/P&gt;&lt;OL style="list-style-type: upper-alpha;"&gt;&lt;LI&gt;Actual EPS (AEPS ≥ Forecasted EPS (FEPS) at 4&lt;SUP&gt;th&lt;/SUP&gt; quarter&lt;/LI&gt;&lt;LI&gt;If ETR (3&lt;SUP&gt;rd&lt;/SUP&gt; quarter) is used (rather than ETR (4&lt;SUP&gt;th&lt;/SUP&gt; quarter)), then AEPS &amp;lt; FEPS&lt;/LI&gt;&lt;LI&gt;(Pretax Income at 3&lt;SUP&gt;rd&lt;/SUP&gt; Quarter * (1 – ETR (3&lt;SUP&gt;rd&lt;/SUP&gt; Quarter)) * “Adjustment/Split Factor”)/CSHO when FQTR=3 is short of 3&lt;SUP&gt;rd&lt;/SUP&gt; Quarter Analyst EBS&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Dummy ETR =&amp;nbsp;&amp;nbsp;&amp;nbsp; 1 if A, B, and C are met&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0 otherwise (more formalized statements as follows):&lt;/P&gt;&lt;P&gt;If ((PI * (1 – ETR (3&lt;SUP&gt;rd&lt;/SUP&gt; Quarter)) * ADJSPF)/CSHO) &amp;lt; MEDEST then INT1 = 1 (MEASURE=”EPS”)&lt;/P&gt;&lt;P&gt;If ETR (4&lt;SUP&gt;th&lt;/SUP&gt; Quarter) &amp;lt; ETR (3&lt;SUP&gt;rd&lt;/SUP&gt; Quarter) then INT1 = 1&lt;/P&gt;&lt;P&gt;If ((PI * (1 – ETR (3&lt;SUP&gt;rd&lt;/SUP&gt; Quarter)) * ADJSPF)/CSHO) ≥ MEDEST then INT1 = 0 (MEASURE=”EPS”)&lt;/P&gt;&lt;P&gt;If ETR (4&lt;SUP&gt;th&lt;/SUP&gt; Quarter) ≥ ETR (3&lt;SUP&gt;rd&lt;/SUP&gt; Quarter) then INT1 = 0&lt;/P&gt;&lt;P&gt;If (MEDEST/(1 – ETR (3&lt;SUP&gt;rd&lt;/SUP&gt; Quarter)) – ((PIY * (1 – ETR (3&lt;SUP&gt;rd&lt;/SUP&gt; Quarter)) * ADJSPF)/CSHO) is between $0.01 and $0.05 when FQTR=3 then INT1 = 1 (MEASURE=”EPS”)&lt;/P&gt;&lt;P&gt;If (MEDEST/(1 – ETR (3&lt;SUP&gt;rd&lt;/SUP&gt; Quarter)) – ((PIY * (1 – ETR (3&lt;SUP&gt;rd&lt;/SUP&gt; Quarter)) * ADJSPF)/CSHO) is NOT between $0.01 and $0.05 when FQTR=3 then INT1 = 0 (MEASURE=”EPS”)&lt;/P&gt;&lt;P&gt;INT1 = 1 (meaning that the conditions above when INT1=1 are met)&lt;/P&gt;&lt;P&gt;If ETR (3&lt;SUP&gt;rd&lt;/SUP&gt; Quarter) then AEPS &amp;lt; FEPS &lt;/P&gt;&lt;P&gt;FISCALP=”ANN”&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Legend:&lt;/P&gt;&lt;P&gt;AEPS = NI/CSHO&lt;/P&gt;&lt;P&gt;FEPS = MEDEST&lt;/P&gt;&lt;P&gt;If MEASURE=”EPS” and &lt;/P&gt;&lt;P&gt;ETR (3&lt;SUP&gt;rd&lt;/SUP&gt; Quarter) = TXTY/(NIY + TXTY) &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; If FQTR = 3 &lt;/P&gt;&lt;P&gt;ETR (4&lt;SUP&gt;th&lt;/SUP&gt; Quarter) = TXTY/(NIY + TXTY)&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; If FQTR = 4&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SIZE = Log of MKVALT 1 year before FYEAR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;COV = Log of NUMEST&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; If FPI = 9&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EVOL = Standard deviation of (NI/(Average of AT 1 year before FYEAR and AT 2 years before FYEAR) for 5 years in a row&lt;/P&gt;&lt;P&gt;For example, if we are in 2010, we need standard deviation of:&lt;/P&gt;&lt;P&gt;2009 NI/(average of 2007 and 2008 AT)&lt;/P&gt;&lt;P&gt;2008 NI/(average of 2006 and 2007 AT)&lt;/P&gt;&lt;P&gt;2007 NI/(average of 2005 and 2006 AT)&lt;/P&gt;&lt;P&gt;2006 NI/(average of 2004 and 2005 AT)&lt;/P&gt;&lt;P&gt;2005 NI/(average of 2003 and 2004 AT)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: yellow;"&gt;RETVOL&lt;/SPAN&gt; = Standard deviation of RET (from etr.g) during the 12-month period before RDQ&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; If FPI=9 and FQTR=4 (which should already be sorted)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ROA = NI/(Average of AT 1 year before FYEAR and AT 2 years before FYEAR) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EP = (NI/PRCC_F) 1 year before FYEAR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EP x D&lt;SUB&gt;EP&lt;/SUB&gt; = (NI/PRCC_F 1 year before FYEAR) times a dummy variable with one if EP is negative and 0 otherwise&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BM = (AT – LT)/MKVALT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SGR = (SALE 1 year before FYEAR – SALE 2 years before FYEAR)/SALE 2 years before FYEAR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Change in PPE = (PPENT – PPENT 1 year before FYEAR)/ &lt;/P&gt;&lt;P&gt;(Average of AT Prior Year and AT 2 years ago)&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;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: yellow;"&gt;RET12&lt;/SPAN&gt; = RET (from etr.g) during the 12-month period 9 months before FYEAR&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; If FPI=9&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ACC = (NI 1 year before FYEAR – OANCF 1 year before FYEAR)/AT 1 year before FYEAR &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;Model 2: CAR = β&lt;SUB&gt;1&lt;/SUB&gt;Dummy ETR + β&lt;SUB&gt;2&lt;/SUB&gt;SIZE + β&lt;SUB&gt;3&lt;/SUB&gt;RETVOL + β&lt;SUB&gt;4&lt;/SUB&gt;BTM&lt;/P&gt;&lt;P&gt;CAR = RET – SPRTRN (from etr.c file) cumulatively over 3 days as follows:&lt;/P&gt;&lt;P style="margin-left: .5in;"&gt;(1 day before RDQ + RDQ&amp;nbsp; + 1 day after RDQ)&lt;/P&gt;&lt;P style="margin-left: .5in;"&gt;If FQTR = 4 (which it already should be)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dummy ETR = Conditions that need to be met (FISCALP=”ANN”):&lt;/P&gt;&lt;OL style="list-style-type: upper-alpha;"&gt;&lt;LI&gt;Actual EPS (AEPS ≥ Forecasted EPS (FEPS) at 4&lt;SUP&gt;th&lt;/SUP&gt; quarter&lt;/LI&gt;&lt;LI&gt;If ETR (3&lt;SUP&gt;rd&lt;/SUP&gt; quarter) is used (rather than ETR (4&lt;SUP&gt;th&lt;/SUP&gt; quarter)), then AEPS &amp;lt; FEPS&lt;/LI&gt;&lt;LI&gt;(Pretax Income at 3&lt;SUP&gt;rd&lt;/SUP&gt; Quarter * (1 – ETR (3&lt;SUP&gt;rd&lt;/SUP&gt; Quarter)) * “Adjustment/Split Factor”)/CSHO when FQTR=3 is short of 3&lt;SUP&gt;rd&lt;/SUP&gt; Quarter Analyst EBS&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Dummy ETR =&amp;nbsp;&amp;nbsp;&amp;nbsp; 1 if A, B, and C are met&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0 otherwise (more formalized statements as follows):&lt;/P&gt;&lt;P&gt;If ((PI * (1 – ETR (3&lt;SUP&gt;rd&lt;/SUP&gt; Quarter)) * ADJSPF)/CSHO) &amp;lt; MEDEST then INT1 = 1 (MEASURE=”EPS”)&lt;/P&gt;&lt;P&gt;If ETR (4&lt;SUP&gt;th&lt;/SUP&gt; Quarter) &amp;lt; ETR (3&lt;SUP&gt;rd&lt;/SUP&gt; Quarter) then INT1 = 1&lt;/P&gt;&lt;P&gt;If ((PI * (1 – ETR (3&lt;SUP&gt;rd&lt;/SUP&gt; Quarter)) * ADJSPF)/CSHO) ≥ MEDEST then INT1 = 0 (MEASURE=”EPS”)&lt;/P&gt;&lt;P&gt;If ETR (4&lt;SUP&gt;th&lt;/SUP&gt; Quarter) ≥ ETR (3&lt;SUP&gt;rd&lt;/SUP&gt; Quarter) then INT1 = 0&lt;/P&gt;&lt;P&gt;If (MEDEST/(1 – ETR (3&lt;SUP&gt;rd&lt;/SUP&gt; Quarter)) – ((PIY * (1 – ETR (3&lt;SUP&gt;rd&lt;/SUP&gt; Quarter)) * ADJSPF)/CSHO) is between $0.01 and $0.05 when FQTR=3 then INT1 = 1 (MEASURE=”EPS”)&lt;/P&gt;&lt;P&gt;If (MEDEST/(1 – ETR (3&lt;SUP&gt;rd&lt;/SUP&gt; Quarter)) – ((PIY * (1 – ETR (3&lt;SUP&gt;rd&lt;/SUP&gt; Quarter)) * ADJSPF)/CSHO) is NOT between $0.01 and $0.05 then INT1 = 0 (MEASURE=”EPS”)&lt;/P&gt;&lt;P&gt;INT1 = 1&lt;/P&gt;&lt;P&gt;If ETR (3&lt;SUP&gt;rd&lt;/SUP&gt; Quarter) then AEPS &amp;lt; FEPS &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Legend:&lt;/P&gt;&lt;P&gt;AEPS = NI/CSHO&lt;/P&gt;&lt;P&gt;FEPS = MEDEST&lt;/P&gt;&lt;P&gt;If MEASURE=”EPS” and &lt;/P&gt;&lt;P&gt;ETR (3&lt;SUP&gt;rd&lt;/SUP&gt; Quarter) = TXTY/(NIY + TXTY) &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; If FQTR = 3 &lt;/P&gt;&lt;P&gt;ETR (4&lt;SUP&gt;th&lt;/SUP&gt; Quarter) = TXTY/(NIY + TXTY)&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; If FQTR = 4&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SIZE = Log of MKVALTQ&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; If FQTR = 3&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: yellow;"&gt;RETVOL&lt;/SPAN&gt; = Standard deviation of 100 trading-day return (RET from etr.g) prior to 2 days before RDQ&lt;/P&gt;&lt;P&gt;If FPI = 9 and FQTR = 4 (which should already be sorted)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BTM = (ATQ – LTQ)/MKVALTQ &lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri',sans-serif;"&gt; If FQTR = 3 &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.8000001907349px; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.8000001907349px; background-color: #ffffff;"&gt;After using the following code (which I used and it worked), I need to calculate cumulative abnormal return (CAR) as described above.&amp;nbsp; Then, I will need to merge this calculation into the etr.combined dataset by permo.&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.8000001907349px; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; etr.a;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; etr.combined;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;input&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; permno fqtr rdq &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: teal; background: white;"&gt;date9.&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="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;cards&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="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;10001 2 05jul2014&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;10001 4 08nov2015&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;10002 4 09oct2015&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;10003 1 002jan2015&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;10004 4 01Dec2015&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&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="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;run&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="margin-bottom: .0001pt;"&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="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; etr.b;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; etr.a(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;where&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;=(fqtr=&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;4&lt;/STRONG&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="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;orig=rdq;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;rdq=orig-&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;1&lt;/STRONG&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;output&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="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;rdq=orig+&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;1&lt;/STRONG&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;output&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="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;rdq=orig; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;output&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="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;drop&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; orig;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;run&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="margin-bottom: .0001pt;"&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="margin-bottom: .0001pt;"&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="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;sort&lt;/STRONG&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;data&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;=etr.b; &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; permno rdq;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;run&lt;/STRONG&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="margin-bottom: .0001pt;"&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="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;sort&lt;/STRONG&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;data&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;=etr.a; &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; permno rdq;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;run&lt;/STRONG&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="margin-bottom: .0001pt;"&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="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;sort&lt;/STRONG&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;data&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;=etr.crdarevo; &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; permno;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;run&lt;/STRONG&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="margin-bottom: .0001pt;"&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="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; etr.c;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;merge&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; etr.b etr.a etr.crdarevo;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&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; permno;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;run&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="color: #222222; font-family: arial, sans-serif; font-size: 12.8000001907349px; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.8000001907349px; background-color: #ffffff;"&gt;2 things to point out about the 2 steps above:&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.8000001907349px; background-color: #ffffff;"&gt;1. In the separate SAS files I am using that you will see in the codes (etr.crspmont and etr.crdarevo), RET is the same name for monthly stock returns (in etr.crspmont) and daily stock returns (in etr.crdarevo).&amp;nbsp; 1 of these will have to be renamed before merging into the etr.combined dataset because they are obviously not the same thing.&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.8000001907349px; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.8000001907349px; background-color: #ffffff;"&gt;2. Maybe 2 separate merges is better (meaning creating a copy of etr.combined) because some observations will apply to the 1st calculation (analyst's forecast errors) and some observations will apply to the 2nd calculation (CAR).&amp;nbsp; These 2 calculations do not need to have the same number of observations.&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.8000001907349px; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.8000001907349px; background-color: #ffffff;"&gt;Please help me with coding for the 2 regressions in the large section above.&amp;nbsp; As you see, detail is provided for the calculations that I need.&amp;nbsp; I need the SAS coding for them.&amp;nbsp; The following is 1&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: 12.8000001907349px; background-color: #ffffff;"&gt; line from the etr.combined dataset to make it easier for you to comprehend what I am trying to do.&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 4057px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD height="20" width="64"&gt;GVKEY&lt;/TD&gt;&lt;TD width="76"&gt;DATADATE&lt;/TD&gt;&lt;TD width="64"&gt;FYEAR&lt;/TD&gt;&lt;TD width="70"&gt;cusip9&lt;/TD&gt;&lt;TD width="64"&gt;CONSOL&lt;/TD&gt;&lt;TD width="64"&gt;INDFMT&lt;/TD&gt;&lt;TD width="64"&gt;DATAFMT&lt;/TD&gt;&lt;TD width="64"&gt;POPSRC&lt;/TD&gt;&lt;TD width="64"&gt;CURCD&lt;/TD&gt;&lt;TD width="64"&gt;COSTAT&lt;/TD&gt;&lt;TD width="67"&gt;CONM&lt;/TD&gt;&lt;TD width="64"&gt;TIC&lt;/TD&gt;&lt;TD width="77"&gt;CIK&lt;/TD&gt;&lt;TD width="64"&gt;FYR&lt;/TD&gt;&lt;TD width="64"&gt;AT&lt;/TD&gt;&lt;TD width="64"&gt;LT&lt;/TD&gt;&lt;TD width="64"&gt;PPENT&lt;/TD&gt;&lt;TD width="64"&gt;NI&lt;/TD&gt;&lt;TD width="64"&gt;PI&lt;/TD&gt;&lt;TD width="64"&gt;REVT&lt;/TD&gt;&lt;TD width="64"&gt;SALE&lt;/TD&gt;&lt;TD width="64"&gt;OANCF&lt;/TD&gt;&lt;TD width="64"&gt;CSHO&lt;/TD&gt;&lt;TD width="64"&gt;MKVALT&lt;/TD&gt;&lt;TD width="64"&gt;PRCC_C&lt;/TD&gt;&lt;TD width="64"&gt;PRCC_F&lt;/TD&gt;&lt;TD width="67"&gt;FYEARQ&lt;/TD&gt;&lt;TD width="64"&gt;FQTR&lt;/TD&gt;&lt;TD width="73"&gt;DATAFQTR&lt;/TD&gt;&lt;TD width="74"&gt;DATACQTR&lt;/TD&gt;&lt;TD width="64"&gt;CURCDQ&lt;/TD&gt;&lt;TD width="64"&gt;RDQ&lt;/TD&gt;&lt;TD width="64"&gt;ATQ&lt;/TD&gt;&lt;TD width="64"&gt;LTQ&lt;/TD&gt;&lt;TD width="64"&gt;NIQ&lt;/TD&gt;&lt;TD width="64"&gt;TXTQ&lt;/TD&gt;&lt;TD width="64"&gt;CSHPRY&lt;/TD&gt;&lt;TD width="64"&gt;EPSPIY&lt;/TD&gt;&lt;TD width="64"&gt;EPSPXY&lt;/TD&gt;&lt;TD width="64"&gt;NIY&lt;/TD&gt;&lt;TD width="64"&gt;PIY&lt;/TD&gt;&lt;TD width="64"&gt;TXTY&lt;/TD&gt;&lt;TD width="64"&gt;MKVALTQ&lt;/TD&gt;&lt;TD width="64"&gt;crsp_cusip&lt;/TD&gt;&lt;TD width="62"&gt;PERMNO&lt;/TD&gt;&lt;TD width="63"&gt;DATE&lt;/TD&gt;&lt;TD width="64"&gt;cusip6&lt;/TD&gt;&lt;TD width="64"&gt;TICKER&lt;/TD&gt;&lt;TD width="64"&gt;MEASURE&lt;/TD&gt;&lt;TD width="64"&gt;STATPERS&lt;/TD&gt;&lt;TD width="64"&gt;FPI&lt;/TD&gt;&lt;TD width="64"&gt;OFTIC&lt;/TD&gt;&lt;TD width="64"&gt;cusip8&lt;/TD&gt;&lt;TD width="64"&gt;CNAME&lt;/TD&gt;&lt;TD width="64"&gt;FISCALP&lt;/TD&gt;&lt;TD width="64"&gt;NUMEST&lt;/TD&gt;&lt;TD width="64"&gt;MEDEST&lt;/TD&gt;&lt;TD width="64"&gt;MEANEST&lt;/TD&gt;&lt;TD width="64"&gt;ACTUAL&lt;/TD&gt;&lt;TD width="100"&gt;ANNDATS_ACT&lt;/TD&gt;&lt;TD width="64"&gt;ADJSPF&lt;/TD&gt;&lt;TD width="64"&gt;USFIRM&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;021542&lt;/TD&gt;&lt;TD align="right"&gt;20031231&lt;/TD&gt;&lt;TD align="right"&gt;2003&lt;/TD&gt;&lt;TD&gt;000360206&lt;/TD&gt;&lt;TD&gt;C&lt;/TD&gt;&lt;TD&gt;INDL&lt;/TD&gt;&lt;TD&gt;STD&lt;/TD&gt;&lt;TD&gt;D&lt;/TD&gt;&lt;TD&gt;USD&lt;/TD&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;AAONINC&lt;/TD&gt;&lt;TD&gt;AAON&lt;/TD&gt;&lt;TD&gt;0000824142&lt;/TD&gt;&lt;TD align="right"&gt;12&lt;/TD&gt;&lt;TD align="right" class="xl65"&gt;102.0850&lt;/TD&gt;&lt;TD align="right" class="xl65"&gt;34.6570&lt;/TD&gt;&lt;TD align="right" class="xl65"&gt;37.4500&lt;/TD&gt;&lt;TD align="right" class="xl65"&gt;14.2270&lt;/TD&gt;&lt;TD align="right" class="xl65"&gt;21.8530&lt;/TD&gt;&lt;TD align="right" class="xl65"&gt;148.8450&lt;/TD&gt;&lt;TD align="right" class="xl65"&gt;148.8450&lt;/TD&gt;&lt;TD align="right" class="xl65"&gt;16.4690&lt;/TD&gt;&lt;TD align="right" class="xl65"&gt;12.5200&lt;/TD&gt;&lt;TD align="right" class="xl65"&gt;243.0132&lt;/TD&gt;&lt;TD align="right" class="xl65"&gt;19.4100&lt;/TD&gt;&lt;TD align="right" class="xl65"&gt;19.4100&lt;/TD&gt;&lt;TD align="right" class="xl67"&gt;2003&lt;/TD&gt;&lt;TD align="right" class="xl67"&gt;4&lt;/TD&gt;&lt;TD class="xl67"&gt;2003Q4&lt;/TD&gt;&lt;TD class="xl67"&gt;2003Q4&lt;/TD&gt;&lt;TD class="xl67"&gt;USD&lt;/TD&gt;&lt;TD align="right" class="xl67"&gt;20040211&lt;/TD&gt;&lt;TD align="right" class="xl65"&gt;102.0850&lt;/TD&gt;&lt;TD align="right" class="xl65"&gt;34.6570&lt;/TD&gt;&lt;TD align="right" class="xl65"&gt;3.7400&lt;/TD&gt;&lt;TD align="right" class="xl65"&gt;1.2600&lt;/TD&gt;&lt;TD align="right" class="xl65"&gt;12.6850&lt;/TD&gt;&lt;TD align="right" class="xl65"&gt;1.1200&lt;/TD&gt;&lt;TD align="right" class="xl65"&gt;1.1200&lt;/TD&gt;&lt;TD align="right" class="xl65"&gt;14.2270&lt;/TD&gt;&lt;TD align="right" class="xl65"&gt;21.8530&lt;/TD&gt;&lt;TD align="right" class="xl65"&gt;7.6260&lt;/TD&gt;&lt;TD align="right" class="xl65"&gt;0.0000&lt;/TD&gt;&lt;TD class="xl65"&gt;00036020&lt;/TD&gt;&lt;TD align="right" class="xl67"&gt;76868&lt;/TD&gt;&lt;TD align="right" class="xl67"&gt;20141231&lt;/TD&gt;&lt;TD class="xl65"&gt;000360&lt;/TD&gt;&lt;TD class="xl65"&gt;AAON&lt;/TD&gt;&lt;TD class="xl67"&gt;EPS&lt;/TD&gt;&lt;TD align="right" class="xl67"&gt;20040115&lt;/TD&gt;&lt;TD align="right" class="xl67"&gt;1&lt;/TD&gt;&lt;TD class="xl67"&gt;AAON&lt;/TD&gt;&lt;TD class="xl67"&gt;00036020&lt;/TD&gt;&lt;TD class="xl67"&gt;AAON&lt;/TD&gt;&lt;TD class="xl67"&gt;ANN&lt;/TD&gt;&lt;TD align="right" class="xl67"&gt;2&lt;/TD&gt;&lt;TD align="right" class="xl66"&gt;0.21&lt;/TD&gt;&lt;TD align="right" class="xl66"&gt;0.21&lt;/TD&gt;&lt;TD align="right" class="xl65"&gt;0.2114&lt;/TD&gt;&lt;TD class="xl67"&gt;20040211&lt;/TD&gt;&lt;TD align="right" class="xl68"&gt;3.374998&lt;/TD&gt;&lt;TD align="right" class="xl67"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.8000001907349px; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.8000001907349px; background-color: #ffffff;"&gt;&lt;SPAN style="font-size: 12.8000001907349px; line-height: 1.5em;"&gt;Etr.c has the same categories (although most are blank entries in etr.c) as etr.combined.&amp;nbsp; Etr.c also has RET and SPRTRN, which I need for the CAR calculation.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.8000001907349px; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.8000001907349px; background-color: #ffffff;"&gt;The most important variables in the 2 regressions are the dependent variables (of course) and the Dummy ETR independent variable in each regression (which is the same in both regressions).&amp;nbsp; For some reason, if you cannot figure out code for some of the other variables in either regression, it's fine.&amp;nbsp; Please start with the code for the 2 dependent variables and the Dummy ETR independent variable. &lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.8000001907349px; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.8000001907349px; background-color: #ffffff;"&gt;I will call on Monday to discuss.&amp;nbsp; I'm sure this will take a good amount of time, by your help is greatly appreciated.&amp;nbsp; I am certainly inexperienced in SAS.&amp;nbsp; I hope I can do some training this summer.&amp;nbsp; In the meantime, let's try to get these 2 regressions done first.&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.8000001907349px; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.8000001907349px; background-color: #ffffff;"&gt;Thanks so much!&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.8000001907349px; background-color: #ffffff;"&gt;Jadallah&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 26 Apr 2015 11:03:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Coding-for-2-Regressions/m-p/204058#M50848</guid>
      <dc:creator>jjadall1</dc:creator>
      <dc:date>2015-04-26T11:03:01Z</dc:date>
    </item>
    <item>
      <title>Re: Coding for 2 Regressions</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Coding-for-2-Regressions/m-p/204059#M50849</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In your first step you are using a set statement and an input statement (that reads from the cards section).&lt;/P&gt;&lt;P&gt;With this code you are basically merging row-by-row etr.combined and the 5 rows that you have in cards.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;In etr,combined&lt;/STRONG&gt; the variable &lt;STRONG&gt;fpi is already defined as character&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;Probably you want to rename this variable in the etr.combined dataset or use some other name in the input statement.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Apr 2015 09:46:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Coding-for-2-Regressions/m-p/204059#M50849</guid>
      <dc:creator>gergely_batho</dc:creator>
      <dc:date>2015-04-28T09:46:21Z</dc:date>
    </item>
  </channel>
</rss>

