cutoff: Cutoff value for a bimodal distribution.

Description Usage Arguments Details Value References See Also Examples

View source: R/cutoff.R

Description

cutoff returns the cutoff value from a bimodal distribution, together with its confidence interval.

Usage

1
2
cutoff(object, t = 1e-64, nb = 10, distr = 2, type1 = 0.05,
  level = 0.95)

Arguments

object

An output from the function em.

t

A numerical scalar indicating the value below which the E-M algorithm should stop.

nb

Number of Monte Carlo simulations.

distr

Either 1 or 2, indicates which distribution belonging the Type-I error corresponds to. 1 correspond to the first distribution in object.

type1

A numerical value between 0 and 1, the value of the type-I error.

level

The confidence level required.

Details

From a fitted finite mixture model, we compute the probability to belong to one of the two probability distributions of the finite mixture model, as a function of the datum value. This probability function is used to look for the cutoff value defined as the datum value for which the probability to belong to a given probability distribution is equal to a type-I error. The confidence interval of this cutoff value is computed by Monte Carlo simulations where in each iteration the five parameter values of the finite mixture model are sampled in a multinormal distribution and then the cutoff value is computed. The confidence interval of the cutoff value is computed by fitting a normal distribution by maximum likelihood to the Monte-Carlo-derived values of the cutoff. This last step is performed by the fitdistr function of the MASS package.

Value

Returns a numerical vector of lenght 3, the first value being the estimated value of the cutoff and the second and thrid values being the lower and upper bound of the confidence interval of this estimate, at the level specified by parameter level.

References

Trang N.V., Choisy M., Nakagomi N.T., Chinh N.T.M., Doan, Y.H., Yamashiro T., Bryant J.E., Nakagomi O. and Anh D.D. (2015) Determination of cut-off cycle threshold values in routine RT-PCR assays to assist differential diagnosis of norovirus in children hospitalized for acute gastroenteritis. Epidemiol. Infect. In press.

See Also

em for fitting a finite mixture model.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
# Measles IgG concentration data:
length(measles)
range(measles)
# Plotting the data:
hist(measles,100,F,xlab="concentration",ylab="density",ylim=c(0,.55),
  main=NULL,col="grey")
# Estimating the parameters of the finite mixture model:
(measles_out <- em(measles,"normal","normal"))
# Adding the E-M estimated finite mixture model:
lines(measles_out,lwd=1.5,col="red")
# Estimating a cutoff value from this fitted finite mixture model:
(cut_off <- cutoff(measles_out))
polygon(c(cut_off[-1],rev(cut_off[-1])),c(0,0,.55,.55),
   col=rgb(0,0,1,.2),border=NA)
abline(v=cut_off[-1],lty=2,col="blue")
abline(v=cut_off[1],col="blue")

qmiao19/CytoComp documentation built on Nov. 5, 2019, 1:57 a.m.