CBData {CorrBin}R Documentation

Create a ‘CBdata’ object from a data frame.

Description

The CBData function creates an object of class CBData that is used in further analyses. It identifies the variables that define treatment group, clustersize and the number of responses.

Usage

CBData(x, trt, clustersize, nresp, freq = NULL)

Arguments

x

a data frame with one row representing a cluster or potentially a set of clusters of the same size and number of responses

trt

the name of the variable that defines treatment group

clustersize

the name of the variable that defines cluster size

nresp

the name of the variable that defines the number of responses in the cluster

freq

the name of the variable that defines the number of clusters represented by the data row. If NULL, then each row is assumed to correspond to one cluster.

Value

A data frame with each row representing all the clusters with the same trt/size/number of responses, and standardized variable names:

Trt

factor, the treatment group

ClusterSize

numeric, the cluster size

NResp

numeric, the number of responses

Freq

numeric, number of clusters with the same values

Author(s)

Aniko Szabo

See Also

read.CBData for creating a CBData object directly from a file.

Examples


data(shelltox)
sh <- CBData(shelltox, trt="Trt", clustersize="ClusterSize", nresp="NResp")
str(sh)


[Package CorrBin version 1.6.1 Index]