These examples are made from PREDIMED data available in compareGroups package. To know which variables and how many individuals are included in this data set see here. To know more about the PREDIMED study visit this site.

Example 1.

Descriptives of variables by intervention group.

Several types of statistics (mean, standard deviation, quantiles or frequencies) are displayed according to the nature of each variable (categorical, continuous and normal-distributed or other quantitative type distribution). Also, p-value to test equality between groups is computed using the appropiate test.

View code

Example 1

Example 1

Example 2.

Univariate or bivariate plots of categorical or numeric variables.

Barplots, boxplots or normality plots are displayed according to the nature of described variable. These plots are useful to explore visually whether a continuous variable follows a normal distribution or to identify possible outliers or rare categories, etc.

View code

Example 2

Example 2

Example 3.

Descriptives of variables by cardiovascular event.

Hazard ratios and p-values are computed taking into account time-to cardiovascular event and censoring.

View code

Example 3

Example 3

Example 4.

Descriptives of variables by cardiovascular event, separated by sex.

Hazard ratios and p-values are computed taking into account time-to cardiovascular event and censoring. Each table (for males and females) are placed one beside the other and the resulting merged table is nice formatted.

View code

Example 4

Example 4

Example 5.

Descriptives of variables by intervention group, reporting groups of variables.

In this table variable labels are indented within each group and a bold-formatted caption is shown.

View code

Example 5

Example 5