Welcome to clinical data management program using SAS. In this video, we will be discussing about how to create accumulating variables or how to create a cumulative totals. So here we'll be dealing with a new data set called a diabetes data set. So before I teach you all that how to create accumulating totals, let me give you a quick recap about the data set that we are going to work with that is a diabetes data set. So this is our diabetes data set, which we got by executing a librium statement. So this data set has got one lakh 1766 observations and the variables are numerous number of variables like encounter ID, patient number, race, gender, age, weight, admission type, ID, discharge, disposition ID admission source ID, timing, hospital payer code, medical facility, medical speciality number of lab procedures number of procedures number of medications, number of outpatient number of emergency number of impatient diagonal one then two then three.
You can also take it as diagnosis one two and three number of diagnosis. Maximum glucose serum is one result much more often rapidly night methylphenidate lower performance, glimmer acid or hexa mind Lipsyte library rate. You have insulin you have got lips Egg McMuffin, so it's a pure diabetes data set and these are the different measures with respect to diabetes. So, now we are going to the Our objective is that we are going to create Create a cumulative total of our variable that is number of laboratory procedures. For that we are going to use just a sum statement and this is also the test we will be using. We will be doing it using a tester It's a type of data manipulation.
So we want to create output dataset name derivative span, which will be created inside work to be created inside your common library that is CDM. Set CDM dot diabeetus. That is main input data set. Then I'm going to use the sum statement by just reading the sum statement. recommitting, Google will be created. So my sum statement is basically I'm giving the variable of me I'm giving the name of my accumulating variable as lap total.
Last my resume variable is number of lab procedures. So we need not initialize the variable separately, we can just give the some statement the variable gets automatically initialized and now we'll rate run. And we'll run the code. This is another DATA step. So we have to open the data set diabetics run inside work to check our results. So let's open work.
Let's open diabetics one. So, this variable is number of lab procedures. We have created a variable called lab total, which is a cumulative total of number of lab procedures. So the last value of my lab total will be the total value of number of lab procedures that are that are conducted. That is around 14 Like 85,674 Now we'll be doing two here in this video in a coming video, we'll be dealing with summarizing clinical data. So for now, let me end this video over here.
Thank you Goodbye. I'll see you over for the next video.