01-28-2023
abdulla
Pyrite | Level 9
Member since
02-07-2019
- 136 Posts
- 75 Likes Given
- 1 Solutions
- 5 Likes Received
-
Latest posts by abdulla
Subject Views Posted 2136 10-17-2021 12:58 PM 900 05-21-2021 02:05 PM 1196 04-17-2021 06:42 PM 1196 04-17-2021 06:41 PM 1215 04-17-2021 03:04 PM 1239 04-17-2021 01:37 PM 775 03-16-2021 10:53 AM 864 03-16-2021 05:30 AM 1199 02-28-2021 01:11 PM 1632 02-17-2021 07:23 PM -
Activity Feed for abdulla
- Posted Match using names on SAS Programming. 10-17-2021 12:58 PM
- Liked Re: Industry-Year fixed effect Vs. Sorting by Industry year for sbxkoenk. 09-15-2021 12:13 PM
- Posted Industry-Year fixed effect Vs. Sorting by Industry year on SAS Programming. 05-21-2021 02:05 PM
- Posted Re: Testing Coefficient difference on SAS Programming. 04-17-2021 06:42 PM
- Posted Re: Testing Coefficient difference on SAS Programming. 04-17-2021 06:41 PM
- Posted Re: Testing Coefficient difference on SAS Programming. 04-17-2021 03:04 PM
- Posted Testing Coefficient difference on SAS Programming. 04-17-2021 01:37 PM
- Got a Like for Re: Join two files based on name. 03-16-2021 11:38 AM
- Posted Re: Join two files based on name on SAS Programming. 03-16-2021 10:53 AM
- Liked Re: Join two files based on name for Sajid01. 03-16-2021 10:50 AM
- Posted Join two files based on name on SAS Programming. 03-16-2021 05:30 AM
- Liked Re: If then statement with ranges of variables for Kurt_Bremser. 02-28-2021 01:30 PM
- Liked Re: If then statement with ranges of variables for PeterClemmensen. 02-28-2021 01:29 PM
- Posted If then statement with ranges of variables on SAS Programming. 02-28-2021 01:11 PM
- Liked Re: multiple left join for RW9. 02-23-2021 06:34 PM
- Posted Re: test the coefficient difference of two groups on SAS Programming. 02-17-2021 07:23 PM
- Posted Re: test the coefficient difference of two groups on SAS Programming. 02-14-2021 06:43 PM
- Posted Re: test the coefficient difference of two groups on SAS Programming. 02-14-2021 06:38 PM
- Posted test the coefficient difference of two groups on SAS Programming. 02-13-2021 11:00 PM
- Liked Re: beta coefficients from the regression for Ksharp. 02-12-2021 10:48 AM
-
Posts I Liked
Subject Likes Author Latest Post 1 1 1 1 1 -
My Liked Posts
Subject Likes Posted 1 03-16-2021 10:53 AM 1 10-01-2020 01:25 AM 1 09-30-2020 09:52 PM 1 09-30-2020 09:55 PM 1 10-06-2019 04:45 AM
03-23-2020
12:28 AM
After using this code, I am getting return2 column is giving me similar result to return1 column. Though I have used by gvkey and date, the program doesn't recognize first.date and so probably gives me the return1 result in return2 column. I don't know how to solve this problem. I have given the actual code I have used. The result I want is similar to the example I have given
... View more
03-23-2020
12:03 AM
gvkey date RET 10001 19940131 -0.04762 10001 19940228 0 10001 19940331 -0.00429 10001 19940429 -0.14493 10001 19940531 0.067797 10001 19940630 0.107302 10001 19940729 0.072464 10001 19940831 -0.02703 10001 19940930 0.038333 10001 19941031 -0.05405 10001 19941130 -0.04286 10001 19941230 -0.03343 10001 19950131 -0.03125 10001 19950228 -0.02621 10001 19950331 0.006377 10001 19950428 0 10001 19950531 0.05 10001 19950630 0.060317 10001 19950731 0 10001 19950831 -0.0303 10001 19950929 0.04375 10001 19951031 -0.0303 10001 19951130 0.09375 10001 19951229 0.082857 I have a large data set with many gvkey and monthly return(ret) like the above To calculate the annual return from monthly return, I have used the following code. Data annual_returns; set return; return1= 1+ret; if first.date then return2= return1; else return2= return1*(lag(return2)); annual_return=return2-1; by gvkey date; run; But I am not getting the expected result. I tried to use the codes available in the forum but none is giving me the expected result. The formula is given below. APY = (1+r1)*(1+r2) *(1+r3) *(1+r4) *(1+r5) *(1+r6) *(1+r7) *(1+r8) *(1+r9) *(1+r10) *(1+r11) *(1+r12) – 1 Let’s say the twelve monthly returns are 2%, 2.2%, 2.1%, -1.5%, 2%, 2.4%, 1%, -1.2%, -0.5%, 0.7%, 1%, and 1.5%. Using the above monthly returns, we can calculate the annualized returns as follows: APY = (1.02)(1.022)(1.021)(0.985)(1.02)(1.024)(1.01)(0.988)(0.995)(1.007)(1.01)(1.015) – 1 Annualized return = 0.1223 or 12.23% What mistake am I making? What should be the correct code?
... View more
03-20-2020
08:34 PM
I need it by fy too. Now I am getting a lot of missing for fy. I have data like the following. gvkey fy 1311 1995 1311 1995 1311 1995 1311 1995 1311 1995 1311 1996 1311 1996 1311 1996 1311 1996 1311 1996 1311 1996 1311 1996 1311 1996 1311 1997 1311 1997 1311 1997 1311 1997 1311 1997 1311 1997
... View more
03-20-2020
07:16 PM
gvkey fy TA 1700 1995 3311.662 1700 1995 1599.234 1700 1995 564.76 1700 1995 560.047 1700 1995 656.226 1700 1996 577.841 1700 1996 1696.431 1700 1996 1081.963 1700 1996 1727.069 1700 1996 4182.832 1700 1996 2068.554 1700 1996 841.204 1700 1996 . 84578 1995 1312.852 84578 1995 1131.176 84578 1995 3700.925 84578 1995 1099.786 84578 1995 848.657 84578 1995 1067.566 The above is my data and I want to get the following result. gvkey fy TA Sum 1700 1995 3311.662 6691.929 1700 1995 1599.234 6691.929 1700 1995 656.226 6691.929 1700 1995 564.76 6691.929 1700 1995 560.047 6691.929 1700 1996 4182.832 10756.85 1700 1996 2068.554 10756.85 1700 1996 1727.069 10756.85 1700 1996 1696.431 10756.85 1700 1996 1081.963 10756.85 1700 1996 841.204 . 1700 1996 577.841 . 1700 1996 . . 84578 1995 3700.925 8312.305 84578 1995 1312.852 8312.305 84578 1995 1131.176 8312.305 84578 1995 1099.786 8312.305 84578 1995 1067.566 8312.305 84578 1995 848.657 . I want to get the sum of the first 5 highest observations. I have used the following code. proc sort data= have; by gvkey fy decending TA; run; Proc sql; create table want as select *,sum(TA) as sum from have group by gvkey, fy; quit; I get the sum but if I have more than 5 observations in the TA column, I get sum for all of the observations. I want the sum for only the first 5 highest observations. And most importantly I don't want to lose any other rows also. I need to have all the rows in my output. Can anyone please help?
... View more
02-03-2020
12:49 AM
Based on the link which one would be correct proc genmod data =have;
model minute = customer / link=log dist=Poisson;
run; or the following? proc genmod data =have;
model customer = minute / link=log dist=Poisson;
run;
... View more
02-02-2020
08:31 PM
Hi, I want to calculate the customer arrival rate. A customer arrives in the store in how many minutes. For example, from our data, we may get that a customer arrives at the store in every 7 min. if we have two columns, one for "minute" and the other for "no of the customer", what would be the SAS code? This is a Poisson distribution. Please help Minute "Customer of customers" 5 2 10 6 7 3 6 1 4 2 9 5 11 4 2 3 8 5 So, I want to get " In every how many minutes a customer come?". This is the property of Poisson distribution. The above is just an example. The answer could be " a customer comes in every 1.5 min".
... View more
01-18-2020
01:56 PM
Hi novinosrin, Thank you very much. By SIC 2 means, I am trying to find a median based on SIC two-digit match. For example, SIC 5080 and 5081 are matched by two and three digit but not 4 digit. So, group can be all SIC based on two digit (50 as an example) or three digit (508 as an example) and by each year.
... View more
01-18-2020
01:04 PM
SIC Year share Dummy 5080 2010 1489.499 5080 2010 68.57 5080 2011 1193.963 5080 2011 427.454 5080 2012 134.285 5080 2012 1151.153 5080 2012 0 5080 2012 157.123 5080 2012 62.593 4512 2010 2455.718 4512 2010 873.324 4512 2011 403.31 4512 2011 0 4512 2011 357.093 4512 2011 243.378 4512 2012 724.538 4512 2012 421.442 4512 2012 198.51 3670 2010 34.59 3670 2010 32.13 3670 2010 143.4 3670 2010 15.883 3670 2010 0.522 Hi, I want to create a dummy variable from the column "share". if the share is above the median then 1 else 0. Median is calculated by SIC 2, 3, and 4 digits and by year. I can solve it step by step procedure. It will take multiple steps. Is there any procedure by which I can do the above in one step?
... View more
01-17-2020
06:29 PM
Thank you very much. Could you give me a video link from which I can learn necessary SAS coding for Finance student
... View more
01-17-2020
03:13 PM
Rank TDC1 GVKEY Year Percentage of TDC1 1 5237.743 1004 2010 0.4265 2 2554.467 1004 2010 3 1578.104 1004 2010 5 1314.079 1004 2010 4 1596.902 1004 2010 1 5786.4 1004 2011 2 2781.156 1004 2011 4 1696.431 1004 2011 3 1727.069 1004 2011 1 4182.832 1004 2012 0.4386 2 2068.554 1004 2012 5 841.204 1004 2012 3 1312.852 1004 2012 4 1131.176 1004 2012 1 3700.925 1013 2010 0.4832 2 1099.786 1013 2010 5 848.657 1013 2010 3 1067.566 1013 2010 4 941.748 1013 2010 1 5231.393 1045 2010 0.3532 4 2372.14 1045 2010 5 1776.069 1045 2010 3 2288.908 1045 2010 2 3142.082 1045 2010 Hi, I need help for the following. 1. The ranks in the above data are created based on the TDC1. There should be 5 TDC1 observations based on each year. But if you look at 2011, it misses one observation. So, I want to delete all the observations in that year. I have a huge data set. In that data set, if I have less than 5 TDC1 observations in each year or GVKEY, I have to remove all the observations for that particular year and GVKEY. I want to be consistent throughout so that I will have 5 TDC1 observations for each year for different GVKEY. Can anyone please help me by giving me SAS code for that? 2. I need to find the percentage of TDC1 for each year and for Rank 1. An example is given in the last column above. the percentage for the first row is (5237.743/(5237.743+2554.467+1578.104+1314.079+1596.902). Please give me SAS code for this too.
... View more
10-08-2019
04:05 PM
Thank you very much Tom.
... View more
10-08-2019
03:59 PM
Mr Reeza. I am in a hurry to finish my work and seeking for help. I don't really have time now to go through so many things, Could you please give me code so that I can finish my things.
... View more
10-08-2019
03:48 PM
Hi I have date which is in format yymmddn8 and informat yymmdd6. I want to convert them into format Best12 and informat 12. Can anyone help me by giving code for that? I need to merge file by date but my date in two files are formated differently
... View more
10-08-2019
03:28 PM
I think in my file the date is not formatted the same way as in other. in one file date is Best12 and informat is 12 (this is the sas format) format and in the other file Date is formatted as YYMMDDN8. informat YYMMDD6. Could you please show me how I can format date as Best12 and infomat 12
... View more