Пример #1
0
 public MeansSettings()
 {
     InitializeComponent();
     MeansParams = new MeansParameters();
     LocalizeWindow();
     UpdateUiBySettings();
 }
Пример #2
0
 public CurvesDataManager()
 {
     IdealCurve     = new Series();
     ModifiedCurves = new List <Series>();
     AverageCurve   = new Series();
     MeansParams    = new MeansParameters();
     SeriesAssist.SetDefaultSettings(IdealCurve);
     SeriesAssist.SetDefaultSettings(AverageCurve);
     ModifiedCurves.ToList().ForEach(s => SeriesAssist.SetDefaultSettings(s));
 }
Пример #3
0
        public void Tolerance()
        {
            // given
            IList <double> list1 = new List <double>()
            {
                1, 2, 3, 3, 1, 2, 5, 5, 5, 2, 1, 3, 3, 2, 1
            };
            IList <double> list4 = new List <double>()
            {
                10, 100, 1000
            };
            IList <IList <double> > list5 = new List <IList <double> >()
            {
                list1, list4
            };
            double          classifier1 = 2.0;
            double          classifier4 = 11.0;
            double          tolerance5  = 0.1;
            MeansParameters params4     = new MeansParameters();

            params4.Harmonic.Variant = StandardMeanVariants.Straight;
            double         expected1 = 3.0;
            double         expected2 = 1.0;
            double         expected3 = 2.0;
            double         expected4 = list4[1];
            IList <double> expected5 = new List <double>()
            {
                list1.Max(), list4[1]
            };

            // when
            double         result1 = Averages.Tolerance(list1, classifier1, MeanType.Maximum).Value;
            double         result2 = Averages.Tolerance(list1, classifier1, MeanType.Minimum).Value;
            double         result3 = Averages.Tolerance(list1, classifier1, MeanType.Arithmetic).Value;
            double         result4 = Averages.Tolerance(list4, classifier4, MeanType.Harmonic, params4).Value;
            IList <double> result5 = Averages.Tolerance(list5, tolerance5, MeanType.Maximum);

            // then
            Assert.AreEqual(expected1, result1, Assertions.IBM_FLOAT_SURROUNDING);
            Assert.AreEqual(expected2, result2, Assertions.IBM_FLOAT_SURROUNDING);
            Assert.AreEqual(expected3, result3, Assertions.IBM_FLOAT_SURROUNDING);
            Assert.AreEqual(expected4, result4, Assertions.IBM_FLOAT_SURROUNDING);
            Assertions.SameValues(expected5, result5);
        }
