From the course: Descriptive Healthcare Analytics in R

Adding overall frequencies to continuous Table 1 - R Tutorial

From the course: Descriptive Healthcare Analytics in R

Start my 1-month free trial

Adding overall frequencies to continuous Table 1

- [Lecturer] In this section, we update the Continuous Table 1 by adding overall frequencies. In previous sections, we developed a macro that allowed us to run overall frequencies and output them as CSVs into our Data folder. Before, we opened each of these CSVs and copied the overall frequencies into our categorical Table 1. In this movie, we will open these CSVs again, but this time copy and paste them into our continuous Table 1. So let's look at our continuous Table 1 shell to reminder ourselves where we are going. So, all we have here is our total so far, our magic number, 58131, and see how it is here, in the yellow part and then over here, on the white part, it displays very nicely. So our goal is to go get and copy and paste the frequencies from our CSVs into this yellow column, this one under n. Let's start with our AlcFreq. Here it is, let's open our CSV AlcFreq, which is left over from the last code. We see here are our frequencies. Let's highlight and do Control + C and copy them. Now, let's place our cursor on the top cell in the yellow, in the Alcohol group and choose Paste Values. I'm also going to demonstrate adding asthma frequencies. Let's go over to the Data folder again. Here, in the Data folder, let's open AsthmaFreq. Okay, notice how this table is constructed, Var1 is asthma four and see it is out of order. In our shell we have yes first and this one is no first. So we'll just sort this table in order then copy out the frequencies. I'll highlight the cells, then choose the Data tab and then the Sort button. We'll make sure My data has headers is checked and choose column Var1 and Order, Largest to Smallest. Now it's in order. Let's highlight these two frequencies and do Control + C for copy. Then let's put our cursor here, in the top of the asthma variables and do Paste Values. So, this is kind of like the last movie, you have to do this over and over. Let me show you one with a completed column. Here, now you have all your overall frequencies in your continuous table. So now, in this movie, we were able to reuse our old frequency CSVs, output it in previous movies to fill in our overall frequencies in continuous Table 1. We opened up the Alcohol CSV and copy and pasted those frequencies in and we also did the asthma frequencies, so I could demonstrate them. Then I showed you what it looks like if you have the patience to go through all those frequencies and fill them in. Join me in the next section where we continue to add data to our Table 1s.

Contents