You are here: Symbol Reference > Dew.Stats Namespace > Regress Class > Regress Methods > RegressTest Method > RegressTest Method (TVec, TVec, TMtx, TRegStats, TVec, TVec, boolean, TVec)
Dew Stats for .NET
Contents
PreviousUpNext
Regress.RegressTest Method (TVec, TVec, TMtx, TRegStats, TVec, TVec, boolean, TVec)

Regression tests.

C#
public RegressTest(TVec Y, TVec YCalc, TMtx ATA, ref TRegStats RegStat, TVec Residuals, TVec BStdDev, bool Constant, TVec Weights);
Parameters
Parameters 
Description 
Dependant variables. 
YCalc 
Estimated (calculated) dependant variables. 
ATA 
Inverse matrix of normal equations i.e [A(T)*A]^-1
RegStat 
Returns regression statistics parameters. 
Constant 
If true then include intercept term b(0) in calculations. If false, set intercept term b(0) to 0.0. 
Weights 
Model weights (optional). 

Using regression results the routine calculates additional regression statistical parameters, together with model coefficients standard errors and model errors.

Perform MLR and use results to calculate additional statistical parameters.

using Dew.Math;
using Dew.Stats.Units;
using Dew.Stats;
namespace Dew.Examples
{
  private void Example()
  {
    Matrix A = new Matrix(0,0);
    Matrix ATA = new Matrix(0,0);
    Vector y = new Vector(0);
    Vector b = new Vector(0);
    Vector w = new Vector(0);
    Vector b = new Vector(0);
    Vector res = new Vector(0);
    Vector bse = new Vector(0);
    // independent variables
    A.SetIt(4,2,false, new double[] {1.0, 2.0,
                    -3.2, 2.5,
                     8.0, -0.5,
                     -2.2, 1.8});
    w.SetIt(false, new double[] {1,2,2,1}); // weights
    y.SetIt(false, new double[] {-3.0, 0.25, 8.0, 5.5}); // dependent variables
    TRegStats rs = MulLinRegress(y,A,b,w,true,yhat,ATA); //do regression
    // b=(19.093757944, -2.0141843616, -10.082487055)
    RegressTest(y,yhat,ATA,out RegStat,res,bse,true,w); // do basic regression stats
    // RegStat = (ResidualVar:0.037230395108; R2:0.99965713428;
    // AdjustedR2:0.99897140285; F:1457.7968725; SignifProb: 0.01851663347)
  }
}
What do you think about this topic? Send feedback!
Copyright (c) 1999-2010 by Dew Research. All rights reserved.