compareGroups updated: version 2.0 Isaac Subirana & Joan Vila - - PowerPoint PPT Presentation

comparegroups updated version 2 0
SMART_READER_LITE
LIVE PREVIEW

compareGroups updated: version 2.0 Isaac Subirana & Joan Vila - - PowerPoint PPT Presentation

compareGroups updated: version 2.0 Isaac Subirana & Joan Vila & H ector Sanz & Judith Pe nafiel & Gavin Lucas & David Gim enez isubirana@imim.es , hsanz@imim.es & jvila@imim.es & jpenafiel@imim.es &


slide-1
SLIDE 1

compareGroups updated: version 2.0

Isaac Subirana

& Joan Vila & H´ ector Sanz & Judith Pe˜ nafiel & Gavin Lucas & David Gim´ enez

isubirana@imim.es, hsanz@imim.es & jvila@imim.es & jpenafiel@imim.es & gavin.lucas@cleargenetics.com RICAD Research on Inflammatory and Cardiovascular Disorders Program IMIM-Parc de Salut Mar, Barcelona

userR! Albacete, July 10-12, 2013

Isaac Subirana & Joan Vila (RICAD) compareGroups updated: version 2.0 July 10-12, 2013 1 / 36

slide-2
SLIDE 2

Introduction Motivation

Estruch R, Ros E, Salas-Salvad´

  • J, Covas MI, Corella D, Ar´
  • s F, G´
  • mez-Gracia E, Ruiz-Guti´

errez V, Fiol M, Lapetra J, Lamuela-Raventos RM, Serra-Majem L, Pint´

  • X, Basora J, Mu˜

noz MA, Sorl´ ı JV, Mart´ ınez JA, Mart´ ınez-Gonz´ alez MA; PREDIMED Study Investigators (2013). Primary prevention of cardiovascular disease with a Mediterranean diet. New England Journal

  • f Medicine 368(14): 1279-1290.

Isaac Subirana & Joan Vila (RICAD) compareGroups updated: version 2.0 July 10-12, 2013 2 / 36

slide-3
SLIDE 3

Introduction Package overview

compareGroups package is meant to facilitate the user to create bivariate tables in an easy and rapid way. It has a lot of parameters to change different options: decimals, reference category, report means or medians, etc. Its code is structured in classes and methods in order to make the syntax code easier (formula, update, subset,...). It is simple and short to change deafault options. A GUI has been implemented for non familiarized R users. ... WUI is under development. compareGroups package (version 1.4) is available on CRAN. The present version, compareGroups 2.0 will be submitted to CRAN soon.

Isaac Subirana & Joan Vila (RICAD) compareGroups updated: version 2.0 July 10-12, 2013 3 / 36

slide-4
SLIDE 4

Introduction Other existing R packages

Already existent many functions to display descriptives: summaryBy [doBy], stat.desc [pastecs], ctab [catspec], stat.table [Epi], tableNominal, tableDate, tableContinuous [reporttools], summary.formula [Hmisc], . . .

Isaac Subirana & Joan Vila (RICAD) compareGroups updated: version 2.0 July 10-12, 2013 4 / 36

slide-5
SLIDE 5

Introduction Other existing R packages

But . . . Some of them too much specific: only categorical or only continuous Don’t mix categorical, normal (mean-SD), non-normal (quantiles) Not very intuitive to customize tables No GUI’s, Difficult to add HR/OR, to deal with time-to-event variables, . . .,

Isaac Subirana & Joan Vila (RICAD) compareGroups updated: version 2.0 July 10-12, 2013 5 / 36

slide-6
SLIDE 6

Introduction Improvements in 2.0 version

Improvements in current version

Missingness test, Analysis of genetic data (SNPs), Export tables to PDF, Generation of exhaustive report to PDF file, Create plots in pdf, bmp, jpeg, png or tiff. More formats in reporting statistics: mean ± SD, . . ., More detailed vignette with new data set (PREDIMED), GUI improved, WUI interface to use it from a remote server, web site to recieve feed back, publish package news, etc. http://www.comparegroups.eu

Isaac Subirana & Joan Vila (RICAD) compareGroups updated: version 2.0 July 10-12, 2013 6 / 36

slide-7
SLIDE 7

How to use it

1 By syntax (full functionallity) 2 By GUI (tcltk) 3 By WUI (no R installation required) under development

