01-19-2024
Khaladdin
Quartz | Level 8
Member since
01-11-2017
- 104 Posts
- 27 Likes Given
- 1 Solutions
- 4 Likes Received
-
Latest posts by Khaladdin
Subject Views Posted 3206 01-15-2024 04:09 AM 3371 01-14-2024 08:47 AM 3373 01-14-2024 08:45 AM 3413 01-14-2024 07:31 AM 3426 01-14-2024 07:21 AM 3470 01-14-2024 05:31 AM 1339 01-11-2023 04:30 PM 1339 01-11-2023 04:30 PM 1405 01-11-2023 11:33 AM 746 11-06-2022 10:53 AM -
Activity Feed for Khaladdin
- Posted Re: Filling missing values on SAS Programming. 01-15-2024 04:09 AM
- Liked Re: Filling missing values for Ksharp. 01-15-2024 04:09 AM
- Posted Re: Filling missing values on SAS Programming. 01-14-2024 08:47 AM
- Posted Re: Filling missing values on SAS Programming. 01-14-2024 08:45 AM
- Posted Re: Filling missing values on SAS Programming. 01-14-2024 07:31 AM
- Posted Re: Filling missing values on SAS Programming. 01-14-2024 07:21 AM
- Posted Filling missing values on SAS Programming. 01-14-2024 05:31 AM
- Posted Re: Filling up missing values on SAS Programming. 01-11-2023 04:30 PM
- Posted Re: Filling up missing values on SAS Programming. 01-11-2023 04:30 PM
- Liked Re: Filling up missing values for ErikLund_Jensen. 01-11-2023 04:29 PM
- Liked Re: Filling up missing values for s_lassen. 01-11-2023 04:28 PM
- Posted Filling up missing values on SAS Programming. 01-11-2023 11:33 AM
- Posted Re: Applying SAS function by group on SAS Programming. 11-06-2022 10:53 AM
- Posted Applying SAS function by group on SAS Programming. 11-06-2022 09:08 AM
- Posted Re: Granger Causality Test on panel data on SAS Forecasting and Econometrics. 08-18-2021 10:30 AM
- Liked Re: Granger Causality Test on panel data for SASCom1. 08-18-2021 10:30 AM
- Posted Granger Causality Test on panel data on SAS Forecasting and Econometrics. 08-12-2021 10:02 AM
- Posted Re: Computing 10-second price difference on SAS Programming. 02-04-2021 06:42 AM
- Posted Re: Computing 10-second price difference on SAS Programming. 02-03-2021 03:51 PM
- Liked Re: Computing 10-second price difference for PeterClemmensen. 02-03-2021 03:46 PM
-
Posts I Liked
Subject Likes Author Latest Post 1 1 1 1 1 -
My Liked Posts
Subject Likes Posted 2 11-02-2017 08:22 AM 1 04-16-2017 04:11 AM 1 01-12-2017 05:32 AM
01-14-2024
08:47 AM
I would like to provide additional details to clarify my question. My apologies for any inconvenience caused. My dataset comprises various events, all recorded in Column X. This column contains a value when an event occurs; if no event occurs, Column X is left blank. For a more comprehensive understanding, please refer to the following data: Date Column X 01.01.2022 . 02.01.2022 . 03.01.2022 . 04.01.2022 . 05.01.2022 . 06.01.2022 . 07.01.2022 1 08.01.2022 . 09.01.2022 . In this dataset, an event is recorded on 07.01.2022, marked as '1' in Column X. Each event is uniquely identified, such as the second event being marked as '2' on its respective date. I am looking to create an 'event window' for each event, encompassing 5 days prior to and 1 day after the event date. Specifically, I aim to generate data output as follows: Date Column X 01.01.2022 . 02.01.2022 1 (pre-event window) 03.01.2022 1 (pre-event window) 04.01.2022 1 (pre-event window) 05.01.2022 1 (pre-event window) 06.01.2022 1 (pre-event window) 07.01.2022 1 (event date) 08.01.2022 1 (post-event window) 09.01.2022 . Please be aware that using the date column presents challenges. This is due to some events occurring on Fridays, resulting in the next available day being Monday. In terms of handling conflicts: if another event occurs 3 days before a given event, we should only use observations up to the date of this preceding event. Additionally, if two events happen on consecutive dates, we will exclude the post-event window and include only the days leading up to the first event. I have about 7 million rows in the data. I hope it is now clear. Thanks everyone.
... View more
01-14-2024
08:45 AM
I would like to provide additional details to clarify my question. My apologies for any inconvenience caused. My dataset comprises various events, all recorded in Column X. This column contains a value when an event occurs; if no event occurs, Column X is left blank. For a more comprehensive understanding, please refer to the following data: Date Column X 01.01.2022 . 02.01.2022 . 03.01.2022 . 04.01.2022 . 05.01.2022 . 06.01.2022 . 07.01.2022 1 08.01.2022 . 09.01.2022 . In this dataset, an event is recorded on 07.01.2022, marked as '1' in Column X. Each event is uniquely identified, such as the second event being marked as '2' on its respective date. I am looking to create an 'event window' for each event, encompassing 5 days prior to and 1 day after the event date. Specifically, I aim to generate data output as follows: Date Column X 01.01.2022 . 02.01.2022 1 (pre-event window) 03.01.2022 1 (pre-event window) 04.01.2022 1 (pre-event window) 05.01.2022 1 (pre-event window) 06.01.2022 1 (pre-event window) 07.01.2022 1 (event date) 08.01.2022 1 (post-event window) 09.01.2022 . Please be aware that using the date column presents challenges. This is due to some events occurring on Fridays, resulting in the next available day being Monday. In terms of handling conflicts: if another event occurs 3 days before a given event, we should only use observations up to the date of this preceding event. Additionally, if two events happen on consecutive dates, we will exclude the post-event window and include only the days leading up to the first event. I hope it is now clear. Thanks everyone.
... View more
01-14-2024
07:31 AM
I just checked the data. There are no conflicts. The only important issue is I need to fill out the missing values. That is it.
... View more
01-14-2024
07:21 AM
Thanks, In this case: 1 1 1 1 (non-missing) 1 2 2 2 (non-missing) 3 (non-missing) 3 . Also, there are only a few conflicting cases.
... View more
01-14-2024
05:31 AM
Hi all, Happy New Year! For each non-missing value in Column X, I want to fill the previous 5 and the next 1 observation with this non-missing value. In short, I have the following dataset: Column X . . . . . . . 1 (non-missing) . . I want to have the following output: Column X . . 1 (previous 5 missing values are filled our with non-missing) 1 (previous 5 missing values are filled our with non-missing) 1 (previous 5 missing values are filled our with non-missing) 1 (previous 5 missing values are filled our with non-missing) 1 (previous 5 missing values are filled our with non-missing) 1 (non-missing) 1 (next one missing value is filled out with non-missing) . Thanks!
... View more
01-11-2023
04:30 PM
Thank you very much! It works too. However, the next code works more efficiently in terms of timing.
... View more
01-11-2023
11:33 AM
I have the following dataset: Group Value A . A . A . A 1 A . B . B . B 1 B . B . For each group, I want to fill the missing values of the previous two rows with the non-missing values. Specifically, I want to get the following data: Group Value A . A 1 A 1 A 1 A . B 1 B 1 B 1 B . B . I hope I could explain myself 🙂 Many thanks in advance! Best, Khaladdin
... View more
11-06-2022
10:53 AM
Sorry, I should define the question better. I found a way. Thanks!
... View more
11-06-2022
09:08 AM
Hi all, I hope you all have a good weekend! I am using the following code to compute statistics that I need: data want; if _N_ = 1 then do; dcl hash h(multidata : "Y", ordered : "Y"); h.definekey("d", "t"); h.definedata("d", "t", "v", "p"); h.definedone(); dcl hiter hi("h"); dcl hash hh(); hh.definekey("d", "t"); hh.definedata("s"); hh.definedone(); do until (z); set have end = z; h.add(key : date, key : time, data : date, data : time, data : volume, data : price); if hh.find(key : date, key : Time) ne 0 then s = volume; else s + volume;* will be used to compute vol-weig price ; hh.replace(key : date, key : Time, data : s); end; end; set have; d = .; t = .; v = .; p = .; s = .; if h.find(key : Date, key : Time + 10) = 0 then mt = t; else do; rc = hi.setcur(key : Date, key : Time); do i = 1 by 1 while(hi.next() = 0 & Date = d); if t - time > 10 then do; if i = 1 then mt = .; leave; end; if t > time then mt = t; end; end; rc = hh.find(key: date, key : mt); rc = h.reset_dup(); do while (h.do_over(key : date, key : mt) = 0); pp = sum(pp, divide(v, s) * p); end; dif = (log(price) - log(pp))*10000; *bps; run; The issue is I need to apply this function by group. Is there an easy way of doing this? Thanks!
... View more
08-18-2021
10:30 AM
Many thanks!
... View more
08-12-2021
10:02 AM
Hi all, Is there a way of estimating Granger causality on panel data? There are some open questions in the community; however, no one has answered yet.
... View more