R: Pearsons chi-square statistic for comparing the probability...
calcPearsonChi
R Documentation
Pearsons chi-square statistic for comparing the probability
binned datasets
Description
This function calculates the Pearsons chi-squared statistic for comparing
data binned using the proBin and binByRef functions.Internally, the
function utilizes the chisq.test function.
Usage
calcPearsonChi(ctrlRes,sampRes)
Arguments
ctrlRes
The result generated by calling the probBin
function on a control dataset.
sampRes
The result generated by calling the byByRef
function on a sample dataset
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")])
stat<-calcPearsonChi(resCtrl,resSample)
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/calcPearsonChi.Rd_%03d_medium.png", width=480, height=480)
> ### Name: calcPearsonChi
> ### Title: Pearsons chi-square statistic for comparing the probability
> ### binned datasets
> ### Aliases: calcPearsonChi
> ### 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")])
> stat<-calcPearsonChi(resCtrl,resSample)
>
>
>
>
>
> dev.off()
null device
1
>