 So today, sound check, you can hear me good. Today, we're going to be talking about a new package that we've developed called GTRAG. We're going to talk a little bit about adverse events, your first adverse event tables, how to modify them, some other convenience functions we have and how to get them back out of R. So this presentation is under Creative Commons license. I'm a developer of GTRAG. I am a data scientist at the prostate cancer clinical trials consortium, which is housed under Memorial Sloan Kettering. And Daniel Soberg is also a biosensitition at Memorial Sloan Kettering. You might know him because he gave an amazing workshop a couple of days ago, introducing the GT summary package. So I'm using a pretty recent version of R 4.2.0, pretty recent version of RStudio, and the primary packages that I'm going to be using for the demonstration today are tidyverse labeled GT summary and GTRAG. So the GTRAG package is a package that's built on GT summary, which is also built on GT, which makes it pretty special. Here's an overview of what we're going to be talking about today. There are some specific GTRAG functions for handling adverse events like table AE. And then we have a few other convenience functions as well. Once you take those GTRAG functions, you can then apply GT summary modifications like modify header and bold labels. You can use GTRAG selectors to assist you with those modifications. And finally, you can export them to various formats. So I don't know if all of you are familiar with adverse events. So I thought it might be worth a little introduction. An adverse event is a medical issue that occurs during the course of treatment or observation. Please note that these data were randomly simulated and may or may not be realistic for those of you with a finite eye. Adverse events are classified according to a hierarchy and we typically report lower level terms within a system or in class. And we'll also record severity and grade or a likelihood of attribution to treatment for those adverse events. So for example, patient one might be on drug B, experience an anemia event, which is under the blood and lymphatic system disorders of grade four, which is unrelated to the treatment of interest. But here's some challenges with summarizing this data. Subjects can experience multiple adverse events. Notice here in the sample data, we have five adverse events recorded over time for a single subject. Not all subjects on your study might experience an adverse event. And we're also interested typically in recording the percent of subjects that experience specific adverse events. Furthermore, in medical monitoring, this is something you have to do repeatedly. So you might want adverse event tables that are for treatment emergent or in specific treatment cycles, or that are serious. So one way to achieve counting at the subject level is that we count by maximum grade. So here we have our five adverse events that belong to the same subject. Note that these adverse events are from three unique terms. One term for anemia, two terms for increased tendency to bruise, and one term for thrombocytopenia. When we count by maximum grade, that means that we're gonna count the highest grade for each term observed. So the grade four, the anemia, the grade five for increased tendency to bruise, and the grade three for thrombocytopenia. You're gonna see this come back to later. Similar logic applies when counting by severity. So if you're counting by a factor stored as mild, moderate, or severe, the highest factor level is retained. So what are your first adverse event tables look like? We're gonna have some data that goes into these adverse event tables. The two datasets that come simulated with the package are DF patient characteristics, which has 100 unique subjects on our trial and one row per subject. We also have DF adverse events, which only has 10 unique subjects in it, even though we studied 100 on the trial. And we have multiple rows of adverse events recorded per subject. Another feature of the data in this package is that the data has variable labels, which is an attribute of a variable in a data frame. So we're applicable in these functions, variable labels, not variable names are printed in GT summary and GT reg tables. So the example data in GT reg comes with variable labels. And you can see those by looking at the stir of your patient characteristics. You see the variable labels are highlighted here. So the label for treatment is treatment group. You can also see that if you view your data frame where you can see that the variable name is printed first and then the variable label is printed underneath. These are what are going to be printed. The variable labels are what is gonna be printed in your GT summary and GT reg outputs were applicable. So let's focus on our first three adverse event tables. Table AE count is a function you can use to count all observed adverse events. This is not counting by the maximum grade method we just discussed. So you take your data frame of adverse events, pipe it into table AE count, and you specify the variable for the adverse event, the variable for the system working class and how you want to summarize that. And here we're summarizing my grade. So this code is going to produce this lovely little adverse event table. Notice the natural grouping that occurs in your adverse event table. So we have a system organ class here as a top level header. And then our individual terms underneath that specific system organ class are indented to show that they are grouped within that larger one. In this case, for table AE count, we just present counts of our adverse events. So this means that a total of 13 adverse events were recorded of grade five in blood and lymphatic system disorders. If it helps to have the context of the data that goes behind the adverse events, you can click on the tab here to see a sample of the mod data. So again, that's counting all AEs, but not by maximum grade. What if you want to count by maximum grade? This time you'll use the table AE function instead of table AE count. And we have to use an additional argument of patient ID. So for our data, we just have an additional identifier for our patient. The table that comes out looks different. Now, instead of just counts presented, we have counts and percentages. And the percentages are computed out of the number of subjects observed in your adverse event data set. So again, we said that only 10 subjects on the study experience adverse events. Some things you might notice here also is that the counting looks a little bit different than what we observed before. Remember I said we had a total of 13 grade five blood and lymphatic system disorders. But now we're showing seven here. That seven doesn't represent the number of adverse events. It represents the number of subjects that experience adverse events, grade five in blood and lymphatic system disorders by counting by maximum grade. So seven out of the 10 experienced grade five events. Another thing to note here is that each of these rows are computed individually and independently. So the counting by maximum grade applies to blood and lymphatic system disorders on a whole. It also applies to anemia on a whole and increased tendency to bruise on a whole. So these rows are computed by maximum grade independently. Now, one problem with the previous table is that we knew we had 100 subjects on our study, but we were only showing 10 in our patient subject denominator. To correct this, you can supply an additional argument to your table AE function, which is IDDF, which is your IDD data frame. In this case, it's our DF patient characteristics. So now the data that we're supplying to our table AE is two different data sets, one representing our adverse events and one representing a dataset with unique patient senate. The resulting table of this has a minor correction. Now we appropriately have a correct denominator for our subjects at 100 subjects and the percentages are modified accordingly. So seven out of our 100 subjects experienced grade five adverse events, which is 7% of your data. Another table AE function that we have is table AE focus. Table AE focus here, we are no longer using the grade or the bi argument that you see here. So before we're doing five grade, grade one, two, three, four, five, now we're using an include argument. So include means you can include separate variables that are dichotomous to compare. We're gonna focus on these. In case you need to see what that looks like, any complication and grade three complications are just true false indicators. So what this looks like is that now we can summarize and see that all 10, not all 10, 10 out of our 100 or 10% of our subjects experienced any grade complication of blood and lymphatic system disorders. Nine of those were grade three plus complications. So how we modify those tables. We're gonna do this by using the GT summary modifications to modify header and bold labels and also leveraging the GT rex selectors. So let's see some things we can do. First, you might wanna see this by strata. Like I mentioned, we have two treatment arms. So here now we have our adverse event table separated by strata. You might also want to look at some sort of total or overall column for your data. Here we're adding across the by values or the all across all grades. And there's more functionality in add overall and I encourage you to look at a documentation to see the multitude of ways we have programmed this. But now that little add overall has added a column indicating the total number of adverse events at any grade level for both strata. And so the other things you might wanna do or modify the header, the spanning header or bold your labels. I always fold my labels actually. So if we go back real quick and see what our previous table looked like. Here we have numeric values for one, two, three, four, five but there's no indication maybe of what those mean. And it's a little hard to see the difference between your system organ class and your lower level turn. And maybe you might also want your treatment name and your sample size separated by a line. So we can achieve all of this with modify header, modify spanning header and both labels. So now we have our, with modify spanning header we now have our sample size underneath our treatment name. We now have additional annotation for our grade values of grade one, two, three, four, five. And now our system organ class is really popped with bold labeling. There's a couple of other convenience functions in this package as well. So that's gonna be table rig summary and table listing. For table rig summary, this is going to create summary tables with standard regulatory formatting. This is really just a theme wrapper around UT summary, table summary. So to apply this, this is going to, let me go back to the data because this isn't actually adverse event data anymore. This is maybe just general characteristics of your patient. I think this is a typo here. I think this is DF patient characteristics, not DF adverse events. But here we're just summarizing the marker and the status of our subjects on our table, on our study. So the biological marker values were continuous and are summarized with a multi-line continuous summary standard with regulatory formatting. And our study status is categorical and summarized accordingly. And we also really enjoy using table listing which is a fancy way to print grouped data. This is really for raw data printing, not for any sort of summarizing, counting or producing means or anything like that. What if we just want a nice way to print your grouped data? I'll show you what the data looks like. So here we can see maybe we want to print out raw listings for our adverse events, the class by our system organ class. To do that, we would pipe that data into table listing and say group by system organ class. The data, the output resumes is just a really nice way of looking at your grouped data with a nice print following the same bold and an invitation. I remember this table that I presented earlier which was about how we count by maximum grade. This is actually using table listing. I'll show you the data first. So here what I did to produce that table is I added an AE label. So I assigned term one, term two and term three to our three adverse event terms. And then the code I used to present that table is I took that table listing object and I converted it to a GT object and then I could use the GT functions to actually style it. So because GT reg was built on GT summary, was built on GT, you can use the conveniences of all your GT functions as well. Now how do you get it out of R? So the default output for GT reg tables is HTML formatting. But what if you want it in Word? You can convert that same table to as flex table and then use flex table, save as docx to create your Word table. What if you want an Excel? You can take that table one and pipe it in to as Hux, XLX. And what if you want it in PDF? You can create a PDF document either from rmarkdown.rmd or a quarter document, .qmd, create your table and then in a chunk, pipe it in to as cable extra to convert it to the tech formatting and then you can use cable styling functions to produce this table. And if you scroll quickly across the three tables, what's really actually kind of magnificent and incredible is that the styling is pretty much the same across the three tables, right? Like it's pretty incredible that you've managed to achieve the bold headers and the indentation of your system working classes and lower level terms across the three outputs. So thank you for attending this talk. This package has been newly on CRAN, so you can install it from CRAN or get the development version. If you wanna talk to us more about GTRAG, you can certainly submit an issue or just for discussion, feature requests or general questions on how to do things, you're welcome to use the GitHub discussion form. So thank you very much. So there are a couple of questions in the Q&A. Can you crosstab adverse events with concomitant medications comorbidities such as critical steroids or a risk factor enhancer for adverse events of VTE? Yeah, I think you could do, I mean, if you wanted to ignore your strata, right? And you wanted to treat that as some sort of stratification factor, that might be a way to achieve that. And are there any functions that assist with the coding of AEs, concomitant meds, comorbidities, using some of the kind of standard dictionaries? Not in this package now. So you're assuming that the data is coming in kind of fully labeled with the different categories. It is not in the scope of the package to assist with the coding, but just the reporting. Okay.