Category: SAS

SAS Space

SAS Day 24: Space Trick Background: My boss has a motto “Devil in the details“. I think all the Space- Related issues are the “Devil” in SAS. Today, we will go over the function and tricks I used to deal with Space. Remove Space: Compress, Compbl, Strip, Trim Concatenate with Remove Space: ||, CAT, CATS, CATX, CATT


SAS day 24:  Proc SQL Join   Review: Last time we went to over SAS Merge, it is a SAS Merge statement used for  1 – 1 mapping or One – Many mapping, What should we do for many to many mapping?

SAS Proc SQL Count

SAS Day 23: SQL Count   Background: In order to present the data to the audience in a nice way, we often generate tables, figures, and listings from the existing datasets.  There are many data processing steps, such as Merge, Transformation. Among them, One of the most commonly used technique is Summarize the Object Count using SQL.

SAS Merge

SAS Day 22: Merge    Background: Sometimes we need to obtain information from different datasets, how do we combine two or more datasets in SAS?  Most cases, we use the “Merge” statements, however,  depends on the data structures, we need to use SQL if it is many to many mapping. P.S. regardless of Merge or SQL, we need to have…

SAS Format

SAS Day 19: Format   Background:  In clinical datasets, we usually use some shortcode to keep the data to be concise, meanwhile, we want to generate detailed table labels from the datasets so the output is reader-friendly. For example, in the dataset, we have “F, M“, and we want to show “Female, Male” in output tables.

SAS Baseline

SAS Day 21: Baseline Value Background: How do we decide if the Weight Loss program/drug is effective or the laser operation improves the vision? Usually, we compare the weights before and after a program or track the vision before and after the eye laser surgery. The Change From Baseline is a critical measurement of efficacy analysis. Therefore, it is very crucial to record the…

SAS Miss function

SAS Day 20: Miss function There are two miss functions in SAS I really like, NMISS and CMISS. Problem: if we want to calculate the duration as aendt(Adverse Event End Date) – aestdt (Adverse Event Start Date). Ideally, we can use adurn=aendt-aestdt +1. However, in reality, we know there are high probabilities with missing AE dates.


SAS Day 18: LOCF   Background: Clinical trial studies often spanned several years. What happens if patients did not participate the check such as Vital Sign(blood pressure, weight) or Lab value(white blood cell count, red blood cell count) on some of the time points and caused the missing data?  The pharmaceutical industry standard method for imputing missing data is LOCF (Last Observation…

SAS Proc Phreg

SAS day 17: Proc Phreg   One day, my boss took a glance at a table with Hazard Ratio and Median Survival Time then he told me the program set the reference group in Proc Phreg flipped. It turns out he was correct after validating the program. However, I was very curious about how did he figure it out by an…

SAS 11.11

In China, 11.11 is Single’s Day. I found this day very interesting, although 1111 looks like a solitude date on the calendar. It is not! It has a prime factorization 1111=101*11,  and both 11 and 101 are primes. Therefore I think 1111 is a cute number and a Prime relationship day! Some people may be like Composite Numbers, always have…

Social media & sharing icons powered by UltimatelySocial