Hello, I used sgplot/template to create a graph below. Is there any option to move those tickvalues (0, 20, 40...100) below the x2axis? Thanks
... View more
Hello, I created a macro to calculate two values based on input and assign them to 2 global macro variables _obs and _rate. But right now I have some problems when use it in a data step. My data step code is the following: data d2; set d1; call execute('%nrstr(%incidence_sys(_var1="'||Type||'"))'); obs = &_obs; rate = &_rate; run; The macro is %incidence_sys. I want to use each 'Type' of observation as my macro input. Then the macro computes and saves those two global macro variables: _obs and _rate. Next I need to assign them to two variables of each row in dataset. But the code seems run the macro through all rows first then assigns the last _obs and _rate back to all rows. I set my macro to put some results, it did calculate values based on each row. My data set is like ID Type ... 1 A 2 B 3 B 4 C I expect the result is like ID Type obs rate... 1 A 10 0.11 2 B 12 0.51 3 B 11 0.41 4 C 5 0.3 But currently my result is ID Type obs rate... 1 A 5 0.3 2 B 5 0.3 3 B 5 0.3 4 C 5 0.3
... View more
Hi, I have a macro variable _mydate in the sasdate format, is there anyway to convert it to data9. foramt? For example, %let _mydate = 20399; I want it to be &_mydate =07NOV2015 Thanks!
... View more
Hi everyone, I am new to SAS and SQL. I have a dataset with ID, class and the related values. It's like, ID CLASS VALUE 1 A 5 1 B 7 1 C 10 2 A 7 2 B 5 2 C 12 Can anyone help to use SQL to create 3 variables A, B , C to store different class values for each ID The expected output table looks like ID A B C 1 5 7 10 2 7 5 12
... View more
Hi, I have a dataset based on date like the fowlloing DATE | Value 16APR2013 1 25APR2013 1 21MAY2013 2 05Jun2013 4 07Sep2013 5 10Oct2013 5 21Dec2013 8 03Feb2014 7 08Mar2014 9 01Jun2014 10 I need some help to add a new variable only records the semi-annual value based on its most close previous date value. If the semi-year date doesn't exist in table, I need to add one. Here is what I expect the result looks like DATE | Value | Semi-year 01Jan2013 0 0 16APR2013 1 . 25APR2013 1 . 21MAY2013 2 . 01Jun2013 2 2 05Jun2013 4 . 07Sep2013 5 . 10Oct2013 5 . 21Dec2013 8 . 01Jan2014 8 8 03Feb2014 7 . 08Mar2014 9 . 01Jun2014 10 10
... View more