data.cp: Creates binary data of a given data set

Description Usage Arguments Value Author(s) Examples

View source: R/data.cp.R

Description

Binary data are sometimes needed to analyse these data. Data of two situation (e.g. diagnostic tests) with continous outcome are assumed to be given. With the help of the cutpoint for each test, these data can be dichotomise.

Usage

1
data.cp(dat, col.test1, col.test2, cp.test1, cp.test2)

Arguments

dat

name of the data set you want to be dichotomise

col.test1

number of the column of the first test in the data set, which shall be dichotomised

col.test2

number of the column of the second test in the data set, which shall be dichotomised

cp.test1

cutpoint for the first test

cp.test2

cutpoint for the second test

Value

A matrix containing the two tests with binary data

Author(s)

Daniela Wenzel, Antonia Zapf

Examples

1
2
3
4
5
6
7
# create a data set
v1=c(seq(1,10,0.5))
v2=c(seq(2,11,0.5))
n=c(seq(1,19,1))
new=cbind(n,v1,v2)
# cutpoint of the first test is 1.6, of the second test 2.3
result=data.cp(new,2,3,1.6,2.3)

diffdepprop documentation built on May 1, 2019, 11:11 p.m.