ClinReport (version 0.9.1.14)

regroup: Regroup two descriptive tables into one

Description

regroup regroup two descriptive tables (qualitative or quantitative) into one

Usage

regroup(x, y, ...)

# S3 method for desc regroup(x, y, rbind.label = "Response", ...)

Arguments

x

A desc object

y

A desc object

...

Other parameters

rbind.label

Character. The label for rbind column header

Value

A desc object corresponding to a table of statistics.

Details

Regroup a quantitative table and a qualitative table, is only possible if there is one and only one explicative variable. So it works if and only if x1 argument in x and y objects are not NULL, are the same and if x2 argument is NULL in both x and y objects.

The function takes the y.label argument of object x and y respectively as label for the levels of the new column created under the name of rbind.label (see example below)

It's also possible to regroup two quantitative tables, in this case it's possible if there is one or two explicative variables.

For now it's not possible to regroup two qualitative tables.

See Also

report.quali report.quanti report.doc desc

Examples

Run this code
# NOT RUN {
data(datafake)

# Example with a qualitative and a quantitative tables
#The argument y.label is stored in the desc object and 
# only used after by the regroup function

tab1=report.quanti(data=datafake,y="y_numeric",
	x1="GROUP",subjid="SUBJID",y.label="Y numeric")

tab2=report.quali(data=datafake,y="y_logistic",
	x1="GROUP",subjid="SUBJID",y.label="Y logistic")

regroup(tab1,tab2,rbind.label="The label of your choice")


# Example with 2 quantitative tables

tab1=report.quanti(data=datafake,y="y_numeric",
	x1="GROUP",subjid="SUBJID",y.label="Y numeric")

datafake$y_numeric2=rnorm(length(datafake$y_numeric))

tab2=report.quanti(data=datafake,y="y_numeric2",
	x1="GROUP",subjid="SUBJID",y.label="Y Numeric 2")

regroup(tab1,tab2,rbind.label="The label of your choice")

# }

Run the code above in your browser using DataLab