ProcessData {npclust}R Documentation

Process data set.

Description

Sample size and cluster size calculation for the imported data set.

Usage

ProcessData(data, tx, period, subject, resp, indicator=NULL)

Arguments

data

a data frame in the long format.

tx

treatment variable.

period

time indicator variable.

subject

subject or cluster ID

resp

response variable to be analyzed.

indicator

an optional vector of characters indicating the order of pre and post intervention period; must match the levels of period argument if specified; if not specified, the pre and post intervention period will be ordered in the alphabet order by default

Value

a list containing the following components:

trt

number of treatments

nc

complete cluster sample size within each treatment group

n1

incomplete cluster sample size pre intervention within each treatment group

n2

incomplete cluster sample size post intervention within each treatment group

m1c

complete cluster sizes pre-intervention within each treatment group

m2c

complete cluster size post-intervention within each treatment group

m1i

incomplete cluster sizes pre-intervention within each treatment group

m2i

incomplete cluster sizes post-intervention within each treatment group

x1c

complete data pre-intervention within each treatment group

x2c

complete data post-intervention within each treatment group

x1i

incomplete data pre-intervention within each treatment group

x2i

incomplete data post-intervention within each treatment group

Examples

ARTIS_result <- ProcessData(ARTIS, tx, intervention, homeid, symptoms_pqol,
                            c("0","1"))
names(ARTIS_result)
skin_result <- ProcessData(skin, tx, intervention, subject, score,
                           c("control","treatment"))
skin_result$nc
skin_result$n1
skin_result$n2

[Package npclust version 0.1.0 Index]