surv.curv: survival curves

Description Usage Arguments Details Value See Also Examples

View source: R/surv.curv.R

Description

Cacluate survival proportion of Reaction Time (RT) data in each bin

Usage

1
surv.curv(x, .bin, sample = FALSE, sample.n = length(x), replace = TRUE)

Arguments

x

A numeric vector of RT data.

.bin

A numeric vector specifying upper bounds of each timing bin

sample

logical. If TRUE, random sample of x is used to calculate survival proportion.

sample.n

A size of the sample when sample=TURE. Default to length(x)

replace

logical. If TRUE, sampling (in case of sample=TURE) will be with replacement.

Details

This funciton is used internally to calculate the survival proportion.

Value

A vector of length length(.bin) corresponding to survival proportion at each of timing bin in .bin.

See Also

surv.mean

Examples

1
2
3
4
5
6
7
8
9
#generate a random RT data
set.seed(1)
sbj.x <- rnorm(n = 50, mean=300, sd=50)

#obtain a survival curve for 600 bins form 0 ms to 600 ms.
curv.x <- surv.curv(sbj.x, .bin=seq(0,600,by=1))

#plot
plot(curv.x)

matsukik/RTsurvival documentation built on May 21, 2019, 12:57 p.m.