Isaac Subirana & Joan Vila (RICAD) compareGroups updated: version 2.0 July 10-12, 2013 7 / 36

slide-8
SLIDE 8

Classes and methods structure

compareGroups compareSNPs*

compareGroups

displaying modifying print update summary subset ‘[’ plot rbind

createTable missingTable*

createTable

update subset rbind cbind plot

export2:

latex , csv, html, pdf

report

print summary

Step 1: Computations Step 2: Construction Step 3: Exportation already implemented new improved functions classes methods

Isaac Subirana & Joan Vila (RICAD) compareGroups updated: version 2.0 July 10-12, 2013 8 / 36

slide-9
SLIDE 9

Results On R console Isaac Subirana & Joan Vila (RICAD) compareGroups updated: version 2.0 July 10-12, 2013 9 / 36

slide-10
SLIDE 10

Results LaTeX format MALE FEMALE No event Event HR No event Event HR N=2528 N=151 N=3544 N=101 Epidemiological: Age 66.0±6.49 68.3±7.02 1.06 [1.03;1.08] 67.6±5.78 71.0±5.71 1.10 [1.07;1.14] Body mass index 29.3±3.31 29.4±3.72 1.01 [0.97;1.06] 30.5±4.06 30.3±4.18 0.99 [0.94;1.04] Waist circumference 103±9.57 104±10.1 1.01 [0.99;1.02] 98.3±10.8 99.4±10.9 1.01 [1.00;1.03] Waist-to-height ratio 0.62±0.06 0.62±0.06 13.2 [0.85;205] 0.64±0.07 0.65±0.07 13.5 [0.89;204] History: Smoking: Never 27.0% 16.6% Ref. 87.4% 88.1% Ref. Current 24.8% 26.5% 1.63 [0.99;2.69] 5.14% 8.91% 1.94 [0.97;3.84] Former 48.2% 57.0% 1.92 [1.23;3.00] 7.51% 2.97% 0.43 [0.14;1.35] Hypertension 77.7% 79.5% 1.20 [0.81;1.79] 86.4% 89.1% 1.31 [0.70;2.46] Type-2 diabetes 52.0% 64.2% 1.59 [1.14;2.22] 43.1% 63.4% 2.12 [1.41;3.18] Dyslipidemia 66.6% 58.9% 0.81 [0.58;1.11] 77.4% 61.4% 0.52 [0.35;0.78] Family history 17.4% 14.6% 0.89 [0.57;1.41] 26.5% 28.7% 1.18 [0.77;1.82] Mediterranean diet: Intervention group: Control 29.8% 38.4% Ref. 33.6% 38.6% Ref. MedDiet + Nuts 36.7% 27.2% 0.54 [0.36;0.80] 31.1% 28.7% 0.78 [0.48;1.26] MedDiet + VOO 33.5% 34.4% 0.71 [0.49;1.03] 35.3% 32.7% 0.69 [0.43;1.10] MeDiet Adherence score 9.00 [8.00;10.0] 8.00 [7.00;10.0] 0.87 [0.81;0.94] 9.00 [7.00;10.0] 8.00 [7.00;9.00] 0.88 [0.80;0.97] Isaac Subirana & Joan Vila (RICAD) compareGroups updated: version 2.0 July 10-12, 2013 10 / 36

slide-11
SLIDE 11

Results On HTML format Isaac Subirana & Joan Vila (RICAD) compareGroups updated: version 2.0 July 10-12, 2013 11 / 36

slide-12
SLIDE 12

Plots univariate

Histogram 20 25 30 35 40 45 50 0.00 0.04 0.08 mean= 30.0 SD= 3.82 20 25 30 35 40 45 50 −4 −2 2 4 Normal Q−Q Plot Sample Quantiles Theoretical Quantiles 20 25 30 35 40 45 50 Boxplot 20 25 30 35 40 45 50 0.0 0.5 1.0 1.5 2.0 Standard deviation from normality desv.

Normality plots of 'Body mass index'

Never Current Former Barplot of 'Smoking' Freq 1000 2000 3000 1 2 3 4 5 6 7 0.0 0.2 0.4 0.6 0.8 1.0 time survival K−M survival of 'tevent'

Isaac Subirana & Joan Vila (RICAD) compareGroups updated: version 2.0 July 10-12, 2013 12 / 36

slide-13
SLIDE 13

Plots bivariate

Control MedDiet + Nuts MedDiet + VOO 20 25 30 35 40 45 50 Boxplot of 'Body mass index' by 'Intervention group' Control MedDiet + Nuts MedDiet + VOO Barplot of 'Smoking' by 'Intervention group' Freq 500 1000 1500 Never Current Former 1 2 3 4 5 6 7 0.0 0.2 0.4 0.6 0.8 1.0 time survival K−M survival of 'tevent' by 'Smoking' Never Current Former

Isaac Subirana & Joan Vila (RICAD) compareGroups updated: version 2.0 July 10-12, 2013 13 / 36

slide-14
SLIDE 14

By syntax Select variables, type, ...

> res <- compareGroups(tevent ~ .-toevent-event, + data = predimed, + method = c(p14 = 2), + ref.no = ✬no✬) > res

  • ------- Summary of results by groups of ✬tevent✬---------

var N p.value method selection 1 Intervention group 6324 0.011** categorical ALL 2 Sex 6324 <0.001** categorical ALL 3 Age 6324 <0.001** continuous normal ALL 4 Smoking 6324 <0.001** categorical ALL 5 Body mass index 6324 0.455 continuous normal ALL 6 Waist circumference 6324 0.003** continuous normal ALL 7 Waist-to-height ratio 6324 0.079* continuous normal ALL 8 Hypertension 6324 0.578 categorical ALL 9 Type-2 diabetes 6324 <0.001** categorical ALL 10 Dyslipidemia 6324 <0.001** categorical ALL 11 Family history of premature CHD 6324 0.640 categorical ALL 12 Hormone-replacement therapy 5661 0.195 categorical ALL 13 MeDiet Adherence score 6324 <0.001** continuous non-normal ALL

  • Signif. codes:

0 ✬**✬ 0.05 ✬*✬ 0.1 ✬ ✬ 1 Isaac Subirana & Joan Vila (RICAD) compareGroups updated: version 2.0 July 10-12, 2013 14 / 36

slide-15
SLIDE 15

By syntax Building the table

> restab <- createTable(res)

No event Event p.overall N=6072 N=252 Intervention group: 0.011 Control 1945 (32.0%) 97 (38.5%) MedDiet + Nuts 2030 (33.4%) 70 (27.8%) MedDiet + VOO 2097 (34.5%) 85 (33.7%) Sex: <0.001 Male 2528 (41.6%) 151 (59.9%) Female 3544 (58.4%) 101 (40.1%) Age 66.9 (6.14) 69.4 (6.65) <0.001 Smoking: <0.001 Never 3778 (62.2%) 114 (45.2%) Current 809 (13.3%) 49 (19.4%) Former 1485 (24.5%) 89 (35.3%) Body mass index 30.0 (3.81) 29.8 (3.92) 0.455 Waist circumference 100 (10.6) 102 (10.6) 0.003 Waist-to-height ratio 0.63 (0.07) 0.63 (0.07) 0.079 Hypertension: 0.578 No 1047 (17.2%) 42 (16.7%) Yes 5025 (82.8%) 210 (83.3%) Type-2 diabetes: <0.001 No 3231 (53.2%) 91 (36.1%) Yes 2841 (46.8%) 161 (63.9%) Dyslipidemia: <0.001 No 1645 (27.1%) 101 (40.1%) Yes 4427 (72.9%) 151 (59.9%) Family history of premature CHD: 0.640 No 4694 (77.3%) 201 (79.8%) Yes 1378 (22.7%) 51 (20.2%) Hormone-replacement therapy: 0.195 No 5341 (98.2%) 223 (99.6%) Yes 96 (1.77%) 1 (0.45%) MeDiet Adherence score 9.00 [7.00;10.0] 8.00 [7.00;10.0] <0.001 Isaac Subirana & Joan Vila (RICAD) compareGroups updated: version 2.0 July 10-12, 2013 15 / 36

slide-16
SLIDE 16

By syntax Costumazing the table

> restab <- update(restab, hide.no="no", hide=c(sex=✬Female✬))

No event Event p.overall N=6072 N=252 Intervention group: 0.011 Control 1945 (32.0%) 97 (38.5%) MedDiet + Nuts 2030 (33.4%) 70 (27.8%) MedDiet + VOO 2097 (34.5%) 85 (33.7%) Sex: Male 2528 (41.6%) 151 (59.9%) <0.001 Age 66.9 (6.14) 69.4 (6.65) <0.001 Smoking: <0.001 Never 3778 (62.2%) 114 (45.2%) Current 809 (13.3%) 49 (19.4%) Former 1485 (24.5%) 89 (35.3%) Body mass index 30.0 (3.81) 29.8 (3.92) 0.455 Waist circumference 100 (10.6) 102 (10.6) 0.003 Waist-to-height ratio 0.63 (0.07) 0.63 (0.07) 0.079 Hypertension 5025 (82.8%) 210 (83.3%) 0.578 Type-2 diabetes 2841 (46.8%) 161 (63.9%) <0.001 Dyslipidemia 4427 (72.9%) 151 (59.9%) <0.001 Family history of premature CHD 1378 (22.7%) 51 (20.2%) 0.640 Hormone-replacement therapy 96 (1.77%) 1 (0.45%) 0.195 MeDiet Adherence score 9.00 [7.00;10.0] 8.00 [7.00;10.0] <0.001 Isaac Subirana & Joan Vila (RICAD) compareGroups updated: version 2.0 July 10-12, 2013 16 / 36

slide-17
SLIDE 17

By syntax Costumazing the table

> restab <- update(restab, type = 1)

No event Event p.overall N=6072 N=252 Intervention group: 0.011 Control 32.0% 38.5% MedDiet + Nuts 33.4% 27.8% MedDiet + VOO 34.5% 33.7% Sex: Male 41.6% 59.9% <0.001 Age 66.9 (6.14) 69.4 (6.65) <0.001 Smoking: <0.001 Never 62.2% 45.2% Current 13.3% 19.4% Former 24.5% 35.3% Body mass index 30.0 (3.81) 29.8 (3.92) 0.455 Waist circumference 100 (10.6) 102 (10.6) 0.003 Waist-to-height ratio 0.63 (0.07) 0.63 (0.07) 0.079 Hypertension 82.8% 83.3% 0.578 Type-2 diabetes 46.8% 63.9% <0.001 Dyslipidemia 72.9% 59.9% <0.001 Family history of premature CHD 22.7% 20.2% 0.640 Hormone-replacement therapy 1.77% 0.45% 0.195 MeDiet Adherence score 9.00 [7.00;10.0] 8.00 [7.00;10.0] <0.001 Isaac Subirana & Joan Vila (RICAD) compareGroups updated: version 2.0 July 10-12, 2013 17 / 36

slide-18
SLIDE 18

By syntax Costumazing the table

> restab <- update(restab, show.ratio=TRUE, show.p.overall=FALSE)

No event Event HR p.ratio N=6072 N=252 Intervention group: Control 32.0% 38.5% Ref. Ref. MedDiet + Nuts 33.4% 27.8% 0.66 [0.48;0.89] 0.008 MedDiet + VOO 34.5% 33.7% 0.70 [0.53;0.94] 0.018 Sex: Male 41.6% 59.9% Ref. Ref. Age 66.9 (6.14) 69.4 (6.65) 1.06 [1.04;1.09] <0.001 Smoking: Never 62.2% 45.2% Ref. Ref. Current 13.3% 19.4% 1.96 [1.40;2.74] <0.001 Former 24.5% 35.3% 2.02 [1.53;2.67] <0.001 Body mass index 30.0 (3.81) 29.8 (3.92) 0.99 [0.96;1.02] 0.455 Waist circumference 100 (10.6) 102 (10.6) 1.02 [1.01;1.03] 0.003 Waist-to-height ratio 0.63 (0.07) 0.63 (0.07) 5.27 [0.83;33.6] 0.079 Hypertension 82.8% 83.3% 1.10 [0.79;1.53] 0.578 Type-2 diabetes 46.8% 63.9% 1.88 [1.46;2.44] <0.001 Dyslipidemia 72.9% 59.9% 0.62 [0.49;0.80] <0.001 Family history of premature CHD 22.7% 20.2% 0.93 [0.68;1.26] 0.640 Hormone-replacement therapy 1.77% 0.45% 0.29 [0.04;2.10] 0.223 MeDiet Adherence score 9.00 [7.00;10.0] 8.00 [7.00;10.0] 0.88 [0.83;0.94] <0.001 Isaac Subirana & Joan Vila (RICAD) compareGroups updated: version 2.0 July 10-12, 2013 18 / 36

slide-19
SLIDE 19

By syntax Costumazing the table

> restab <- update(restab, show.descr=FALSE)

HR p.ratio Intervention group: Control Ref. Ref. MedDiet + Nuts 0.66 [0.48;0.89] 0.008 MedDiet + VOO 0.70 [0.53;0.94] 0.018 Sex: Male Ref. Ref. Age 1.06 [1.04;1.09] <0.001 Smoking: Never Ref. Ref. Current 1.96 [1.40;2.74] <0.001 Former 2.02 [1.53;2.67] <0.001 Body mass index 0.99 [0.96;1.02] 0.455 Waist circumference 1.02 [1.01;1.03] 0.003 Waist-to-height ratio 5.27 [0.83;33.6] 0.079 Hypertension 1.10 [0.79;1.53] 0.578 Type-2 diabetes 1.88 [1.46;2.44] <0.001 Dyslipidemia 0.62 [0.49;0.80] <0.001 Family history of premature CHD 0.93 [0.68;1.26] 0.640 Hormone-replacement therapy 0.29 [0.04;2.10] 0.223 MeDiet Adherence score 0.88 [0.83;0.94] <0.001 Isaac Subirana & Joan Vila (RICAD) compareGroups updated: version 2.0 July 10-12, 2013 19 / 36

slide-20
SLIDE 20

By syntax Costumazing the table

> males<-update(restab,x=update(res, .~.-sex,subset=sex==✬Male✬),hide=NA) > females<-update(restab,x=update(res, .~.-sex,subset=sex==✬Female✬),hide=NA) > tabcomb<-cbind("Males"=males,"Females"=females)

Males Females HR p.ratio HR p.ratio Intervention group: Control Ref. Ref. Ref. Ref. MedDiet + Nuts 0.54 [0.36;0.80] 0.002 0.78 [0.48;1.26] 0.305 MedDiet + VOO 0.71 [0.49;1.03] 0.071 0.69 [0.43;1.10] 0.116 Age 1.06 [1.03;1.08] <0.001 1.10 [1.07;1.14] <0.001 Smoking: Never Ref. Ref. Ref. Ref. Current 1.63 [0.99;2.69] 0.056 1.94 [0.97;3.84] 0.059 Former 1.92 [1.23;3.00] 0.004 0.43 [0.14;1.35] 0.147 Body mass index 1.01 [0.97;1.06] 0.565 0.99 [0.94;1.04] 0.685 Waist circumference 1.01 [0.99;1.02] 0.391 1.01 [1.00;1.03] 0.150 Waist-to-height ratio 13.2 [0.85;205] 0.065 13.5 [0.89;204] 0.061 Hypertension 1.20 [0.81;1.79] 0.358 1.31 [0.70;2.46] 0.393 Type-2 diabetes 1.59 [1.14;2.22] 0.006 2.12 [1.41;3.18] <0.001 Dyslipidemia 0.81 [0.58;1.11] 0.191 0.52 [0.35;0.78] 0.001 Family history of premature CHD 0.89 [0.57;1.41] 0.627 1.18 [0.77;1.82] 0.448 Hormone-replacement therapy Ref. Ref. 0.42 [0.06;2.98] 0.383 MeDiet Adherence score 0.87 [0.81;0.94] 0.001 0.88 [0.80;0.97] 0.012 Isaac Subirana & Joan Vila (RICAD) compareGroups updated: version 2.0 July 10-12, 2013 20 / 36

slide-21
SLIDE 21

By syntax Methods/functions on tables

> varinfo(restab)

  • -- Analyzed variable names ----

Orig varname Shown varname 1 tevent tevent 2 group Intervention group 3 sex Sex 4 age Age 5 smoke Smoking 6 bmi Body mass index 7 waist Waist circumference 8 wth Waist-to-height ratio 9 htn Hypertension 10 diab Type-2 diabetes 11 hyperchol Dyslipidemia 12 famhist Family history of premature CHD 13 hormo Hormone-replacement therapy 14 p14 MeDiet Adherence score Isaac Subirana & Joan Vila (RICAD) compareGroups updated: version 2.0 July 10-12, 2013 21 / 36

slide-22
SLIDE 22

By syntax Methods/functions on tables

> summary(restab)

  • --Available data----

____________________________________________________________________________________________ [ALL] No event Event method select Fact OR/HR ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ Intervention group 6324 6072 252 categorical ALL

  • Sex

6324 6072 252 categorical ALL

  • Age

6324 6072 252 continuous-normal ALL 1 Smoking 6324 6072 252 categorical ALL

  • Body mass index

6324 6072 252 continuous-normal ALL 1 Waist circumference 6324 6072 252 continuous-normal ALL 1 Waist-to-height ratio 6324 6072 252 continuous-normal ALL 1 Hypertension 6324 6072 252 categorical ALL

  • Type-2 diabetes

6324 6072 252 categorical ALL

  • Dyslipidemia

6324 6072 252 categorical ALL

  • Family history of premature CHD 6324

6072 252 categorical ALL

  • Hormone-replacement therapy

5661 5437 224 categorical ALL

  • MeDiet Adherence score

6324 6072 252 continuous-non-normal ALL 1 ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ Isaac Subirana & Joan Vila (RICAD) compareGroups updated: version 2.0 July 10-12, 2013 22 / 36

slide-23
SLIDE 23

By syntax Methods/functions on tables

> restab[1:5]

  • -------Summary descriptives table by ✬tevent✬---------

____________________________________________ HR p.ratio ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ Intervention group: Control Ref. Ref. MedDiet + Nuts 0.66 [0.48;0.89] 0.008 MedDiet + VOO 0.70 [0.53;0.94] 0.018 Sex: Male Ref. Ref. Age 1.06 [1.04;1.09] <0.001 Smoking: Never Ref. Ref. Current 1.96 [1.40;2.74] <0.001 Former 2.02 [1.53;2.67] <0.001 Body mass index 0.99 [0.96;1.02] 0.455 ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ Isaac Subirana & Joan Vila (RICAD) compareGroups updated: version 2.0 July 10-12, 2013 23 / 36

slide-24
SLIDE 24

By syntax Missingness

REGICOR data

1995 2000 2005 p.overall N=431 N=786 N=1077 Age 54.1 (11.7) 54.3 (11.2) 55.3 (10.6) 0.078 Sex: 0.506 Male 206 (47.8%) 390 (49.6%) 505 (46.9%) Female 225 (52.2%) 396 (50.4%) 572 (53.1%) Smoking status: <0.001 Never smoker 234 (56.4%) 414 (54.6%) 553 (52.2%) Current or former < 1y 109 (26.3%) 267 (35.2%) 217 (20.5%) Former ≥ 1y 72 (17.3%) 77 (10.2%) 290 (27.4%) Systolic blood pressure 133 (19.2) 133 (21.3) 129 (19.8) <0.001 Diastolic blood pressure 77.0 (10.5) 80.8 (10.3) 79.9 (10.6) <0.001 History of hypertension 111 (25.8%) 233 (29.6%) 379 (35.5%) <0.001 Hypertension treatment 71 (16.5%) 127 (16.2%) 230 (22.2%) 0.002 Total cholesterol 225 (43.1) 224 (44.4) 213 (45.9) <0.001 HDL cholesterol 51.9 (14.5) 52.3 (15.6) 53.2 (14.2) 0.208 Triglycerides 114 (74.4) 114 (70.7) 117 (76.0) 0.582 LDL cholesterol 152 (38.4) 149 (38.6) 136 (39.7) <0.001 History of hyperchol. 97 (22.5%) 256 (33.2%) 356 (33.2%) <0.001 Cholesterol treatment 28 (6.50%) 68 (8.80%) 132 (12.8%) <0.001 Height (cm) 163 (9.21) 162 (9.39) 163 (9.05) 0.003 Weight (Kg) 72.3 (12.6) 73.8 (14.0) 73.6 (13.9) 0.150 Body mass index 27.0 (4.15) 28.1 (4.62) 27.6 (4.63) <0.001 Physical activity (Kcal/week) 491 (419) 422 (377) 351 (378) <0.001 Physical component 49.3 (8.08) 49.0 (9.63) 50.1 (8.91) 0.032 Mental component 49.2 (11.3) 48.9 (11.0) 46.9 (10.8) <0.001 Cardiovascular event 10 (2.51%) 35 (4.72%) 47 (4.59%) 0.161 Days to cardiovascular event or end of follow-up 1784 (1101) 1686 (1080) 1793 (1072) 0.099 Overall death 18 (4.65%) 81 (11.0%) 74 (7.23%) <0.001 Days to overall death or end of follow-up 1713 (1042) 1674 (1050) 1758 (1055) 0.252 Isaac Subirana & Joan Vila (RICAD) compareGroups updated: version 2.0 July 10-12, 2013 24 / 36

slide-25
SLIDE 25

By syntax Missingness

Missing table

> mistab<-missingTable(regtab)

1995 2000 2005 p.overall N=431 N=786 N=1077 Age 0 (0.00%) 0 (0.00%) 0 (0.00%) 1.000 Sex 0 (0.00%) 0 (0.00%) 0 (0.00%) 1.000 Smoking status 16 (3.71%) 28 (3.56%) 17 (1.58%) 0.010 Systolic blood pressure 3 (0.70%) 11 (1.40%) 0 (0.00%) <0.001 Diastolic blood pressure 3 (0.70%) 11 (1.40%) 0 (0.00%) <0.001 History of hypertension 0 (0.00%) 0 (0.00%) 8 (0.74%) 0.015 Hypertension treatment 0 (0.00%) 0 (0.00%) 43 (3.99%) <0.001 Total cholesterol 28 (6.50%) 71 (9.03%) 2 (0.19%) <0.001 HDL cholesterol 30 (6.96%) 38 (4.83%) 1 (0.09%) <0.001 Triglycerides 28 (6.50%) 34 (4.33%) 1 (0.09%) <0.001 LDL cholesterol 43 (9.98%) 98 (12.5%) 27 (2.51%) <0.001 History of hyperchol. 0 (0.00%) 15 (1.91%) 6 (0.56%) 0.001 Cholesterol treatment 0 (0.00%) 13 (1.65%) 42 (3.90%) <0.001 Height (cm) 8 (1.86%) 15 (1.91%) 12 (1.11%) 0.318 Weight (Kg) 8 (1.86%) 15 (1.91%) 12 (1.11%) 0.318 Body mass index 8 (1.86%) 15 (1.91%) 12 (1.11%) 0.318 Physical activity (Kcal/week) 64 (14.8%) 22 (2.80%) 2 (0.19%) <0.001 Physical component 34 (7.89%) 123 (15.6%) 83 (7.71%) <0.001 Mental component 34 (7.89%) 123 (15.6%) 83 (7.71%) <0.001 Cardiovascular event 33 (7.66%) 45 (5.73%) 53 (4.92%) 0.118 Days to cardiovascular event or end of follow-up 33 (7.66%) 45 (5.73%) 53 (4.92%) 0.118 Overall death 44 (10.2%) 48 (6.11%) 54 (5.01%) 0.001 Days to overall death or end of follow-up 44 (10.2%) 48 (6.11%) 54 (5.01%) 0.001 Isaac Subirana & Joan Vila (RICAD) compareGroups updated: version 2.0 July 10-12, 2013 25 / 36

slide-26
SLIDE 26

By syntax Missingness

Include NA as new category:

> regtab2<-update(regtab,x=update(res,include.miss=TRUE))

1995 2000 2005 p.overall N=431 N=786 N=1077 Age 54.1 (11.7) 54.3 (11.2) 55.3 (10.6) 0.078 Sex: 0.506 Male 206 (47.8%) 390 (49.6%) 505 (46.9%) Female 225 (52.2%) 396 (50.4%) 572 (53.1%) Smoking status: <0.001 Never smoker 234 (54.3%) 414 (52.7%) 553 (51.3%) Current or former < 1y 109 (25.3%) 267 (34.0%) 217 (20.1%) Former ≥ 1y 72 (16.7%) 77 (9.80%) 290 (26.9%) <Missing> 16 (3.71%) 28 (3.56%) 17 (1.58%) Systolic blood pressure 133 (19.2) 133 (21.3) 129 (19.8) <0.001 Diastolic blood pressure 77.0 (10.5) 80.8 (10.3) 79.9 (10.6) <0.001 History of hypertension: <0.001 Yes 111 (25.8%) 233 (29.6%) 379 (35.2%) No 320 (74.2%) 553 (70.4%) 690 (64.1%) <Missing> 0 (0.00%) 0 (0.00%) 8 (0.74%) Hypertension treatment: <0.001 No 360 (83.5%) 659 (83.8%) 804 (74.7%) Yes 71 (16.5%) 127 (16.2%) 230 (21.4%) <Missing> 0 (0.00%) 0 (0.00%) 43 (3.99%) Total cholesterol 225 (43.1) 224 (44.4) 213 (45.9) <0.001 HDL cholesterol 51.9 (14.5) 52.3 (15.6) 53.2 (14.2) 0.208 Triglycerides 114 (74.4) 114 (70.7) 117 (76.0) 0.582 LDL cholesterol 152 (38.4) 149 (38.6) 136 (39.7) <0.001 History of hyperchol.: <0.001 Yes 97 (22.5%) 256 (32.6%) 356 (33.1%) No 334 (77.5%) 515 (65.5%) 715 (66.4%) <Missing> 0 (0.00%) 15 (1.91%) 6 (0.56%) Cholesterol treatment: <0.001 No 403 (93.5%) 705 (89.7%) 903 (83.8%) Yes 28 (6.50%) 68 (8.65%) 132 (12.3%) <Missing> 0 (0.00%) 13 (1.65%) 42 (3.90%) Isaac Subirana & Joan Vila (RICAD) compareGroups updated: version 2.0 July 10-12, 2013 26 / 36

slide-27
SLIDE 27

By syntax Exporting the table

to L

AT

EX

> export2latex(restab,"table1")

to ASCII (csv)

> export2csv(restab,"table1")

to HTML

> export2html(restab,"table1")

to PDF

> export2pdf(restab,"table1")

Isaac Subirana & Joan Vila (RICAD) compareGroups updated: version 2.0 July 10-12, 2013 27 / 36

slide-28
SLIDE 28

By syntax Summary of genetic data

> compareSNPs( ~ snp10001+snp10002+snp10003+snp10004+ + snp10005+snp10006+snp10007+snp10008, SNPs)

*********** Summary of genetic data (SNPs) *********** _____________________________________________________ SNP Ntyped MAF Genotypes Genotypes.p HWE.p ===================================================== snp10001 157 24.5% TT|TC|CC 58.6|33.8|7.6 0.353 snp10002 157 28.0% CC|CA|AA 47.1|49.7|3.2 0.006 snp10003 144 100.0% GG 100.0| 0.0|0.0 1.000 snp10004 156 100.0% GG 100.0| 0.0|0.0 1.000 snp10005 157 24.2% GG|GA|AA 53.5|44.6|1.9 0.012 snp10006 157 100.0% AA 100.0| 0.0|0.0 1.000 snp10007 157 100.0% CC 100.0| 0.0|0.0 1.000 snp10008 157 19.7% CC|CG|GG 66.2|28.0|5.7 0.215 ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ Isaac Subirana & Joan Vila (RICAD) compareGroups updated: version 2.0 July 10-12, 2013 28 / 36

slide-29
SLIDE 29

GUI

> cGroupsGUI()

Isaac Subirana & Joan Vila (RICAD) compareGroups updated: version 2.0 July 10-12, 2013 29 / 36

slide-30
SLIDE 30

Web User Interface Isaac Subirana & Joan Vila (RICAD) compareGroups updated: version 2.0 July 10-12, 2013 30 / 36

slide-31
SLIDE 31

Web User Interface Isaac Subirana & Joan Vila (RICAD) compareGroups updated: version 2.0 July 10-12, 2013 31 / 36

slide-32
SLIDE 32

Web User Interface Isaac Subirana & Joan Vila (RICAD) compareGroups updated: version 2.0 July 10-12, 2013 32 / 36

slide-33
SLIDE 33

Web User Interface Isaac Subirana & Joan Vila (RICAD) compareGroups updated: version 2.0 July 10-12, 2013 33 / 36

slide-34
SLIDE 34

Web site

compareGroups web site http://www.comparegroups.eu

Isaac Subirana & Joan Vila (RICAD) compareGroups updated: version 2.0 July 10-12, 2013 34 / 36

slide-35
SLIDE 35

Future works

Future works

Develop WUI and website Implement other tabular environments when exporting to L

AT

EX. Export to Word (explore R2wd package). . . .

Suggestions

Isaac Subirana & Joan Vila (RICAD) compareGroups updated: version 2.0 July 10-12, 2013 35 / 36

slide-36
SLIDE 36

THANK YOU! ¡MUCHAS GRACIAS! MOLTES GR` ACIES!

Don’t hesitate to contact us: Isaac Subirana < isubirana@imim.es > Joan Vila < jvila@imim.es >

Isaac Subirana & Joan Vila (RICAD) compareGroups updated: version 2.0 July 10-12, 2013 36 / 36