-
Latest posts by hx
Subject Views Posted 555 04-19-2019 01:07 PM 8416 05-19-2018 03:57 PM 8435 05-19-2018 03:32 PM 1177 03-01-2017 03:03 PM 7698 02-22-2017 03:28 PM 7719 02-22-2017 11:02 AM 906 12-05-2016 10:46 AM 2631 12-02-2016 05:14 PM 956 12-02-2016 05:12 PM 2636 12-02-2016 05:05 PM -
Activity Feed for hx
- Posted sort and extract by table on SAS Programming. 04-19-2019 01:07 PM
- Posted Re: merge by date and date range on SAS Programming. 05-19-2018 03:57 PM
- Posted merge by date and date range on SAS Programming. 05-19-2018 03:32 PM
- Liked Re: delete and cells up for art297. 03-02-2017 02:37 PM
- Posted delete and cells up on SAS Programming. 03-01-2017 03:03 PM
- Posted Re: merge datasets and sum on SAS Programming. 02-22-2017 03:28 PM
- Posted merge datasets and sum on SAS Programming. 02-22-2017 11:02 AM
- Posted Re: How to group observations with logic? on SAS Programming. 12-05-2016 10:46 AM
- Posted Re: How to group observations with logic? on SAS Programming. 12-02-2016 05:14 PM
- Posted Re: How to group observations with logic? on SAS Programming. 12-02-2016 05:12 PM
- Posted Re: How to group observations with logic? on SAS Programming. 12-02-2016 05:05 PM
- Posted Re: How to group observations with logic? on SAS Programming. 12-02-2016 04:40 PM
- Posted Re: How to group observations with logic? on SAS Programming. 12-02-2016 04:17 PM
- Posted Re: How to group observations with logic? on SAS Programming. 12-02-2016 03:59 PM
- Posted Re: How to group observations with logic? on SAS Programming. 12-02-2016 03:44 PM
- Posted How to group observations with logic? on SAS Programming. 12-02-2016 03:01 PM
- Posted Re: how to sum the values of similar words? on SAS Programming. 11-28-2016 05:19 PM
- Posted how to sum the values of similar words? on SAS Programming. 11-28-2016 03:26 PM
- Posted Re: how do I group data and calculate sum using 'like' operator? on SAS Programming. 11-21-2016 03:53 PM
- Posted Re: how do I group data and calculate sum using 'like' operator? on SAS Programming. 11-21-2016 12:50 PM
-
Posts I Liked
Subject Likes Author Latest Post 1
04-19-2019
01:07 PM
table 1 date price company1 1/1/2000 10 company2 1/1/2000 11 table2 date price company1 12/31/1999 10.1 company1 1/1/2000 10 company1 1/2/2000 10.2 company1 1/3/2000 10.1 company1 1/4/2000 10.3 company2 12/31/1999 11.2 company2 1/1/2000 11 company2 1/2/2000 11.2 company2 1/3/2000 10 company2 1/4/2000 11.3 table3 date price company1 12/31/1999 10.1 company1 1/1/2000 10 company1 1/2/2000 10.2 company2 12/31/1999 11.2 company2 1/1/2000 11 company2 1/2/2000 11.2 Hi, I have datasets that look like table1 and table2, the result I want is table3. That is, the data I need is 1 lag date of the price and 1 day after. Can someone help me with this in SAS?
... View more
05-19-2018
03:32 PM
I have two datasets cusip6 date nation 123r 5/8/2015 us a234 5/8/2010 us cusip6 begin end price 123r 5/8/2013 5/8/2016 13 123r 5/8/2010 5/7/2013 9 I want to merge them and get the following results. cusip6 date nation price 123r 5/8/2015 us 13 Can anyone help me?
... View more
03-01-2017
03:03 PM
Hi, I have a dataset which looks like years group t 2016 aas 2 2016 dsa 1 2016 asdfg . 2015 aas 3 2015 dsa 3 2015 asdfg 6 2014 aas 5 2014 dsa 76 2014 asdfg 765 2013 aas . 2013 dsa 2 2013 asdfg . 2012 aas 3 2012 dsa 3 2012 asdfg . 2011 aas . 2011 dsa . 2011 asdfg 1 2010 aas 3 2010 dsa 3 2010 asdfg 4 2009 aas 6 2009 dsa 8 2009 asdfg 9 And what I want will be like years group t t1 t2 t3 t4 t5 t6 t7 2016 aas 2 3 5 . 3 . 3 6 2016 dsa 1 3 76 2 3 . 3 8 2016 asdfg . 6 765 . . 1 4 9 2015 aas 3 5 . 3 . 3 6 2015 dsa 3 76 2 3 . 3 8 2015 asdfg 6 765 . . 1 4 9 2014 aas 5 . 3 . 3 6 2014 dsa 76 2 3 . 3 8 2014 asdfg 765 . . 1 4 9 2013 aas . 3 . 3 6 2013 dsa 2 3 . 3 8 2013 asdfg . . 1 4 9 2012 aas 3 . 3 6 2012 dsa 3 . 3 8 2012 asdfg . 1 4 9 2011 aas . 3 6 2011 dsa . 3 8 2011 asdfg 1 4 9 2010 aas 3 6 2010 dsa 3 8 2010 asdfg 4 9 2009 aas 6 2009 dsa 8 2009 asdfg 9 Basically, I want to generate t-sequence variables that have values one year before. For example, t1 is generated with the start of values from year 2015. t2 is generated with the start of values from year 2014 and so on. I know it is quite simple to do with excel, I can delete and cells up one column by another.But the truth is the original dataset contains 500,000 observations. I am trying to figure out a way using SAS. Can some one help me out? really appreciated,
... View more
02-22-2017
03:28 PM
thank you kurtbremser, I think I have found a way to get my results.
... View more
02-22-2017
11:02 AM
Hi, I got two tables A and B, which look like the following. table A group c1 c2 c3 c4 var 1 2 . 1 each . 3 . 2 value 4 5 4 . new . 1 6 . table B group c1 c2 c3 c4 var . 1 3 1 each . 1 2 1 home 2 4 1 1 new . 2 1 1 The results I want are a table which merges these two tables by variable group and sum the other variables. Results should be like table C, table C group c1 c2 c3 c4 var 1 3 3 2 each . 4 2 5 home 2 4 1 1 new . 3 7 1 value 4 5 4 . The real datasets are more complicated which contains thousands of observations and 33 variables. Can anyone help me out? Appreciated
... View more
12-02-2016
05:14 PM
I tried but it seemed that new variable nw only has one value which is the last w in the set.
... View more
12-02-2016
05:05 PM
Thank you so much Reeza! it did work! I got to look deep into your code to get better understanding.
... View more
12-02-2016
04:40 PM
How can I set the value of the flag? Should I use dummies or 'w'?
... View more
12-02-2016
04:17 PM
Yeah, but your code did give me some thinking, by using the group did give me something like what I want, yet still can't. Thank you anyway, I'm still trying
... View more
12-02-2016
03:59 PM
Do you mean reverse them by w alphabetically? But I still want to get the new variable based on w/values, how does that work by reversing?
... View more
12-02-2016
03:44 PM
Thank you for your reply, mkeintz! w=abate/value=200 get nw=abl1 because I wanted to get the nw="the last w of the values that are <=200", for instance w=accident/value=200 get nw=accident because accidents/value=230 which is larger than 200. Does that make sense? sorry I didn't describe it clearly.
... View more
12-02-2016
03:01 PM
Hi, I have a dataset as follows, the variable 'w' has already been sorted, and I want to group them according to the values of 'value' and generate a new variable 'nw', and 'nw' should be given as the last w whose value is less than or equal to 200, and for those values large than 200, stay the same. It's really hard to describe here. w value abate 200 abbreviations 50 abdomen 20 abdominal 110 abelcet 100 aberrant 100 abiraterone 100 abl1 100 ablation 210 abnormal 30 abo 780 abscission 260 absence 100 absenteeism 140 absorption 130 abstinence 150 abstracting 110 academia 210 academic 30 academy 600 acceleration 180 access 130 accessibility 100 accident 200 accidents 230 accountability 50 accounting 100 accreditation 230 acculturation 30 ace 600 acetates 920 acetazolamide 310 acetic 110 acetone 210 acetyl 50 acetylaminofluorene 200 acetylatio 230 acetylation 200 bupropion 550 burden 560 burkitt's 230 burn 300 burns 140 businesses 550 butanoic 800 butterflies 500 butyrates 100 butyric 450 butyryl 800 bypass 330 bystander 300 c 300 c2 130 c2h2 150 c3h 250 c57bl 720 That is to say, I want to have something like: w value nw abate 200 abl1 abbreviations 50 abl1 abdomen 20 abl1 abdominal 110 abl1 abelcet 100 abl1 aberrant 100 abl1 abiraterone 100 abl1 abl1 100 abl1 ablation 210 ablation abnormal 30 abnormal abo 780 abo abscission 260 abscission absence 100 abstracting absenteeism 140 abstracting absorption 130 abstracting abstinence 150 abstracting abstracting 110 abstracting academia 210 academia academic 30 academic academy 600 academy acceleration 180 accident access 130 accident accessibility 100 accident accident 200 accident accidents 230 accidents accountability 50 accounting accounting 100 accounting accreditation 230 accreditation acculturation 30 acculturation ace 600 ace acetates 920 acetates acetazolamide 310 acetazolamide acetic 110 acetic acetone 210 acetone acetyl 50 acetylaminofluorene acetylaminofluorene 200 acetylaminofluorene acetylatio 230 acetylatio acetylation 200 acetylation bupropion 550 bupropion burden 560 burden burkitt's 230 burkitt's burn 300 burn burns 140 burns businesses 550 businesses butanoic 800 butanoic butterflies 500 butterflies butyrates 100 butyrates butyric 450 butyric butyryl 800 butyryl bypass 330 bypass bystander 300 bystander c 300 c c2 130 c2h2 c2h2 150 c2h2 c3h 250 c3h c57bl 720 c57bl All the things that came into my mind is to use sort but I don't think it worked. It seems like I cannot sort by the 'values' since I have sorted the data by'w', can someone help me out? Really appreciated.
... View more