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 2157 10-17-2021 12:58 PM 908 05-21-2021 02:05 PM 1230 04-17-2021 06:42 PM 1230 04-17-2021 06:41 PM 1249 04-17-2021 03:04 PM 1273 04-17-2021 01:37 PM 785 03-16-2021 10:53 AM 874 03-16-2021 05:30 AM 1203 02-28-2021 01:11 PM 1639 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
09-29-2020
08:15 PM
This doesn't create sas7bdat file. It creates a file for as code, not for data.
... View more
09-29-2020
07:58 PM
Can anyone help me with the following? proc export data=have outfile="&output.want.dat" dbms=DLM replace; run; I have my libname created. But this one is not working
... View more
09-21-2020
03:53 AM
Table X gvkey fyear Name 1004 1994 a 1004 1995 a 1004 1996 b 1004 1997 b Table Y gvkey fyear Name 1004 1992 a 1004 1993 a 1004 1996 e 1004 1997 f I want to merge the above two tables in the following way gvkey fyear Name 1004 1992 a 1004 1993 a 1004 1994 a 1004 1995 a 1004 1996 b 1004 1997 b You can see that I want every observation from table X but from table Y I want only those observations that matches GVKEY but don't match fyear. From table Y if gvkey and year matches, I don't want those observations to be included in my result. Can anyone help me with how I can do this by using proc SQL? I tried to do that using left join but I don't get the desired result.
... View more
09-16-2020
02:56 PM
gvkey fyear rd Desired values (KC) 1001 1980 2.5 2.50 1001 1981 3.1 5.10 1001 1982 0.7 4.78 1002 1980 1.2 1.20 1002 1981 5.5 6.46 1002 1982 12.4 17.57 1003 1980 4.6 4.60 1003 1981 2.9 6.58 1003 1982 1.8 7.06 1003 1983 12.45 18.10 1003 1984 15.55 30.03 1003 1985 16.87 40.89 Hi, From the above data, I want to calculate values in the "Desired Value" column. Desired value = 0.8*lag(kc)+rd. Here, for each of the first observation according to gvkey, there is no kc. So, for the first gvkey the equation will be Desired value = 0.8*0+rd. That means, the first gvkey kc is zero. I used the following code Data want; set have; by gvkey fyear; retain kc; if first.gvkey then kc=rd; else kc = 0.8* lag(kc) +rd; run; Problem is that I am not getting the desired result. Could you please help me? What mistakes am I making?
... View more
03-23-2020
09:39 AM
Paige Miller Thank you very much. It works.
... View more
03-23-2020
09:33 AM
I am sorry. I have edited the data slightly. Now I am not getting what I want. If you look at the first gvkey 1331 the dummy should be 0, but I am getting 1.
... View more
03-23-2020
09:23 AM
3643 Data comp33; 3644 set comp3; 3645 by gvkey fy; 3646 if first.gvkey then sales_growth=0; 3647 else sales_growth=log((1+wsale)/lag((1+wsale))); 3648 run; NOTE: Missing values were generated as a result of performing an operation on missing values. Each place is given by: (Number of times) at (Line):(Column). 1 at 3647:19 1 at 3647:32 NOTE: There were 110195 observations read from the data set WORK.COMP3. NOTE: The data set WORK.COMP33 has 110195 observations and 43 variables. NOTE: DATA statement used (Total process time): real time 0.11 seconds cpu time 0.07 seconds By the way, I don't have any missing observation in my first gvkey and problem is I am missing value for the first gvkey only
... View more
03-23-2020
09:21 AM
gvkey year RET 1004 1992 -0.04762 1004 1993 0.0138 1004 1994 -0.00429 1004 1995 -0.14493 1004 1996 0.067797 1004 1997 0.107302 1004 1998 0.072464 1004 1999 0.057027 1331 1992 0.038333 1331 1993 -0.05405 1331 1994 -0.04286 1331 1995 -0.03343 1331 1996 -0.03125 24456 1992 -0.02621 24456 1993 0.006377 24456 1994 0 24456 1995 0.05 24456 1996 0.060317 I have the above data and aI want the following result gvkey year RET ret_cut_dummy 1004 1992 -0.04762 0 1004 1993 0.0138 0 1004 1994 -0.00429 1 1004 1995 -0.14493 1 1004 1996 0.067797 0 1004 1997 0.107302 0 1004 1998 0.072464 1 1004 1999 0.057027 1 1331 1992 0.038333 0 1331 1993 -0.05405 1 1331 1994 -0.04286 0 1331 1995 -0.03343 0 1331 1996 -0.03125 0 24456 1992 -0.02621 0 24456 1993 0.006377 0 24456 1994 0 1 24456 1995 0.05 0 24456 1996 0.060317 0 So, I want dummy variable equals one if there is a reduction in annual ret, and zero otherwise. I use the following code but I am not getting 0 for the first gvkey. Though my data are sorted by gvkey and year, the result I am getting is not by year. Data want; set have; by gvkey year; if first.gvkey then ret_cut_dummy=0; if ret < lag(ret) then ret_cut_dummy=1; else ret_cut_dummy=0; run;
... View more
03-23-2020
09:09 AM
I have edited the code and I don't have any error in the log.
... View more
03-23-2020
08:37 AM
Hi, My data are sorted by gvkey and year. I ran the following code. Data want; set have; if first.gvkey then sales_growth=0; else sales_growth=log((1+sale)/lag((1+sale))); run; I get sales growth number as expected for the whole data set except the following. Gvkey year sale sales_growth 1004 2000 28796 0 1004 2001 34697 . 1004 2002 36784 0.0601 My question is why I am getting missing value in the 2nd year? In my data set 1004 is the first gvkey. The problem is happening only for the first gvkey. For other gvkey I am not having this problem. Can anyone help me please?
... View more
03-23-2020
12:46 AM
Thanks, Patrick, This one works. But I am not still sure why apy=apy*(1+ret). Won't we need apy=lag(apy)*(1+ret)? Why doesn't lag(apy) work? I tried to use lag but got missing observations.
... View more