jebuske Tracker
https://communities.sas.com/kntur85557/tracker
jebuske TrackerSat, 20 Jul 2024 03:04:27 GMT2024-07-20T03:04:27ZRegression with interval for estimate
https://communities.sas.com/t5/SAS-Procedures/Regression-with-interval-for-estimate/m-p/64614#M18354
Hi,<BR />
<BR />
This is the regression model i'm using:<BR />
<BR />
proc reg data=data_regressie4 outest=regressie4 edf;<BR />
BY ANALYS;<BR />
model geschaalde_FE = geschaalde_deviation age size total_experience firm_experience aantalsector aantalbedrijf;<BR />
run;<BR />
<BR />
The problem is that the estimate for geschaalde_deviation should be greater than 0. Is there a way to make sas estimate this model with "geschaalde_deviation" being greater than 0?<BR />
<BR />
Thanks a lot!Wed, 11 May 2011 11:58:43 GMThttps://communities.sas.com/t5/SAS-Procedures/Regression-with-interval-for-estimate/m-p/64614#M18354jebuske2011-05-11T11:58:43ZRe: Calculation number of different observations
https://communities.sas.com/t5/SAS-Procedures/Calculation-number-of-different-observations/m-p/41419#M10701
I just found a solution. I believe it should be working correctly.<BR />
<BR />
data experience;<BR />
set experience;<BR />
if analys ne lag(analys) then do;<BR />
experience=1;<BR />
totaal=1;<BR />
end;<BR />
else experience=totaal;<BR />
totaal+1;<BR />
run;Thu, 31 Mar 2011 12:29:21 GMThttps://communities.sas.com/t5/SAS-Procedures/Calculation-number-of-different-observations/m-p/41419#M10701jebuske2011-03-31T12:29:21ZCalculation number of different observations
https://communities.sas.com/t5/SAS-Procedures/Calculation-number-of-different-observations/m-p/41418#M10700
Hi,<BR />
<BR />
I've created an example in paint of how my dataset should look like (made a mistake with analys code 000001, the experience should of course go to 4 instead of 5):<BR />
<A href="http://img850.imageshack.us/img850/696/exampled.png" target="_blank">http://img850.imageshack.us/img850/696/exampled.png</A><BR />
<BR />
<BR />
At this moment I'm having the timeID and Analys variables and I should calculate the experience.<BR />
<BR />
I was thinking about something like this:<BR />
<BR />
data experience;<BR />
set experience;<BR />
if analys ne lag(analys) then do;<BR />
experience=1;<BR />
end;<BR />
else experience=experience+1;<BR />
run;<BR />
<BR />
The problem however is that it only puts a 1 on the first row when the analystcode changes but the other observations give experience=.<BR />
<BR />
Anyone knows what I'm doing wrong here?<BR />
<BR />
<BR />
Thanks a lot!
Message was edited by: jebuskeThu, 31 Mar 2011 12:21:41 GMThttps://communities.sas.com/t5/SAS-Procedures/Calculation-number-of-different-observations/m-p/41418#M10700jebuske2011-03-31T12:21:41ZCalculation of consensus forecast
https://communities.sas.com/t5/SAS-Procedures/Calculation-of-consensus-forecast/m-p/26368#M6021
Hi,<BR />
<BR />
I'm working on a study regarding forecast accuracy among financial analysts. At this moment I'm stuck calculating the analysts deviation from the consensus.<BR />
<BR />
Quote with definition of consensus: "The deviation from the consensus is determined as the difference between the analyst's forecast fikt and the consensus forecast ck concerning the earnings per share. The consensus forecast proxies for<BR />
available public information up to the point in time an analyst issues his forecast. This<BR />
consensus forecast at time T (within the quarter) is calculated as the mean of all the<BR />
analysts estimates up to T , excluding the estimate of the analyst i, who makes his<BR />
estimate for quarter t (analogous to Chen and Jiang, 2006 and Zitzewitz, 2001)<BR />
<BR />
I'm having problems programming the calculation of this consensus. In the example below I will show you what the input data looks like and what the output data should be.<BR />
<BR />
I'm sorry that my table doesn't look good but it doesn't recognize the space i used<BR />
If someone can tell me how to edit my table, I will edit it.<BR />
<BR />
<U>input data</U><BR />
<BR />
Analyst Company Year Quarter EPS-estimation Forecast date<BR />
1a A 2000 1 4 2 jan 2000<BR />
2a A 2000 1 4.5 9 jan 2000<BR />
3a A 2000 1 4.9 14 febr 2000<BR />
4a A 2000 1 4.1 19 febr 2000<BR />
5a A 2000 1 4.3 27 febr 2000<BR />
1a A 2000 2 4.7 15 mar 2000<BR />
3a A 2000 2 4.7 19 mar 2000<BR />
2a A 2000 2 5 29 apr 2000<BR />
1b B 2000 1 10 etc<BR />
2b B 2000 1 12<BR />
3b B 2000 1 10.5<BR />
4b B 2000 1 11<BR />
2b B 2000 2 15<BR />
1b B 2000 2 14<BR />
3b B 2000 2 13<BR />
5b B 2000 2 14 <BR />
]<BR />
<U>output data</U><BR />
<BR />
<BR />
Analyst Company Year Quarter EPS-estimation Forecast date Consensus<BR />
1a A 2000 1 4 2 jan 2000 <BR />
2a A 2000 1 4.5 9 jan 2000 4<BR />
3a A 2000 1 4.9 14 febr 2000 4.25<BR />
4a A 2000 1 4.1 19 febr 2000 4.46<BR />
5a A 2000 1 4.3 27 febr 2000 4.375<BR />
1a A 2000 2 4.7 15 mar 2000 <BR />
3a A 2000 2 4.7 19 mar 2000 4.7<BR />
2a A 2000 2 5 29 apr 2000 4.7<BR />
1b B 2000 1 10 etc <BR />
2b B 2000 1 12 10<BR />
3b B 2000 1 10.5 11<BR />
4b B 2000 1 11 10.833<BR />
2b B 2000 2 15 <BR />
1b B 2000 2 14 15 <BR />
3b B 2000 2 13 14.5<BR />
5b B 2000 2 14 14<BR />
<BR />
Thanks in advance!Thu, 10 Mar 2011 11:58:52 GMThttps://communities.sas.com/t5/SAS-Procedures/Calculation-of-consensus-forecast/m-p/26368#M6021jebuske2011-03-10T11:58:52ZRe: Only keep first observation of quarter
https://communities.sas.com/t5/SAS-Procedures/Only-keep-first-observation-of-quarter/m-p/13856#M2075
Thanks a lot!Mon, 21 Feb 2011 16:10:54 GMThttps://communities.sas.com/t5/SAS-Procedures/Only-keep-first-observation-of-quarter/m-p/13856#M2075jebuske2011-02-21T16:10:54ZRe: Only keep first observation of quarter
https://communities.sas.com/t5/SAS-Procedures/Only-keep-first-observation-of-quarter/m-p/13853#M2072
Thanks!<BR />
<BR />
My data indeed looks like your example, the only difference is that there is also a company YYY, ZZZ etc.<BR />
And indeed, i want to keep anna's 01/01 and bill's 01/15 forecasts.<BR />
Sorry if my question wasn't clear but english is not my native language.Sun, 20 Feb 2011 19:00:13 GMThttps://communities.sas.com/t5/SAS-Procedures/Only-keep-first-observation-of-quarter/m-p/13853#M2072jebuske2011-02-20T19:00:13ZOnly keep first observation of quarter
https://communities.sas.com/t5/SAS-Procedures/Only-keep-first-observation-of-quarter/m-p/13851#M2070
Hi,<BR />
<BR />
I'm having troubles finding a solution to my problem. I'm having a dataset with earnings forecasts from a lot of financial analysts for different companies in different quarters. I should be able to filter revisions that are made during one quarter and thus only keep their first forecast.<BR />
<BR />
What I already did is creating two new variables (quarter and year). But I don't know how to implement the filtering.<BR />
<BR />
What I know:<BR />
It should delete all observations with forecast date after the first forecast within a given quarter and year. This is the reason I created the two new variables.<BR />
This filter should be applied to every company and every analyst.<BR />
<BR />
I know it's something like this, but I don't know how to translate it into SAS.<BR />
I thought about creating a counter that would count whether it was the first, second or third forecast in a given quarter and then use a delete statement: if .. > 1 then delete.<BR />
<BR />
Your help would be much appreciated!<BR />
Thanks in advance!Sun, 20 Feb 2011 16:54:59 GMThttps://communities.sas.com/t5/SAS-Procedures/Only-keep-first-observation-of-quarter/m-p/13851#M2070jebuske2011-02-20T16:54:59Z