I have a data set contains DMRN, last visit date, the presence of UI, and recorded date of UI.
DMRN
last_visit
UI
recorded_time
31
26AUG2021
0
06APR2018
31
26AUG2021
0
16JAN2020
31
26AUG2021
1
4MAY2021
33
24MAY2022
0
02MAR2020
33
24MAY2022
0
24MAY2022
35
01DEC2014
0
25MAR2013
I would like to create new_date for each DMRN based on these conditions: if UI = 1 then new_date = recorded_time else if UI = 0 then new_date = last_visit The outcome would be like as follow:
DMRN
last_visit
UI
recorded_time
new_date
31
26AUG2021
0
06APR2018
4MAY2021
31
26AUG2021
0
16JAN2020
4MAY2021
31
26AUG2021
1
4MAY2021
4MAY2021
33
24MAY2022
0
02MAR2020
24MAY2022
33
24MAY2022
0
24MAY2022
24MAY2022
35
01DEC2014
0
25MAR2013
01DEC2014
Could you please help me with the code? Thank you very much
... View more
Hi, I have a dataset where the year goes from [2000,2015] where I have these countries: Spain, France, Denmark and European Union and let's say two colomns; company='A' and 'B' and value='dollar' Q1: if Spain for company A have average vaule 0.288 Denmark also France also for aaaalll of the 15 years. BUT! We have EU (recall, France, Spain, Denmark are all in European Union (EU)) and for one (1) year EU have the avarage for the same company A, have tha average vaule at 1,000 Q2: For company B;, France, Spain, Denmark and European Union (EU)) have data from [2000,2015] and have ~the same avarage all the four, how to solve that issue besT?
... View more
Would u like to help me to categorize market values into three groups labeled as small, mid, and big? FIRMS ARE ASSIGNED TO A SIZE QUARTILE GROUP BASED ON THEIR PREVIOUS MONTH’S MARKET VALUE OF EQUITY THE 0~<25% ARE GROUP BY SMALL SIZE, THE 25%~<50% ARE GROUP BY MEDIUM SIZE, THE 50%~100% ARE GROUP BY BIG SIZE. PROC SORT DATA BY DATE PERMNO MARKET VALUE(SMALL TO BIG), AND GIVE EACH DATE PERMNO MARKET VALUE. DATA SORTED;
SET SORTED;
BY DATE PERMNO;
IF LAST.PERMNO THEN DO;
CALL STREAMINIT(123);
RANK = RANKTIE(LAST_MONTH_MV, 'DESCENDING');
PCTILE = RANK / (LAST.PERMNO + 1);
IF PCTILE < 0.25 THEN SIZE_GROUP = 'SMALL';
ELSE IF PCTILE < 0.50 THEN SIZE_GROUP = 'MEDIUM';
ELSE SIZE_GROUP = 'BIG';
END;
RUN; ERROR 68-185: The function RANKTIE is unknown, or cannot be accessed.
... View more
Proc export giving additional quotes to the quoted char values.and if u use data step for that it is giving a space or . To numeric values which is not required . Needs to change nothing.now it is , , but want ,, no space no .for missing numeric value.
... View more