Esempio n. 1
0
        public static AnovaStatistics ParseAnovaStatistics(object[,] values)
        {
            AnovaStatistics retValue = new AnovaStatistics();

            object[,] anovaValues = Regression.GetAnovaValues(values);

            AnovaRowType[] anovaRowTypes = AnovaRow.GetAnovaRowTypes();

            int counter = 0;
            foreach (AnovaRowType rowType in anovaRowTypes)
            {
                AnovaRow row = new AnovaRow(rowType);
                retValue[row.Type] = row;

                row.DegreesOfFreedom = Convert.ToInt32(anovaValues[counter, 1]);
                row.SumOfSquares = Convert.ToDouble(anovaValues[counter, 2]);
                row.MeanSquare = Convert.ToDouble(anovaValues[counter, 3]);
                row.F = Convert.ToDouble(anovaValues[counter, 4]);
                row.FSignificance = Convert.ToDouble(anovaValues[counter, 5]);

                counter++;
            }

            return retValue;
        }
Esempio n. 2
0
        public AnovaRow this[AnovaRowType type]
        {
            get
            {
                AnovaRow retValue;
                switch (type)
                {
                    case AnovaRowType.Regression:
                        retValue = this.Regression;
                        break;

                    case AnovaRowType.Residual:
                        retValue = this.Residual;
                        break;

                    case AnovaRowType.Total:
                        retValue = this.Total;
                        break;

                    default:
                        throw new EnumerationValueUnhandledException(type);
                }

                return retValue;
            }
            set
            {
                switch (type)
                {
                    case AnovaRowType.Regression:
                        this.Regression = value;
                        break;

                    case AnovaRowType.Residual:
                        this.Residual = value;
                        break;

                    case AnovaRowType.Total:
                        this.Total = value;
                        break;

                    default:
                        throw new EnumerationValueUnhandledException(type);
                }
            }
        }
Esempio n. 3
0
 public AnovaStatistics(AnovaRow regression, AnovaRow residual, AnovaRow total)
 {
     this.Regression = regression;
     this.Residual = residual;
     this.Total = total;
 }