batest {coat}R Documentation

Bland-Altman Test of Method Agreement

Description

Function to perform a Bland-Altman test of differences in method agreement. Additional functions are given for printing and plotting.

Usage

batest(formula, data, subset, na.action, weights, ...)

## S3 method for class 'batest'
print(x, digits = 2, type = c("test", "model", "both"), ...)

## S3 method for class 'batest'
plot(x, ...)

Arguments

formula

symbolic description of the model used to perform the Bland-Altman test of type y1 + y2 ~ x. The left-hand side should specify a pair of measurements (y1 and y2) to assess the agreement. The right-hand side should specify a factor with two levels indicating two independent groups or samples to be compared. Alternatively, multilevel factors or continuously scaled variables can be specified to perform a Bland-Altman test of association, followed by binary splitting into two subgroups.

data, subset, na.action

arguments controlling the formula processing via model.frame.

weights

optional numeric vector of weights (case/frequency weights, by default).

...

further control arguments, passed to ctree_control

x

an object as returned by batest.

digits

a numeric specifying the number of digits to display.

type

character string specifying whether "test" statistics (default), the "model" or "both" should be printed.

Value

Object of class batest with elements

test

result of the Bland-Altman test.

model

tree model used to perform the Bland-Altman test.

Methods (by generic)

Examples


## package and data (reshaped to wide format)
library("coat")
data("VitCap", package = "MethComp")
VitCap_wide <- reshape(VitCap, v.names = "y", timevar = "instrument",
                       idvar = c("item", "user"), drop = "meth", direction = "wide")

## two-sample BA-test
testresult <- batest(y.St + y.Exp ~ user, data = VitCap_wide)

## display
testresult
print(testresult, digits = 1, type = "both")
plot(testresult)


[Package coat version 0.2.0 Index]