ipd2diag: Individual participant data to enter them into diagmeta

View source: R/ipd2diag.R

ipd2diagR Documentation

Individual participant data to enter them into diagmeta

Description

Function to transform individual patient data (IPD) to enter them into diagmeta

Usage

ipd2diag(studlab, value, status, data = NULL, direction = "increasing")

Arguments

studlab

A vector with study labels.

value

A vector with individual patients' measurements of a discrete or continuous variable.

status

A vector with information of the individual's status (0 = non-diseased, 1 = diseased).

data

An optional data frame containing the study information.

direction

A character string specifying whether the probability of the target condition (e.g., a disease) is "increasing" or "decreasing" with higher values of the biomarker, can be abbreviated (see diagmeta).

Value

A data frame with additional class 'ipd2diag' containing the following variables:

studlab

As defined above.

cutoff

Cutoff values.

TP, FP, TN, FN

Number of true positives, false positives, true negatives and false negatives.

Author(s)

Gerta Rücker gerta.ruecker@uniklinik-freiburg.de, Srinath Kolampally kolampal@imbi.uni-freiburg.de

See Also

diagmeta, plot.diagmeta, print.diagmeta, summary.diagmeta

Examples

# Simulate IPD data for three studies, each with 30 patients based
# on normally distributed marker values
#
set.seed(20)
k <- 3
n <- 60
m <- c(20, 23, 26)
d <- 10
s <- 5
studlab <- c(rep(1, n), rep(2, n), rep(3, n))
status <- rep(c(rep(0, n / 2), rep(1, n / 2)), k)
measurement <- c(rnorm(n / 2, m[1], s), rnorm(n/2, m[1] + d, s),
                 rnorm(n / 2, m[2], s), rnorm(n/2, m[2] + d, s), 
                 rnorm(n / 2, m[3], s), rnorm(n/2, m[3] + d, s))
#
IPDdata <- data.frame(studlab, measurement, status)
str(IPDdata)

# Transform these data using ipd2diag()
#
diagdata <- ipd2diag(studlab, value = measurement, status = status)
str(diagdata)

# Run diagmeta()
#
diag1 <- diagmeta(diagdata, distr = "normal")
summary(diag1)
plot(diag1)
par(mfrow = c(1, 2))
plot(diag1, which = "ROC", lines = TRUE)
plot(diag1, which = "SROC", ciSens = TRUE,
  ciSpec = TRUE, lines = TRUE, shading = "hatch")


guido-s/diagmeta documentation built on Oct. 1, 2024, 6:29 p.m.