Tendril: Tendril

Description Usage Arguments Details Value Examples

View source: R/Tendril.R

Description

Function to calculate coordinates and statistical measures used to create a tendril plot

Usage

1
2
3
4
5
6
7
8
Tendril(mydata, rotations, AEfreqThreshold = 50, Tag = "Comment",
  Treatments = c("Active", "Placebo"),
  Unique.Subject.Identifier = "Unique.Subject.Identifier",
  Terms = "Dictionary.Derived.Term", Treat = "Actual.Treatment...DB",
  StartDay = "Analysis.Start.Relative.Day", SubjList = NULL,
  SubjList.subject = NULL, SubjList.treatment = NULL,
  SubjList.dropoutday = NULL, compensate_imbalance_groups = FALSE,
  filter_double_events = FALSE, suppress_warnings = FALSE)

Arguments

mydata

A dataframe containing the data for the tendril calculations

rotations

a vector of same length as mydata containing the rotation factors for all the events

AEfreqThreshold

The minimum frequency threshold of events to be included in the analysis. Default is 50

Tag

A tag or comment associated with the analysis

Treatments

The names of the two treatments to be included in the tendril. The first treatment bends to the right and second treatment bends to the left. Must be a vector of two elements and the two elements must be found in the Treatment column

Unique.Subject.Identifier

The name of the column containing the unique patients IDs

Terms

The name of the column containing the name of the tendrils (e.g. adverse event terms)

Treat

The name of the column containing the name of the treatments

StartDay

The name column containing the days of the events

SubjList

A dataframe containing subject IDs and treatments

SubjList.subject

The name of the columns in SubjList containing the subjects IDs

SubjList.treatment

The name of the columns in SubjList containing the treatments

SubjList.dropoutday

The name of the column in SubjList containing the dropoutday

compensate_imbalance_groups

Boolean Whether the rotation factors have been compensated for imbalance in the groups

filter_double_events

Boolean whether to filter out events duplicated in subject id and adverse effect

suppress_warnings

Boolean whether to suppress warnings from chi squared approximation may be incorrect

Details

The function accepts a dataframe with at least 4 columns named as the arguments Unique.Subject.Identifier, Terms, Treat and StartDay.

Two treatments must be given as arguments, and at least one of the two treatments must be found in the Treatment column

The function returns an object of class tendril. The object contains the coordinates for the tendril plot and the arguments of the tendril function

The result of the function can be plotted with plot()

The result can be saved to file using write.table() with argument row.names = FALSE

Value

The function return an object of class tendril. The object contains the original dataset added with the tendril coordinates, all the function arguments and a dataframe with the results from statistical analysis

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
data <- Tendril(mydata = TendrilData,
rotations = Rotations,
AEfreqThreshold=9,
Tag = "Comment",
Treatments = c("placebo", "active"),
Unique.Subject.Identifier = "subjid",
Terms = "ae",
Treat = "treatment",
StartDay = "day",
SubjList = SubjList,
SubjList.subject = "subjid",
SubjList.treatment = "treatment"
)

plot(data)

Karpefors/Tendril documentation built on Jan. 17, 2020, 1:50 a.m.