regroup: Regroup two descriptive tables into one

Description Usage Arguments Details Value See Also Examples

View source: R/regroup.desc.R

Description

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

Usage

1
2
3
4
regroup(x, y, ...)

## S3 method for class '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

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.

Value

A desc object corresponding to a table of statistics.

See Also

report.quali report.quanti report.doc desc

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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")

ClinReport documentation built on Sept. 3, 2019, 5:07 p.m.