compareGroups: descriptives by groups Isaac Subirana & H ector - - PowerPoint PPT Presentation

comparegroups descriptives by groups
SMART_READER_LITE
LIVE PREVIEW

compareGroups: descriptives by groups Isaac Subirana & H ector - - PowerPoint PPT Presentation

compareGroups: descriptives by groups Isaac Subirana & H ector Sanz isubirana@imim.es & hsanz@imim.es RICAD Research on Inflammatory and Cardiovascular Disorders Program IMIM-Parc de Salut Mar, Barcelona, Catalonia userR!


slide-1
SLIDE 1

compareGroups: descriptives by groups

Isaac Subirana & H´ ector Sanz

isubirana@imim.es & hsanz@imim.es RICAD Research on Inflammatory and Cardiovascular Disorders Program IMIM-Parc de Salut Mar, Barcelona, Catalonia

userR! Gaithersburg, July 20-23, 2010

Isaac Subirana & H´ ector Sanz (RICAD) compareGroups: descriptives by groups July 20-23, 2010 1 / 16

slide-2
SLIDE 2

Outline

1 Why compareGroups package 2 What the package does 3 How to use 4 An example 5 Future works

Isaac Subirana & H´ ector Sanz (RICAD) compareGroups: descriptives by groups July 20-23, 2010 2 / 16

slide-3
SLIDE 3

Why compareGroups package

Motivation

In epidemiology area, many analysis requires to compute descriptives of several variables by groups (disease

  • case/control-, levels of exposure, etc).

For example, in the observational studies, when measuring the relationship between a disease and a exposure, adjusting for confounding variables. To identify the confounding variables, it might be useful to summarize them among disease status and among exposure levels, and test if they differ among these groups.

Isaac Subirana & H´ ector Sanz (RICAD) compareGroups: descriptives by groups July 20-23, 2010 3 / 16

slide-4
SLIDE 4

Why compareGroups package

Motivation

To do so, very often bivariate tables are reported. Even more, sometimes this must be done repeatedly, doing the same analysis for different strata (gender, for example). Therefore, it can be tedious to build these tables, specially when a lot of confounding variables must be considered

Isaac Subirana & H´ ector Sanz (RICAD) compareGroups: descriptives by groups July 20-23, 2010 4 / 16

slide-5
SLIDE 5

Why compareGroups package

A real example

Grau M, Bongard V, Fito M, Ruidavets JB, Sala J, Taraszkiewicz D, Masia R, Galinier M, Subirana I, Carri´ e D, Vila J, Marrugat J, Ferri` eres J; REGICOR, GENES Investigators. Prevalence of cardiovascular risk factors in men with stable coronary heart disease in France and Spain. Arch Cardiovasc Dis. 2010 Feb;103(2):80-9. Isaac Subirana & H´ ector Sanz (RICAD) compareGroups: descriptives by groups July 20-23, 2010 5 / 16

slide-6
SLIDE 6

What the package does

Overview

compareGroups builds this kind of bivariate tables in L

AT

EX, CSV plain text and printed in R console easily and quickly. computes descriptives (mean, SD, quantiles, frequencies) and tests as appropriate Feasible and easy to modify many options

decimals type of variable (categorical, normal, continuous-non-normal) subsetting row-variables, column variable.

Other secondary things

normality plots frequency plots

Isaac Subirana & H´ ector Sanz (RICAD) compareGroups: descriptives by groups July 20-23, 2010 6 / 16

slide-7
SLIDE 7

What the package does

More detailed

compareGroups builds bivariate tables with: by row: summarized variables (confounding variables) by column: groups of disease status/ exposure factor level/... Depending on the nature of row-variable categorical: N, %, chi-squared/Fisher exact test normal: mean, SD, t-test/ANOVA test continuous non-normal: quartiles, Kruskall-Wallis test. Also, when more than 2 groups, pairwise p-values (with appropriate multiple test correction) and p-value for trend are computed.

Isaac Subirana & H´ ector Sanz (RICAD) compareGroups: descriptives by groups July 20-23, 2010 7 / 16

slide-8
SLIDE 8

How to use

compareGroups

(function)

createTable

(function) print summary plot update (method) compareGroups (class)

export2latex export2csv

(function) print update (method) createTable (class) Isaac Subirana & H´ ector Sanz (RICAD) compareGroups: descriptives by groups July 20-23, 2010 8 / 16

slide-9
SLIDE 9

How to use

by syntax by graphical user interface (GUI)

Isaac Subirana & H´ ector Sanz (RICAD) compareGroups: descriptives by groups July 20-23, 2010 9 / 16

slide-10
SLIDE 10

How to use

by syntax - example

R> ans <- compareGroups(year ~ . -id, data = regicor) R> ans R> summary(ans)

Isaac Subirana & H´ ector Sanz (RICAD) compareGroups: descriptives by groups July 20-23, 2010 10 / 16

slide-11
SLIDE 11

How to use

R> createTable(ans)

Isaac Subirana & H´ ector Sanz (RICAD) compareGroups: descriptives by groups July 20-23, 2010 11 / 16

slide-12
SLIDE 12

How to use

R> createTable(update(ans, gender ~ .))

Isaac Subirana & H´ ector Sanz (RICAD) compareGroups: descriptives by groups July 20-23, 2010 12 / 16

slide-13
SLIDE 13

How to use

by GUI

loading the package R> library(compareGroups) GUI opened with example REGICOR data loaded

  • r typing

R> cGroupsGUI(regicor)

Isaac Subirana & H´ ector Sanz (RICAD) compareGroups: descriptives by groups July 20-23, 2010 13 / 16

slide-14
SLIDE 14

An example

Let’s do an example...

Isaac Subirana & H´ ector Sanz (RICAD) compareGroups: descriptives by groups July 20-23, 2010 14 / 16

slide-15
SLIDE 15

Future works

Possible future works

For GUI

specify a subset different for each variable. load data.frames in the workspace. improve some other options...

In general,

To joint different tables (one next to the other). Possibly, to improve some documentation. Upload package to CRAN. Any suggestion for future users... ...

Isaac Subirana & H´ ector Sanz (RICAD) compareGroups: descriptives by groups July 20-23, 2010 15 / 16

slide-16
SLIDE 16

Thank you!!

Don’t hesitate to contact us: Isaac Subirana < isubirana@imim.es > H´ ector Sanz < hsanz@imim.es > Currently available at www.regicor.org

Isaac Subirana & H´ ector Sanz (RICAD) compareGroups: descriptives by groups July 20-23, 2010 16 / 16