Пример #4
0
        public void MeansTestFourValues()
        {
            int iterations = 100;

            var reader      = new StreamReader(File.OpenRead(@"..\..\Data\MeansFourValueResults.csv"));
            int linesinfile = iterations;

            double[] obs0s      = new double[linesinfile];
            double[] obs1s      = new double[linesinfile];
            double[] obs2s      = new double[linesinfile];
            double[] obs3s      = new double[linesinfile];
            double[] total0s    = new double[linesinfile];
            double[] total1s    = new double[linesinfile];
            double[] total2s    = new double[linesinfile];
            double[] total3s    = new double[linesinfile];
            double[] mean0s     = new double[linesinfile];
            double[] mean1s     = new double[linesinfile];
            double[] mean2s     = new double[linesinfile];
            double[] mean3s     = new double[linesinfile];
            double[] var0s      = new double[linesinfile];
            double[] var1s      = new double[linesinfile];
            double[] var2s      = new double[linesinfile];
            double[] var3s      = new double[linesinfile];
            double[] sd0s       = new double[linesinfile];
            double[] sd1s       = new double[linesinfile];
            double[] sd2s       = new double[linesinfile];
            double[] sd3s       = new double[linesinfile];
            double[] min0s      = new double[linesinfile];
            double[] min1s      = new double[linesinfile];
            double[] min2s      = new double[linesinfile];
            double[] min3s      = new double[linesinfile];
            double[] q10s       = new double[linesinfile];
            double[] q11s       = new double[linesinfile];
            double[] q12s       = new double[linesinfile];
            double[] q13s       = new double[linesinfile];
            double[] median0s   = new double[linesinfile];
            double[] median1s   = new double[linesinfile];
            double[] median2s   = new double[linesinfile];
            double[] median3s   = new double[linesinfile];
            double[] q30s       = new double[linesinfile];
            double[] q31s       = new double[linesinfile];
            double[] q32s       = new double[linesinfile];
            double[] q33s       = new double[linesinfile];
            double[] max0s      = new double[linesinfile];
            double[] max1s      = new double[linesinfile];
            double[] max2s      = new double[linesinfile];
            double[] max3s      = new double[linesinfile];
            double[] mode0s     = new double[linesinfile];
            double[] mode1s     = new double[linesinfile];
            double[] mode2s     = new double[linesinfile];
            double[] mode3s     = new double[linesinfile];
            double[] betweensss = new double[linesinfile];
            double[] withinsss  = new double[linesinfile];
            double[] totalsss   = new double[linesinfile];
            double[] betweendfs = new double[linesinfile];
            double[] withindfs  = new double[linesinfile];
            double[] totaldfs   = new double[linesinfile];
            double[] betweenmss = new double[linesinfile];
            double[] withinmss  = new double[linesinfile];
            double[] fanovas    = new double[linesinfile];
            double[] pfanovas   = new double[linesinfile];
            double[] dfbarts    = new double[linesinfile];
            double[] chibarts   = new double[linesinfile];
            double[] chipbarts  = new double[linesinfile];
            double[] chikwts    = new double[linesinfile];
            double[] dfkwts     = new double[linesinfile];
            double[] pchikwts   = new double[linesinfile];
            int      i          = 0;

            while (!reader.EndOfStream)
            {
                var  line   = reader.ReadLine();
                var  values = line.Split(',');
                bool rv     = Double.TryParse(values[1], out obs0s[i]);
                rv = Double.TryParse(values[2], out obs1s[i]);
                rv = Double.TryParse(values[3], out obs2s[i]);
                rv = Double.TryParse(values[4], out obs3s[i]);
                rv = Double.TryParse(values[5], out total0s[i]);
                rv = Double.TryParse(values[6], out total1s[i]);
                rv = Double.TryParse(values[7], out total2s[i]);
                rv = Double.TryParse(values[8], out total3s[i]);
                rv = Double.TryParse(values[9], out mean0s[i]);
                rv = Double.TryParse(values[10], out mean1s[i]);
                rv = Double.TryParse(values[11], out mean2s[i]);
                rv = Double.TryParse(values[12], out mean3s[i]);
                rv = Double.TryParse(values[13], out var0s[i]);
                rv = Double.TryParse(values[14], out var1s[i]);
                rv = Double.TryParse(values[15], out var2s[i]);
                rv = Double.TryParse(values[16], out var3s[i]);
                rv = Double.TryParse(values[17], out sd0s[i]);
                rv = Double.TryParse(values[18], out sd1s[i]);
                rv = Double.TryParse(values[19], out sd2s[i]);
                rv = Double.TryParse(values[20], out sd3s[i]);
                rv = Double.TryParse(values[21], out min0s[i]);
                rv = Double.TryParse(values[22], out min1s[i]);
                rv = Double.TryParse(values[23], out min2s[i]);
                rv = Double.TryParse(values[24], out min3s[i]);
                rv = Double.TryParse(values[25], out q10s[i]);
                rv = Double.TryParse(values[26], out q11s[i]);
                rv = Double.TryParse(values[27], out q12s[i]);
                rv = Double.TryParse(values[28], out q13s[i]);
                rv = Double.TryParse(values[29], out median0s[i]);
                rv = Double.TryParse(values[30], out median1s[i]);
                rv = Double.TryParse(values[31], out median2s[i]);
                rv = Double.TryParse(values[32], out median3s[i]);
                rv = Double.TryParse(values[33], out q30s[i]);
                rv = Double.TryParse(values[34], out q31s[i]);
                rv = Double.TryParse(values[35], out q32s[i]);
                rv = Double.TryParse(values[36], out q33s[i]);
                rv = Double.TryParse(values[37], out max0s[i]);
                rv = Double.TryParse(values[38], out max1s[i]);
                rv = Double.TryParse(values[39], out max2s[i]);
                rv = Double.TryParse(values[40], out max3s[i]);
                rv = Double.TryParse(values[41], out mode0s[i]);
                rv = Double.TryParse(values[42], out mode1s[i]);
                rv = Double.TryParse(values[43], out mode2s[i]);
                rv = Double.TryParse(values[44], out mode3s[i]);
                rv = Double.TryParse(values[45], out betweensss[i]);
                rv = Double.TryParse(values[46], out withinsss[i]);
                rv = Double.TryParse(values[47], out totalsss[i]);
                rv = Double.TryParse(values[48], out betweendfs[i]);
                rv = Double.TryParse(values[49], out withindfs[i]);
                rv = Double.TryParse(values[50], out totaldfs[i]);
                rv = Double.TryParse(values[51], out betweenmss[i]);
                rv = Double.TryParse(values[52], out withinmss[i]);
                rv = Double.TryParse(values[53], out fanovas[i]);
                rv = Double.TryParse(values[54], out pfanovas[i]);
                rv = Double.TryParse(values[55], out dfbarts[i]);
                rv = Double.TryParse(values[56], out chibarts[i]);
                rv = Double.TryParse(values[57], out chipbarts[i]);
                rv = Double.TryParse(values[58], out chikwts[i]);
                rv = Double.TryParse(values[59], out dfkwts[i]);
                rv = Double.TryParse(values[60], out pchikwts[i]);
                i++;
                if (i == linesinfile)
                {
                    break;
                }
            }

            EpiDashboard.MeansParameters Parameters = new MeansParameters();
            Parameters.CrosstabVariableName = "crosstabvar4";
            Parameters.ColumnNames.Add("meanvar");
            Parameters.ColumnNames.Add("crosstabvar4");
            Parameters.IncludeFullSummaryStatistics = true;

            for (int j = 0; j < iterations; j++)
            {
                getData("MeansTestData", "iteration = " + j);
                Parameters.CustomFilter = "iteration = " + j;
                Dictionary <DataTable, List <DescriptiveStatistics> > stratifiedFrequencyTables = DashboardHelper.GenerateFrequencyTable(Parameters);
                foreach (object key in stratifiedFrequencyTables.Keys)
                {
                    Assert.AreEqual(stratifiedFrequencyTables[(System.Data.DataTable)key][0].observations, obs0s[j]);
                    Assert.AreEqual(stratifiedFrequencyTables[(System.Data.DataTable)key][1].observations, obs1s[j]);
                    Assert.AreEqual(stratifiedFrequencyTables[(System.Data.DataTable)key][2].observations, obs2s[j]);
                    Assert.AreEqual(stratifiedFrequencyTables[(System.Data.DataTable)key][3].observations, obs3s[j]);
                    Assert.AreEqual(stratifiedFrequencyTables[(System.Data.DataTable)key][0].sum.Value, total0s[j], 0.0001);
                    Assert.AreEqual(stratifiedFrequencyTables[(System.Data.DataTable)key][1].sum.Value, total1s[j], 0.0001);
                    Assert.AreEqual(stratifiedFrequencyTables[(System.Data.DataTable)key][2].sum.Value, total2s[j], 0.0001);
                    Assert.AreEqual(stratifiedFrequencyTables[(System.Data.DataTable)key][3].sum.Value, total3s[j], 0.0001);
                    Assert.AreEqual(stratifiedFrequencyTables[(System.Data.DataTable)key][0].mean.Value, mean0s[j], 0.0001);
                    Assert.AreEqual(stratifiedFrequencyTables[(System.Data.DataTable)key][1].mean.Value, mean1s[j], 0.0001);
                    Assert.AreEqual(stratifiedFrequencyTables[(System.Data.DataTable)key][2].mean.Value, mean2s[j], 0.0001);
                    Assert.AreEqual(stratifiedFrequencyTables[(System.Data.DataTable)key][3].mean.Value, mean3s[j], 0.0001);
                    Assert.AreEqual(stratifiedFrequencyTables[(System.Data.DataTable)key][0].variance.Value, var0s[j], 0.0001);
                    Assert.AreEqual(stratifiedFrequencyTables[(System.Data.DataTable)key][1].variance.Value, var1s[j], 0.0001);
                    Assert.AreEqual(stratifiedFrequencyTables[(System.Data.DataTable)key][2].variance.Value, var2s[j], 0.0001);
                    Assert.AreEqual(stratifiedFrequencyTables[(System.Data.DataTable)key][3].variance.Value, var3s[j], 0.0001);
                    Assert.AreEqual(stratifiedFrequencyTables[(System.Data.DataTable)key][0].stdDev.Value, sd0s[j], 0.0001);
                    Assert.AreEqual(stratifiedFrequencyTables[(System.Data.DataTable)key][1].stdDev.Value, sd1s[j], 0.0001);
                    Assert.AreEqual(stratifiedFrequencyTables[(System.Data.DataTable)key][2].stdDev.Value, sd2s[j], 0.0001);
                    Assert.AreEqual(stratifiedFrequencyTables[(System.Data.DataTable)key][3].stdDev.Value, sd3s[j], 0.0001);
                    Assert.AreEqual(stratifiedFrequencyTables[(System.Data.DataTable)key][0].min.Value, min0s[j], 0.0001);
                    Assert.AreEqual(stratifiedFrequencyTables[(System.Data.DataTable)key][1].min.Value, min1s[j], 0.0001);
                    Assert.AreEqual(stratifiedFrequencyTables[(System.Data.DataTable)key][2].min.Value, min2s[j], 0.0001);
                    Assert.AreEqual(stratifiedFrequencyTables[(System.Data.DataTable)key][3].min.Value, min3s[j], 0.0001);
                    Assert.AreEqual(stratifiedFrequencyTables[(System.Data.DataTable)key][0].q1.Value, q10s[j], 0.0001);
                    Assert.AreEqual(stratifiedFrequencyTables[(System.Data.DataTable)key][1].q1.Value, q11s[j], 0.0001);
                    Assert.AreEqual(stratifiedFrequencyTables[(System.Data.DataTable)key][2].q1.Value, q12s[j], 0.0001);
                    Assert.AreEqual(stratifiedFrequencyTables[(System.Data.DataTable)key][3].q1.Value, q13s[j], 0.0001);
                    Assert.AreEqual(stratifiedFrequencyTables[(System.Data.DataTable)key][0].median.Value, median0s[j], 0.0001);
                    Assert.AreEqual(stratifiedFrequencyTables[(System.Data.DataTable)key][1].median.Value, median1s[j], 0.0001);
                    Assert.AreEqual(stratifiedFrequencyTables[(System.Data.DataTable)key][2].median.Value, median2s[j], 0.0001);
                    Assert.AreEqual(stratifiedFrequencyTables[(System.Data.DataTable)key][3].median.Value, median3s[j], 0.0001);
                    Assert.AreEqual(stratifiedFrequencyTables[(System.Data.DataTable)key][0].q3.Value, q30s[j], 0.0001);
                    Assert.AreEqual(stratifiedFrequencyTables[(System.Data.DataTable)key][1].q3.Value, q31s[j], 0.0001);
                    Assert.AreEqual(stratifiedFrequencyTables[(System.Data.DataTable)key][2].q3.Value, q32s[j], 0.0001);
                    Assert.AreEqual(stratifiedFrequencyTables[(System.Data.DataTable)key][3].q3.Value, q33s[j], 0.0001);
                    Assert.AreEqual(stratifiedFrequencyTables[(System.Data.DataTable)key][0].max.Value, max0s[j], 0.0001);
                    Assert.AreEqual(stratifiedFrequencyTables[(System.Data.DataTable)key][1].max.Value, max1s[j], 0.0001);
                    Assert.AreEqual(stratifiedFrequencyTables[(System.Data.DataTable)key][2].max.Value, max2s[j], 0.0001);
                    Assert.AreEqual(stratifiedFrequencyTables[(System.Data.DataTable)key][3].max.Value, max3s[j], 0.0001);
                    Assert.AreEqual(stratifiedFrequencyTables[(System.Data.DataTable)key][0].mode.Value, mode0s[j], 0.0001);
                    Assert.AreEqual(stratifiedFrequencyTables[(System.Data.DataTable)key][1].mode.Value, mode1s[j], 0.0001);
                    Assert.AreEqual(stratifiedFrequencyTables[(System.Data.DataTable)key][2].mode.Value, mode2s[j], 0.0001);
                    Assert.AreEqual(stratifiedFrequencyTables[(System.Data.DataTable)key][3].mode.Value, mode3s[j], 0.0001);
                    Assert.AreEqual(stratifiedFrequencyTables[(System.Data.DataTable)key][0].ssBetween.Value, betweensss[j], 0.0001);
                    Assert.AreEqual(stratifiedFrequencyTables[(System.Data.DataTable)key][0].ssWithin.Value, withinsss[j], 0.0001);
                    Assert.AreEqual(stratifiedFrequencyTables[(System.Data.DataTable)key][0].ssBetween.Value + stratifiedFrequencyTables[(System.Data.DataTable)key][0].ssWithin.Value, totalsss[j], 0.0001);
                    Assert.AreEqual(stratifiedFrequencyTables[(System.Data.DataTable)key][0].dfBetween.Value, betweendfs[j], 0.0001);
                    Assert.AreEqual(stratifiedFrequencyTables[(System.Data.DataTable)key][0].dfWithin.Value, withindfs[j], 0.0001);
                    Assert.AreEqual(stratifiedFrequencyTables[(System.Data.DataTable)key][0].dfBetween.Value + stratifiedFrequencyTables[(System.Data.DataTable)key][0].dfWithin.Value, totaldfs[j], 0.0001);
                    Assert.AreEqual(stratifiedFrequencyTables[(System.Data.DataTable)key][0].msBetween.Value, betweenmss[j], 0.0001);
                    Assert.AreEqual(stratifiedFrequencyTables[(System.Data.DataTable)key][0].msWithin.Value, withinmss[j], 0.0001);
                    Assert.AreEqual(stratifiedFrequencyTables[(System.Data.DataTable)key][0].fStatistic.Value, fanovas[j], 0.0001);
                    if (pfanovas[j] < 0.001)
                    {
                        Assert.AreEqual(stratifiedFrequencyTables[(System.Data.DataTable)key][0].anovaPValue.Value, pfanovas[j], 0.0001);
                    }
                    else if (pfanovas[j] < 0.01)
                    {
                        Assert.AreEqual(stratifiedFrequencyTables[(System.Data.DataTable)key][0].anovaPValue.Value, pfanovas[j], 0.001);
                    }
                    else if (pfanovas[j] < 0.1)
                    {
                        Assert.AreEqual(stratifiedFrequencyTables[(System.Data.DataTable)key][0].anovaPValue.Value, pfanovas[j], 0.01);
                    }
                    else
                    {
                        Assert.AreEqual(stratifiedFrequencyTables[(System.Data.DataTable)key][0].anovaPValue.Value, pfanovas[j], 0.1);
                    }
                    Assert.AreEqual(stratifiedFrequencyTables[(System.Data.DataTable)key][0].dfBetween.Value, dfbarts[j], 0.0001);
                    Assert.AreEqual(stratifiedFrequencyTables[(System.Data.DataTable)key][0].chiSquare.Value, chibarts[j], 0.0001);
                    Assert.AreEqual(stratifiedFrequencyTables[(System.Data.DataTable)key][0].bartlettPValue.Value, chipbarts[j], 0.0001);
                    Assert.AreEqual(stratifiedFrequencyTables[(System.Data.DataTable)key][0].kruskalWallisH.Value, chikwts[j], 0.0001);
                    Assert.AreEqual(stratifiedFrequencyTables[(System.Data.DataTable)key][0].dfBetween.Value, dfkwts[j], 0.0001);
                    Assert.AreEqual(stratifiedFrequencyTables[(System.Data.DataTable)key][0].kruskalPValue.Value, pchikwts[j], 0.0001);
                }
            }
        }
