\HeaderA{summary.ProbBin.FCS}{Chi-Squared/Standard Normal Approximation Summary Statistics for
a ProbBin.FCS object}{summary.ProbBin.FCS}
\keyword{univar}{summary.ProbBin.FCS}
\keyword{dplot}{summary.ProbBin.FCS}
\begin{Description}\relax
This function provides summary statistics for the test of distribution
difference of two samples that have been probability-binned or in
histogram form.

Given two probability-binned samples, of which one will be called the
stimulated sample and the other the unstimulated/control sample, the
null hypothesis is that both the unstimulated/Control Data
Histogram/Bins are the statistically the same as the Stimulated
Data Histogram/Bins.  Thus, the two samples have the same distribution
in the null hypothesis.

The alternative hypothesis is that the Unstimulated/Control Data
Histogram/Bins are significantly different from the Stimulated Data
Histogram/Bins.  Thus, the two distributions have a different distribution.
\end{Description}
\begin{Usage}
\begin{verbatim}
  summary.ProbBin.FCS(object, verbose=FALSE,...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{object}] ProbBin.FCS object
\item[\code{verbose}] Boolean whether to output all the counts in each bin
\item[\code{...}] not used
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
There are four main test statistics involved which are the following:

1.  Test1: T.chi.unadj=max(0,(PBmetric-mean(PBmetric)) / SD(PBmetric))
is approximately standard normal (by the Central Limit Theorem
(CLT)).  Thus, the test of significance used the standard normal
test as proposed by Mario Roederer.

2.  Test2: Adjusted PB metric statistic is distributed as a
chi-squared statistics.  Thus, the test of significance uses
the chi-squared test as proposed by Keith A. Baggerly.

3.  Test3: Adjusted T.chi.unadj statistic is approximately 
the standard normal (by CLT).  Thus the test of significance uses the
standard normal test as proposed by Keith A. Baggerly.

4.  Test4: Pearson's statistic using the Chi-Squared Test.
There has been a suggestion of using a different number of degrees of
freedom


Please note that all four tests use different statistics to test the
same null hypothesis against the same alternative hypothesis. 

Test 2 and 3 are ajusted forms of the statistics mentioned in Test 1.

Different p-values both one and two-sided are given for those
applicable statistics.
\end{Details}
\begin{Value}
A list consisting of:
\begin{ldescription}
\item[\code{PBinType}] Type of Probability Binning:
\item["by.control"] uses the control dataset to obtain the
breaks/cutoffs to bin the stimulated dataset given a certain
number of observations in each bin of the control dataset
\item["combined"] uses the combined dataset (both control and stimulated
datasets) to obtain the breaks/cutoffs for the bins given a
certain number in each bin

\item[\code{control.bins}] single column matrix of the counts in each bin of
the control dataset
\item[\code{stim.bins}] single column matrix of the counts in each bin of the
stimulated dataset
\item[\code{total.control}] numeric; total number in the control dataset
\item[\code{total.stim}] numeric; total number in the stimulated dataset
\item[\code{T.chi.unadj}] Roederer's unadjusted normalized PB metric statistic which
is normalized by subtracting off the
mean and then dividing by the standard deviation.  This statistic is
approximately standard normal.
\item[\code{p.val.2tail.z.unadj}] Two-tailed standard normal p-value corresponding to the
Roederer's unadjusted normalized PB metric statistic which is approximated as
a standard normal
\item[\code{p.val.1tail.z.unadj}] Upper standard normal one-tailed p-value corresponding to the
Roederer's unadjusted PB metric statistic which is approximated as
a standard normal
\item[\code{PBmetric.unadj}] Roederer's unadjusted PB metric which is
((n.c + n.s)/(2*nc.*n.s))*Chi-squared or an unadjusted
chi-squared statistic, where n.c is the number of control observations
(unbinned) and n.s is the number of stimulated observations (unbinned)
\item[\code{PBmetric.adj}] Baggerly's adjusted PB metric statistic which is a
Chi-squared statistic
\item[\code{PB.df}] The degrees of freedom of the PB metric (adjusted and
unadjusted) which is B-1, where B is the number of bins in the
eitherthe control or the stimulated binned data
\item[\code{p.val.1tail.chi.adj}] Upper one-tailed chi-squared p-value
corresponding to Baggerly's adjusted PB metric
\item[\code{T.chi.adj}] Baggerly's PB metric which is normalized
by subtracting off the mean and dividing by the standard deviation;
This normalized statistic is approximately standard normal.
\item[\code{p.val.1tail.z.adj}] Upper one-tailed standard normal p-value corresponding to the
Baggerly's adjusted normalized PB metric statistic which is approximated as
a standard normal
\item[\code{p.val.2tail.z.adj}] Standard normal two-tailed p-value corresponding to the
Baggerly's adjusted PB metric statistic which is approximated as
a standard normal
\item[\code{pearson.stat}] Pearson's Chi-Squared Statistic with degrees
of freedom 2B-1, where B is the number of bins in either the control or
the stimulated binned data
\item[\code{pearson.df}] the degrees of freedom for the chi-squared statistic
\item[\code{pearson.p.value}] The p-value corresponding to the chi-squared distribution
\item[\code{pearson.method}] string of the indicating the type of test and
options performed
\item[\code{pearson.dataname}] string of the name(s) of the data
\item[\code{pearson.observed}] a vector of the observed counts
\item[\code{pearson.expected}] a vector of the expected counts under the null
hypothesis
\item[\code{pearson.p.val.PB.df}] Fisher's Chi-squared statistic with degrees
of freedom B-1, where B is the number of bins in either the control or
the stimulated binned data
\end{ldescription}
\end{Value}
\begin{Author}\relax
A.J. Rossini and J.Y. Wan
\end{Author}
\begin{References}\relax
Keith A. Baggerly "Probability Binning and Test Agreement
between Multivariate Immunofluorescence Histograms: Extending the
Chi-Squared test" Cytometry 45: 141:150 (2001).

Mario Roederer, et al. "Probability Binning Comparison: A
Metric for Quantitating Univariate Distribution Differences" Cytometry
45:37-46 (2001).

Documentation for \code{\LinkA{chisq.test}{chisq.test}}.
\end{References}
\begin{SeeAlso}\relax
\code{\LinkA{ProbBin.FCS}{ProbBin.FCS}}, \code{\LinkA{ProbBin.flowcytest}{ProbBin.flowcytest}},
\code{\LinkA{chisq.test}{chisq.test}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}

if (require(rfcdmin)){
  ## obtaining the FCS objects from VRC data
if ( !(is.element("unst.1829", objects()) & is.element("st.1829", objects())) ){
data(VRCmin)
}
IFN.gamma.1<-unst.1829@data[1:2000,4]
IFN.gamma.2<-st.1829@data[1:2000,4]

#Probability binning using the control dataset to determine the breaks
PB1<-ProbBin.FCS(IFN.gamma.1, IFN.gamma.2, 200,
varname=colnames(unst.1829@data)[4], PBspec="by.control",MY.DEBUG=FALSE)

sum.PB1.1<-summary(PB1)
sum.PB1.2<-summary.ProbBin.FCS(PB1)

}
\end{ExampleCode}
\end{Examples}

