コード例 #1
0
        }         //  end CalcAllStats

        private void CalcCombinedError(string currMeth)
        {
            //  Reports ST1/ST2
            if (stage2Stats.Count > 0)
            {
                double ce = CommonStatistics.CombinedSamplingError(currMeth, stage1Stats[0].theSampErr, stage2Stats[0].theSampErr);
                stage1Stats[0].CombSampErr = ce;
                stage2Stats[0].CombSampErr = ce;
            }
            else
            {
                stage1Stats[0].CombSampErr = stage1Stats[0].theSampErr;
            }
            return;
        }   //  end CalcCombinedError
コード例 #2
0
        }   //  end ProcessRecovered

        private void CalcAllStats(POPDO pop, int whichStage, string currMethod)
        {
            //  Reports ST1/ST2
            //  first capture which stage samples to use
            int stageSamples;

            switch (whichStage)
            {
            case 1:
                stageSamples = (int)pop.StageOneSamples;
                if (stageSamples == 1.0)
                {
                    stage1Stats[0].theMean = CommonStatistics.MeanOfX(stage1Stats[0].SumOfX, stageSamples);
                }
                else
                {
                    stage1Stats[0].theTvalue  = CommonStatistics.LookUpT(stageSamples - 1);
                    stage1Stats[0].theMean    = CommonStatistics.MeanOfX(stage1Stats[0].SumOfX, stageSamples);
                    stage1Stats[0].theSD      = CommonStatistics.StdDeviation(stage1Stats[0].SumOfX2, stage1Stats[0].SumOfX, stageSamples);
                    stage1Stats[0].theCV      = CommonStatistics.CoeffVariation(stage1Stats[0].theMean, stage1Stats[0].theSD);
                    stage1Stats[0].theSE      = CommonStatistics.StdError(stage1Stats[0].SumOfX2, stage1Stats[0].SumOfX, stageSamples, currMethod, (float)pop.TalliedTrees, 1);
                    stage1Stats[0].theSampErr = CommonStatistics.SampleError(stage1Stats[0].theMean, stage1Stats[0].theSE, stage1Stats[0].theTvalue);
                }       //  endif
                break;

            case 2:
                stageSamples = (int)pop.StageTwoSamples;
                if (stageSamples == 1.0 && stage2Stats[0].SumOfX2 > 0)
                {
                    stage2Stats[0].theMean = CommonStatistics.MeanOfX(stage2Stats[0].SumOfX, stageSamples);
                }
                else if (stageSamples > 0 && stage2Stats[0].SumOfX2 > 0)
                {
                    stage2Stats[0].theTvalue  = CommonStatistics.LookUpT(stageSamples - 1);
                    stage2Stats[0].theMean    = CommonStatistics.MeanOfX(stage2Stats[0].SumOfX, stageSamples);
                    stage2Stats[0].theSD      = CommonStatistics.StdDeviation(stage2Stats[0].SumOfX2, stage2Stats[0].SumOfX, stageSamples);
                    stage2Stats[0].theCV      = CommonStatistics.CoeffVariation(stage2Stats[0].theMean, stage2Stats[0].theSD);
                    stage2Stats[0].theSE      = CommonStatistics.StdError(stage2Stats[0].SumOfX2, stage2Stats[0].SumOfX, stageSamples, currMethod, (float)pop.TalliedTrees, 2);
                    stage2Stats[0].theSampErr = CommonStatistics.SampleError(stage2Stats[0].theMean, stage2Stats[0].theSE, stage2Stats[0].theTvalue);
                } //  endif
                break;
            }     //  end switch on stage
        }         //  end CalcAllStats