Пример #5
0
        public static IList <double> Tolerance(IList <IList <double> > orderedSet, double tolerance, MeanType finisher = MeanType.Harmonic, MeansParameters @params = null)
        {
            if (orderedSet == null || orderedSet.Count == 0)
            {
                return(new List <double>().AsReadOnly());
            }

            double         comparer   = Median(Maximum(orderedSet)).Value - Median(Minimum(orderedSet)).Value;
            double         classifier = comparer * tolerance;
            IList <double> tolerants  = new List <double>();

            for (int x = 0; x < orderedSet.Count; x++)
            {
                tolerants.Add(Tolerance(orderedSet[x], classifier, finisher, @params).Value);
            }

            return(tolerants);
        }
Пример #6
0
        public static double?Tolerance(IList <double> set, double classifier, MeanType finisher = MeanType.Harmonic, MeansParameters @params = null)
        {
            if (set == null || set.Count == 0)
            {
                return(null);
            }

            if (@params == null)
            {
                @params = new MeansParameters();
            }

            IList <double> acceptables = new List <double>();
            IList <double> oscillators = Lists.GetCopy(set);

            Lists.Subtract(oscillators, Median(set).Value);

            for (int i = 0; i < set.Count; i++)
            {
                if (Math.Abs(oscillators[i]) < Math.Abs(classifier))
                {
                    acceptables.Add(set[i]);
                }
            }

            switch (finisher)
            {
            case MeanType.Median:
                return(Median(acceptables));

            case MeanType.Maximum:
                return(Maximum(acceptables));

            case MeanType.Minimum:
                return(Minimum(acceptables));

            case MeanType.Arithmetic:
                return(Arithmetic(acceptables));

            case MeanType.Geometric:
                return(Geometric(acceptables, @params.Geometric.Variant));

            case MeanType.AGM:
                return(AGM(acceptables, @params.AGM.Variant));

            case MeanType.Heronian:
                return(Heronian(acceptables, @params.Heronian.Variant));

            case MeanType.Harmonic:
                return(Harmonic(acceptables, @params.Harmonic.Variant));

            case MeanType.Generalized:
                return(Generalized(acceptables, @params.Generalized.Variant, @params.Generalized.Rank));

            case MeanType.SMA:
                return(SMA(acceptables));

            case MeanType.Central:
                return(Central(acceptables, @params.Central.MassPercent));
            }

            return(null);
        }
