R: Probability binning metirc for comparing the probability...
calcPBChiSquare
R Documentation
Probability binning metirc for comparing the probability binned
datasets
Description
This function calculates the Probability binning metric proposed by
Baggerly et al. The function utilizes the data binned using the
proBin and binByRef functions.
The result generated by calling the probBin
function on a control dataset.
sampRes
The result generated by calling the byByRef
function on a test sample dataset
ctrlCount
The number of events in the control sample
sampCount
The number of events in the test sample being compared
Value
A list containing the statistic, p.value, observed, expected counts and
the residuals
Author(s)
Nishant Gopalakrishnan
See Also
proBin, calcPBChiSquare
Examples
data(GvHD)
# flow frame 1 is treated as control dataset and used to generate bins
resCtrl<-proBin(GvHD[[1]][,c("FSC-H","SSC-H","Time")],200)
plotBins(resCtrl,GvHD[[1]],channels=c("FSC-H","SSC-H","Time"),title="Binned control data")
# Same bins are applied to flowFrame 16
resSample<-binByRef(resCtrl,GvHD[[16]][,c("FSC-H","SSC-H","Time")])
ctrlCount<-nrow(GvHD[[1]])
sampCount<-nrow(GvHD[[16]])
stat<-calcPBChiSquare(resCtrl,resSample,ctrlCount,sampCount)
Results
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(flowStats)
Loading required package: flowCore
Loading required package: fda
Loading required package: splines
Loading required package: Matrix
Attaching package: 'Matrix'
The following object is masked from 'package:flowCore':
%&%
Attaching package: 'fda'
The following object is masked from 'package:graphics':
matplot
Loading required package: mvoutlier
Loading required package: sgeostat
sROC 0.1-2 loaded
Loading required package: cluster
Loading required package: flowWorkspace
Loading required package: flowViz
Loading required package: lattice
Loading required package: ncdfFlow
Loading required package: RcppArmadillo
Loading required package: BH
Loading required package: gridExtra
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/flowStats/calcPBChiSquare.Rd_%03d_medium.png", width=480, height=480)
> ### Name: calcPBChiSquare
> ### Title: Probability binning metirc for comparing the probability binned
> ### datasets
> ### Aliases: calcPBChiSquare
> ### Keywords: misc
>
> ### ** Examples
>
>
> data(GvHD)
> # flow frame 1 is treated as control dataset and used to generate bins
> resCtrl<-proBin(GvHD[[1]][,c("FSC-H","SSC-H","Time")],200)
> plotBins(resCtrl,GvHD[[1]],channels=c("FSC-H","SSC-H","Time"),title="Binned control data")
> # Same bins are applied to flowFrame 16
> resSample<-binByRef(resCtrl,GvHD[[16]][,c("FSC-H","SSC-H","Time")])
> ctrlCount<-nrow(GvHD[[1]])
> sampCount<-nrow(GvHD[[16]])
> stat<-calcPBChiSquare(resCtrl,resSample,ctrlCount,sampCount)
>
>
>
>
>
> dev.off()
null device
1
>