I am trying to regress returns as my dependent variable on forecast errors. My dependent variable is returns between announcement dates for company earnings (RET2). My independent variables are POST92 which is an indicator variable equal to 1 if the year is greater than or equal to 1992, SUE1 (earnings surprise based on GAAP earnings), SUE3 (earnings surprise based on analyst forecast). Could someone explain the difference between a cross sectional and pooled time series regression.
1. What is the SAS command for a cross sectional regression:
RET2- independent variable
POST92 sue3 sue3*post92 sue1 sue1*post92 - dependent variables
2. How can I create variables sue3*post92 and sue1*post92 which are multiplication of two other variables?
3. What is the SAS command for a panel data regression. My observations are quarterly earnings but they are on different dates so I am not sure whether the panel should be daily or quarterly.
4. Which regression should I use if my dependent variable is returns between announcement dates- cross sectional or time series pooled?
Thank you!
data SUECARS;
infile datalines dsd truncover;
input GVKEY:$6. LPERMNO:32. TICKER:$6. RDQ:DATE9. fqenddt:DATE9. FYEARQ:F6. FQTR:F4. sue1:PERCENT7.4 sue2:PERCENT7.4 sue3:PERCENT7.4 numest:32. SUM1:11.6 daysSUM1:32. SUM2:11.6 daysSUM2:32. RET1:32. n1:32. RET2:32. n2:32. date:DATE9. POST92:32.;
format RDQ DATE9. fqenddt DATE9. FYEARQ F6. FQTR F4. sue1 PERCENT7.4 sue2 PERCENT7.4 sue3 PERCENT7.4 SUM1 11.6 SUM2 11.6 date DATE9.;
label GVKEY="S&P Identifier" LPERMNO="CRSP Identifier" TICKER="Historical Ticker" RDQ="Report Date of Quarterly Earnings" fqenddt="Calendar date of fiscal period end" FYEARQ="Fiscal Year" FQTR="Fiscal Quarter" sue1="Earnings Surprise GAAP" sue2="Earnings Surprise GAAP (Proprietory)" sue3="Earnings Surprise (Analyst Forecast-based)" numest="Number of analyst forecasts used in Analyst-based SUE" SUM1="Summed ret around EAD (-1,+1)" daysSUM1="Actual days used in SUM1 calculation" SUM2="Summed ret between Consequent EADs" daysSUM2="Actual days used in SUM2 calculation" RET1="Compouned ret around EAD (-1,+1)" n1="Actual days used in compound_ret calculation" RET2="Compounded ret between Consequent EADs" n2="Actual days used in compound_ret2 calculation";
datalines4;
001004,54594,AIR,19DEC1985,30NOV1985,1985,2,(4.04%),(4.04%),.656%,1,0.040481,3,0.343975,62,0.0406091355,3,0.3825624894,62,,0
001004,54594,AIR,21MAR1986,28FEB1986,1985,3,(1.74%),(1.74%),.096%,2,0.117174,3,0.077125,73,0.119760474,3,0.0646390369,73,,0
001004,54594,AIR,16DEC1986,30NOV1986,1986,2,(1.70%),(1.70%),.128%,1,-0.014972,3,0.266057,65,-0.015075377,3,0.2893380667,65,,0
001004,54594,AIR,23MAR1987,28FEB1987,1986,3,(1.62%),(1.62%),(.025%),2,0.039874,3,0.051043,77,0.0403225812,3,0.0396624512,77,,0
001004,54594,AIR,14JUL1987,31MAY1987,1986,4,(1.79%),(1.79%),(.025%),2,-0.014058,3,0.153172,48,-0.014925372,3,0.1526717556,48,,0
001004,54594,AIR,22SEP1987,31AUG1987,1987,1,(1.20%),(1.20%),.100%,2,-0.003256,3,-0.331950,59,-0.00330033,3,-0.333362278,59,,0
001004,54594,AIR,16DEC1987,30NOV1987,1987,2,(1.12%),(1.12%),(.120%),1,0.001222,3,0.400315,62,-7.43655E-10,3,0.456623802,62,,0
001004,54594,AIR,17MAR1988,29FEB1988,1987,3,(.716%),(.716%),.048%,3,0.074873,3,0.105421,85,0.0752688161,3,0.0903260211,85,,0
001004,54594,AIR,20JUL1988,31MAY1988,1987,4,(.654%),(.654%),.119%,3,-0.004651,3,0.016724,43,-0.004651163,3,0.0083196388,43,,0
001004,54594,AIR,21SEP1988,31AUG1988,1988,1,(.721%),(.721%),.000%,6,0.019442,3,-0.057984,59,0.0195121953,3,-0.063284312,59,,0
001004,54594,AIR,15DEC1988,30NOV1988,1988,2,(.871%),(.871%),(.043%),5,0.053661,3,0.115533,63,0.0543478267,3,0.1077597187,63,,0
001004,54594,AIR,20MAR1989,28FEB1989,1988,3,(.766%),(.766%),(.019%),2,-0.071117,3,0.197146,82,-0.069565216,3,0.2036818634,82,,0
001004,54594,AIR,20SEP1989,31AUG1989,1989,1,(.549%),(.549%),.029%,3,0.040741,3,-0.015713,61,0.0407407396,3,-0.025196124,61,,0
001004,54594,AIR,18DEC1989,30NOV1989,1989,2,(.717%),(.717%),(.085%),3,-0.021494,3,-0.146206,53,-0.021428572,3,-0.151215842,53,,0
001004,54594,AIR,07MAR1990,28FEB1990,1989,3,(.947%),(.947%),(.225%),6,-0.088917,3,-0.334856,72,-0.094488186,3,-0.299250129,72,,0
001004,54594,AIR,20JUN1990,31MAY1990,1989,4,(1.21%),(1.21%),(.188%),9,0.032051,3,-0.401962,62,0.0320512839,3,-0.347610836,62,,0
001004,54594,AIR,19SEP1990,31AUG1990,1990,1,(1.30%),(1.30%),.031%,6,-0.051501,3,-0.250852,64,-0.052173913,3,-0.272146379,64,,0
001004,54594,AIR,20MAR1991,28FEB1991,1990,3,(.386%),(.386%),.388%,5,-0.024275,3,0.040435,63,-0.025000002,3,0.0180970818,63,,0
001004,54594,AIR,19DEC1991,30NOV1991,1991,2,(1.66%),(1.66%),(.646%),4,-0.054578,3,0.340241,61,-0.054347828,3,0.3866814244,61,,0
001004,54594,AIR,19MAR1992,29FEB1992,1991,3,(.960%),(.960%),(.258%),6,0.000489,3,-0.192220,63,5.725653E-10,3,-0.180947941,63,,0
001004,54594,AIR,19JUN1992,31MAY1992,1991,4,(1.95%),(.111%),.388%,5,-0.040926,3,-0.012570,62,-0.04040404,3,-0.021716852,62,,0
001004,54594,AIR,19MAR1993,28FEB1993,1992,3,(5.32%),(1.69%),(4.53%),4,0.021389,3,0.139995,79,0.0212765943,3,0.1370213671,79,,1
001004,54594,AIR,15DEC1993,30NOV1993,1993,2,(.331%),(.331%),.145%,1,0.010152,3,0.159706,63,0.0088495582,3,0.1639044227,63,,1
001004,54594,AIR,17MAR1994,28FEB1994,1993,3,(.730%),(.730%),(.189%),1,-0.028986,3,-0.190283,74,-0.028985508,3,-0.178927408,74,,1
001004,54594,AIR,20SEP1994,31AUG1994,1994,1,(1.07%),(1.07%),(.370%),2,-0.066058,3,0.005506,60,-0.064814816,3,-0.000105915,60,,1
001004,54594,AIR,15DEC1994,30NOV1994,1994,2,(.782%),(.782%),(.190%),2,0.009901,3,0.064324,60,0.0099009899,3,0.0588338848,60,,1
001004,54594,AIR,15MAR1995,28FEB1995,1994,3,(.326%),(.326%),.218%,1,0.000000,3,0.311634,77,0,3,0.3511051257,77,,1
001004,54594,AIR,14MAR1996,29FEB1996,1995,3,(.687%),(.687%),.000%,2,0.012382,3,-0.034772,74,0.012345679,3,-0.043338345,74,,1
001004,54594,AIR,01JUL1996,31MAY1996,1995,4,(.484%),(.484%),.136%,3,-0.030947,3,0.162151,53,-0.031249998,3,0.1655429734,53,,1
001004,54594,AIR,17SEP1996,31AUG1996,1996,1,(.330%),(.330%),.231%,2,0.053236,3,0.185976,60,0.0517241362,3,0.1802858361,60,,1
001004,54594,AIR,12DEC1996,30NOV1996,1996,2,(.439%),(.439%),.067%,1,-0.061535,3,-0.010048,61,-0.061135372,3,-0.023507845,61,,1
001004,54594,AIR,13MAR1997,28FEB1997,1996,3,(.688%),(.688%),.098%,4,0.014730,3,0.216937,71,0.014634147,3,0.2320445428,71,,1
001004,54594,AIR,25JUN1997,31MAY1997,1996,4,(.582%),(.582%),.032%,7,0.008171,3,0.077118,52,0.0079365076,3,0.0764118341,52,,1
001004,54594,AIR,12DEC1997,30NOV1997,1997,2,(.446%),(.446%),.104%,5,-0.036575,3,0.130388,60,-0.036392406,3,0.1335095615,60,,1
001004,54594,AIR,13MAR1998,28FEB1998,1997,3,.032%,.032%,.011%,5,0.013157,3,-0.052282,71,0.0129870138,3,-0.062041323,71,,1
001004,54594,AIR,25JUN1998,31MAY1998,1997,4,.164%,.164%,.113%,6,0.110388,3,-0.192010,55,0.113695093,3,-0.190943224,55,,1
001004,54594,AIR,15SEP1998,31AUG1998,1998,1,.032%,.032%,.000%,5,0.039486,3,0.154793,64,0.0385756653,3,0.1351930178,64,,1
001004,54594,AIR,16DEC1998,30NOV1998,1998,2,(.063%),(.063%),(.079%),2,-0.062003,3,-0.248133,58,-0.061007959,3,-0.240390168,58,,1
001004,54594,AIR,15MAR1999,28FEB1999,1998,3,.096%,.096%,.066%,7,0.056756,3,0.250748,70,0.0546875022,3,0.2583560571,70,,1
001004,54594,AIR,24JUN1999,31MAY1999,1998,4,.145%,.145%,.101%,5,0.129166,3,-0.034939,56,0.1346801336,3,-0.043852039,56,,1
001009,10074,ABSI,29NOV1990,31OCT1990,1990,4,(6.40%),(6.40%),(2.33%),1,-0.019022,3,0.106648,57,-0.020833334,3,0.0593788779,57,,0
001009,10074,ABSI,11AUG1994,31JUL1994,1994,3,.000%,.000%,.000%,1,-0.034483,3,-0.013500,75,-0.034482758,3,-0.03220781,75,,1
001013,50906,ADCT,30AUG1985,31JUL1985,1985,3,(15.7%),(15.7%),.583%,2,0.008624,3,0.156254,77,0.0066666657,3,0.1600000024,77,,0
001013,50906,ADCT,23DEC1985,31OCT1985,1985,4,(15.0%),(15.0%),.182%,1,0.000000,3,0.174432,52,0,3,0.1791907543,52,,0
001013,50906,ADCT,11MAR1986,31JAN1986,1986,1,(14.1%),(14.1%),.667%,1,0.020000,3,0.153521,57,0.0199999996,3,0.1559633033,57,,0
001013,50906,ADCT,03SEP1986,31JUL1986,1986,3,(9.31%),(9.31%),.329%,1,0.083899,3,0.014940,74,0.0860927152,3,1.9272766E-9,74,,0
001013,50906,ADCT,18DEC1986,31OCT1986,1986,4,(7.45%),(7.45%),.370%,1,-0.035578,3,-0.002500,50,-0.035294118,3,-0.012345672,50,,0
001013,50906,ADCT,04MAR1987,31JAN1987,1987,1,(9.33%),(9.33%),(.319%),3,0.038628,3,0.098596,61,0.0389610393,3,0.0864197517,61,,0
001013,50906,ADCT,02JUN1987,30APR1987,1987,2,(11.8%),(11.8%),.078%,3,-0.022222,3,0.215782,63,-0.022222223,3,0.2333333361,63,,0
001013,50906,ADCT,01SEP1987,31JUL1987,1987,3,(9.83%),(9.83%),.438%,1,0.066071,3,-0.036924,73,0.0673076936,3,-0.110619462,73,,0
001013,50906,ADCT,16DEC1987,31OCT1987,1987,4,(7.37%),(7.37%),.250%,1,0.113492,3,0.080535,50,0.1166666713,3,0.0714285726,50,,0
001013,50906,ADCT,01MAR1988,31JAN1988,1988,1,(6.75%),(6.75%),.058%,2,0.028820,3,-0.248970,62,0.0273972599,3,-0.243243253,62,,0
001013,50906,ADCT,31MAY1988,30APR1988,1988,2,(6.16%),(6.16%),(.237%),2,-0.114798,3,-0.127248,58,-0.111111114,3,-0.136363639,58,,0
001013,50906,ADCT,23AUG1988,31JUL1988,1988,3,(8.06%),(8.06%),.148%,2,-0.077502,3,0.139432,78,-0.077669906,3,0.1318681323,78,,0
001013,50906,ADCT,14DEC1988,31OCT1988,1988,4,(8.21%),(7.70%),.430%,6,-0.008658,3,-0.059288,46,-0.009615386,3,-0.068627453,46,,0
001013,50906,ADCT,22FEB1989,31JAN1989,1989,1,(8.48%),(8.48%),(.449%),6,-0.009315,3,0.215025,63,-0.010416665,3,0.2210526365,63,,0
001013,50906,ADCT,23AUG1989,31JUL1989,1989,3,(6.41%),(6.41%),.060%,5,-0.007564,3,0.160930,79,-0.007936507,3,0.1587301649,79,,0
001013,50906,ADCT,23FEB1990,31JAN1990,1990,1,(5.06%),(5.06%),.857%,2,0.050416,3,0.080002,64,0.049689442,3,0.058823525,64,,0
001013,50906,ADCT,29AUG1990,31JUL1990,1990,3,(6.25%),(6.25%),.350%,2,0.031156,3,0.246580,73,0.0270270243,3,0.2500000053,73,,0
001013,50906,ADCT,21FEB1991,31JAN1991,1991,1,(6.09%),(6.09%),.152%,3,0.044177,3,0.300248,66,0.0434782622,3,0.3249999974,66,,0
001013,50906,ADCT,29MAY1991,30APR1991,1991,2,(4.36%),(4.36%),.143%,3,0.094123,3,-0.400144,63,0.0965517238,3,-0.361445779,63,,0
001013,50906,ADCT,28AUG1991,31JUL1991,1991,3,(5.19%),(5.19%),(.248%),4,0.014563,3,-0.089257,75,0.0143540671,3,-0.111111108,75,,0
001013,50906,ADCT,16DEC1991,31OCT1991,1991,4,(4.98%),(4.98%),.000%,4,-0.040303,3,0.075524,42,-0.040000001,3,0.0463917548,42,,0
001013,50906,ADCT,18FEB1992,31JAN1992,1992,1,(6.87%),(6.17%),(1.12%),4,-0.014467,3,0.312073,68,-0.014563107,3,0.3238095231,68,,1
001013,50906,ADCT,27MAY1992,30APR1992,1992,2,(5.02%),(5.02%),.220%,5,0.098259,3,0.063773,62,0.0988142322,3,0.0551470595,62,,1
001013,50906,ADCT,25AUG1992,31JUL1992,1992,3,(4.98%),(4.98%),.173%,6,0.003695,3,0.274178,78,0.0034965041,3,0.2937063013,78,,1
001013,50906,ADCT,16DEC1992,31OCT1992,1992,4,(5.73%),(5.73%),.083%,4,-0.004922,3,-0.146904,44,-0.005376344,3,-0.146739131,44,,1
001013,50906,ADCT,22FEB1993,31JAN1993,1993,1,(3.09%),(3.09%),(.021%),5,0.006573,3,0.287892,64,0.0064102563,3,0.3081760919,64,,1
001013,50906,ADCT,25MAY1993,30APR1993,1993,2,(4.30%),(4.30%),.024%,5,0.044858,3,0.267315,62,0.0452261293,3,0.28703704,62,,1
001013,50906,ADCT,16DEC1993,31OCT1993,1993,4,(1.38%),(1.38%),(.027%),4,0.002556,3,0.172044,45,-2.751118E-9,3,0.1608391551,45,,1
001013,50906,ADCT,22FEB1994,31JAN1994,1994,1,(.899%),(.899%),(.027%),5,-0.011931,3,-0.014047,62,-0.011904762,3,-0.038216566,62,,1
001013,50906,ADCT,24MAY1994,30APR1994,1994,2,(.984%),(.984%),.047%,5,0.000721,3,0.208831,63,-5.17415E-10,3,0.2105263103,63,,1
001013,50906,ADCT,24AUG1994,31JUL1994,1994,3,(.970%),(.970%),.065%,6,0.006219,3,-0.015617,81,0.0054644799,3,-0.041436463,81,,1
001013,50906,ADCT,20DEC1994,31OCT1994,1994,4,(1.16%),(1.16%),.042%,6,0.058102,3,0.169575,43,0.0579268307,3,0.1642651315,43,,1
001013,50906,ADCT,18MAY1995,30APR1995,1995,2,(.201%),(.064%),.030%,11,-0.124537,3,0.323977,67,-0.120622569,3,0.3333333371,67,,1
001013,50906,ADCT,24AUG1995,31JUL1995,1995,3,(.091%),(.091%),.026%,9,0.039344,3,0.038844,80,0.0394736858,3,-0.049504928,80,,1
001013,50906,ADCT,19DEC1995,31OCT1995,1995,4,(.114%),(.114%),.000%,5,0.008214,3,0.033090,45,2.0425808E-9,3,-0.006666666,45,,1
001013,50906,ADCT,26FEB1996,31JAN1996,1996,1,(.067%),(.067%),.026%,10,-0.038914,3,0.196199,63,-0.038709678,3,0.1874999926,63,,1
001013,50906,ADCT,28MAY1996,30APR1996,1996,2,(.091%),(.091%),.012%,8,-0.024713,3,0.212746,63,-0.025641025,3,0.1947368496,63,,1
001013,50906,ADCT,27AUG1996,31JUL1996,1996,3,(.047%),(.047%),.071%,8,0.164200,3,0.199709,73,0.1701030901,3,0.1718061708,73,,1
001013,50906,ADCT,11DEC1996,31OCT1996,1996,4,.283%,.283%,.018%,10,-0.067055,3,-0.092336,49,-0.069930072,3,-0.119133582,49,,1
001013,50906,ADCT,24FEB1997,31JAN1997,1997,1,(.081%),.234%,.000%,10,-0.056874,3,0.284337,64,-0.057915061,3,0.2391304361,64,,1
001013,50906,ADCT,28MAY1997,30APR1997,1997,2,.379%,.379%,.038%,6,0.051672,3,0.090835,60,0.0516605168,3,0.0474452476,60,,1
001013,50906,ADCT,22AUG1997,31JUL1997,1997,3,.275%,.275%,.025%,7,0.076621,3,-0.005191,74,0.0708955189,3,-0.0280528,74,,1
001013,50906,ADCT,09DEC1997,31OCT1997,1997,4,.350%,.350%,.000%,9,-0.017439,3,-0.238142,46,-0.018333335,3,-0.328859086,46,,1
001013,50906,ADCT,18FEB1998,31JAN1998,1998,1,.424%,.424%,.000%,18,0.103864,3,0.265701,64,0.0989010937,3,0.2708333119,64,,1
001013,50906,ADCT,21MAY1998,30APR1998,1998,2,.395%,.395%,.033%,14,0.018524,3,0.085384,61,0.0166666655,3,0.0367965311,61,,1
001013,50906,ADCT,19AUG1998,31JUL1998,1998,3,.422%,.422%,.060%,13,0.109072,3,0.049210,70,0.1062355618,3,-0.056722684,70,,1
001013,50906,ADCT,30NOV1998,31OCT1998,1998,4,.650%,.650%,.000%,7,-0.040729,3,0.494093,55,-0.042643923,3,0.5531915033,55,,1
001017,10154,AELN,18DEC1985,30NOV1985,1985,3,(.507%),(.507%),(.538%),1,0.001008,3,-0.091159,84,-9.31323E-10,3,-0.109375,84,,0
001017,10154,AELN,31MAR1987,28FEB1987,1986,4,4.04%,4.04%,3.90%,1,-0.016906,3,0.059586,56,-0.01754386,3,0.0458715589,56,,0
001021,10218,AFPC,16MAY1985,31MAR1985,1985,3,.117%,.117%,.364%,1,-0.025000,3,-0.466073,93,-0.025,3,-0.410256421,93,,0
001021,10218,AFPC,12NOV1997,30SEP1997,1998,1,2.19%,2.19%,(.410%),1,0.120915,3,0.030140,65,0.117647059,3,-0.078947376,65,,1
001034,65832,BMD,13MAR1986,31DEC1985,1985,4,(2.17%),(2.17%),(.234%),1,-0.015095,3,0.140026,43,-0.015037594,3,0.1278195424,43,,0
001034,65832,BMD,15MAY1986,31MAR1986,1986,1,(1.60%),(1.60%),(.038%),1,-0.011204,3,0.019438,52,-0.013157895,3,0.0019999976,52,,0
001034,65832,BMD,13MAR1987,31DEC1986,1986,4,(.499%),(.499%),(.043%),1,-0.079169,3,-0.155779,36,-0.079207923,3,-0.16129032,36,,0
001034,65832,BMD,10AUG1988,30JUN1988,1988,2,(.513%),(.513%),2.12%,2,-0.059608,3,0.082671,64,-0.058823529,3,0.0749318257,64,,0
001034,65832,BMD,10NOV1988,30SEP1988,1988,3,(1.05%),(1.05%),(.119%),2,-0.009339,3,0.056921,79,-0.00952381,3,0.0508955552,79,,0
001034,65832,BMD,08MAR1989,31DEC1988,1988,4,(1.08%),(1.08%),(.072%),2,0.019137,3,0.115000,41,0.0188679245,3,0.1136033205,41,,0
001034,65832,BMD,08MAY1989,31MAR1989,1989,1,(.797%),(.797%),.073%,2,0.017159,3,0.091348,64,0.016949152,3,0.0845551791,64,,0
;;;;
This is not a base SAS question. You may get find more luck if you post it under statistics topic.
Also, I lost my WRDS membership when after I quit grad school. So, thanks for posting this data. Too bad you posted only 100 obs. I think you should post the entire dataset you have here so its freely available to everyone.
This is not a base SAS question. You may get find more luck if you post it under statistics topic.
Also, I lost my WRDS membership when after I quit grad school. So, thanks for posting this data. Too bad you posted only 100 obs. I think you should post the entire dataset you have here so its freely available to everyone.
Thanks I posted this question under the Statistics topic.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.