Пример #7
0
        public MeansProperties(
            DashboardHelper dashboardHelper,
            IGadget gadget,
            MeansParameters parameters
            )
        {
            InitializeComponent();
            this.DashboardHelper = dashboardHelper;
            this.Gadget          = gadget;
            this.Parameters      = parameters;

            List <string>    fields         = new List <string>();
            List <FieldInfo> items          = new List <FieldInfo>();
            List <string>    crosstabFields = new List <string>();
            List <string>    pairIDFields   = new List <string>();
            List <string>    strataFields   = new List <string>();

            crosstabFields.Add(string.Empty);
            pairIDFields.Add(string.Empty);
            items.Add(new FieldInfo()
            {
                Name             = "",
                DataType         = "",
                VariableCategory = VariableCategory.Field
            });
            //--
            ColumnDataType columnDataType = ColumnDataType.Boolean | ColumnDataType.Numeric | ColumnDataType.UserDefined;

            //--
            foreach (string fieldName in DashboardHelper.GetFieldsAsList())
            {
                items.Add(new FieldInfo()
                {
                    Name             = fieldName,
                    DataType         = DashboardHelper.GetColumnDbType(fieldName).ToString(),
                    VariableCategory = VariableCategory.Field
                });

                crosstabFields.Add(fieldName);
                pairIDFields.Add(fieldName);
                strataFields.Add(fieldName);
            }
            foreach (string fieldName in DashboardHelper.GetFieldsAsList(columnDataType))
            {
                fields.Add(fieldName);
            }
            //---ei-277
            if (DashboardHelper.IsUsingEpiProject)
            {
                if (fields.Contains("RecStatus"))
                {
                    fields.Remove("RecStatus");
                }
                if (fields.Contains("FKEY"))
                {
                    fields.Remove("FKEY");
                }
                if (fields.Contains("GlobalRecordId"))
                {
                    fields.Remove("GlobalRecordId");
                }
                if (fields.Contains("FirstSaveTime"))
                {
                    fields.Remove("FirstSaveTime");
                }
                if (fields.Contains("LastSaveTime"))
                {
                    fields.Remove("LastSaveTime");
                }

                if (crosstabFields.Contains("RecStatus"))
                {
                    crosstabFields.Remove("RecStatus");
                }
                if (crosstabFields.Contains("FKEY"))
                {
                    crosstabFields.Remove("FKEY");
                }
                if (crosstabFields.Contains("GlobalRecordId"))
                {
                    crosstabFields.Remove("GlobalRecordId");
                }
                if (crosstabFields.Contains("FirstSaveTime"))
                {
                    crosstabFields.Remove("FirstSaveTime");
                }
                if (crosstabFields.Contains("LastSaveTime"))
                {
                    crosstabFields.Remove("LastSaveTime");
                }
                if (crosstabFields.Contains("SYSTEMDATE"))
                {
                    crosstabFields.Remove("SYSTEMDATE");
                }

                if (pairIDFields.Contains("RecStatus"))
                {
                    crosstabFields.Remove("RecStatus");
                }
                if (pairIDFields.Contains("FKEY"))
                {
                    crosstabFields.Remove("FKEY");
                }
                if (pairIDFields.Contains("GlobalRecordId"))
                {
                    crosstabFields.Remove("GlobalRecordId");
                }
                if (pairIDFields.Contains("FirstSaveTime"))
                {
                    crosstabFields.Remove("FirstSaveTime");
                }
                if (pairIDFields.Contains("LastSaveTime"))
                {
                    crosstabFields.Remove("LastSaveTime");
                }
                if (pairIDFields.Contains("SYSTEMDATE"))
                {
                    crosstabFields.Remove("SYSTEMDATE");
                }

                if (strataFields.Contains("RecStatus"))
                {
                    strataFields.Remove("RecStatus");
                }
                if (strataFields.Contains("FKEY"))
                {
                    fields.Remove("FKEY");
                }
                if (strataFields.Contains("GlobalRecordId"))
                {
                    strataFields.Remove("GlobalRecordId");
                }
                if (strataFields.Contains("FirstSaveTime"))
                {
                    strataFields.Remove("FirstSaveTime");
                }
                if (strataFields.Contains("LastSaveTime"))
                {
                    strataFields.Remove("LastSaveTime");
                }
                if (strataFields.Contains("SYSTEMDATE"))
                {
                    strataFields.Remove("SYSTEMDATE");
                }
            }
            //--

            fields.Sort();
            crosstabFields.Sort();
            pairIDFields.Sort();

            cbxField.ItemsSource         = fields;
            cbxFieldWeight.ItemsSource   = fields;
            cbxFieldCrosstab.ItemsSource = crosstabFields;
            cbxFieldPairID.ItemsSource   = pairIDFields;
            lvFieldStrata.ItemsSource    = strataFields;

            CollectionView           view             = (CollectionView)CollectionViewSource.GetDefaultView(cbxField.ItemsSource);
            PropertyGroupDescription groupDescription = new PropertyGroupDescription("VariableCategory");

            view.GroupDescriptions.Add(groupDescription);

            RowFilterControl = new RowFilterControl(this.DashboardHelper, Dialogs.FilterDialogMode.ConditionalMode, (gadget as MeansControl).DataFilters, true);
            RowFilterControl.HorizontalAlignment = System.Windows.HorizontalAlignment.Left;
            panelFilters.Children.Add(RowFilterControl);



            #region Translation

            lblConfigExpandedTitleTxt.Text = DashboardSharedStrings.GADGET_CONFIG_TITLE_MEANS;

            tbtnVariables.Title       = DashboardSharedStrings.GADGET_TABBUTTON_VARIABLES;
            tbtnVariables.Description = DashboardSharedStrings.GADGET_TABDESC_MEANS;
            tbtnDisplay.Title         = DashboardSharedStrings.GADGET_TABBUTTON_DISPLAY;
            tbtnDisplay.Description   = DashboardSharedStrings.GADGET_TABDESC_DISPLAY;

            tblockPanelVariablesTxt.Text = DashboardSharedStrings.GADGET_PANELHEADER_VARIABLES;
            tbtnFilters.Title            = DashboardSharedStrings.GADGET_TABBUTTON_FILTERS;
            tblockPanelDisplayTxt.Text   = DashboardSharedStrings.GADGET_PANELHEADER_DISPLAY;
            tbtnFilters.Description      = DashboardSharedStrings.GADGET_TABDESC_FILTERS;

            tblockWeightTxt.Text = DashboardSharedStrings.GADGET_WEIGHT_VARIABLE;
            tblockTitleNDescSubheaderTxt.Text = DashboardSharedStrings.GADGET_PANELSUBHEADER_TITLENDESC;
            tblockTitleTxt.Text               = DashboardSharedStrings.GADGET_GADET_TITLE;
            tblockDescTxt.Text                = DashboardSharedStrings.GADGET_DESCRIPTION;
            tblockPrecision.Text              = DashboardSharedStrings.GADGET_DECIMALS_TO_DISPLAY;
            tblockPanelDataFilterTxt.Text     = DashboardSharedStrings.GADGET_PANELHEADER_DATA_FILTER;
            tblockAnyFilterGadgetOnlyTxt.Text = DashboardSharedStrings.GADGET_FILTER_GADGET_ONLY;
            tblockMeansOfTxt.Text             = DashboardSharedStrings.GADGET_MEANS_VARIABLE;
            tblockCrossTabulateByTxt.Text     = DashboardSharedStrings.GADGET_CROSSTAB_VARIABLE;
            tblockStratifyByTxt.Text          = DashboardSharedStrings.GADGET_STRATA_VARIABLE;

            checkboxShowANOVATxt.Text        = DashboardSharedStrings.GADGET_DISPLAY_ANOVA;
            checkboxShowObservationsTxt.Text = DashboardSharedStrings.GADGET_OBSERVATIONS;
            checkboxShowTotalTxt.Text        = DashboardSharedStrings.GADGET_TOTAL;
            checkboxShowMeanTxt.Text         = DashboardSharedStrings.GADGET_MEANS;
            checkboxShowVarianceTxt.Text     = DashboardSharedStrings.GADGET_VARIANCE;
            checkboxShowStdDevTxt.Text       = DashboardSharedStrings.GADGET_STANDARD_DEVIATION;
            checkboxShowMinTxt.Text          = DashboardSharedStrings.GADGET_MINIMUM;
            checkboxShowQ1Txt.Text           = DashboardSharedStrings.GADGET_SHOWQ1;
            checkboxShowMedianTxt.Text       = DashboardSharedStrings.GADGET_MEDIAN;
            checkboxShowQ3Txt.Text           = DashboardSharedStrings.GADGET_SHOWQ3;
            checkboxShowMaxTxt.Text          = DashboardSharedStrings.GADGET_MAXIMUM;
            checkboxShowModeTxt.Text         = DashboardSharedStrings.GADGET_MODE;
            tblockOutputColumnsTxt.Text      = DashboardSharedStrings.GADGET_OUTPUT_COLUMNS_DISPLAY;
            btnOKTxt.Text     = DashboardSharedStrings.BUTTON_OK;
            btnCancelTxt.Text = DashboardSharedStrings.BUTTON_CANCEL;

            #endregion // Translation
        }