73 r2 = 1. - ((n ) / (n - p )) * r;
77 r2 = 1. - ((n - 1.) / (n - p - 1.)) * r;
81 r2 = 1. - ((n - 1.) / (n - p )) * r;
86 r2 = 1. - ((n - 3.) * r / (n - p - 1.)) * (1. + (2. * r) / (n - p + 1.));
90 r2 = 1. - ((n - 3.) * r / (n - p - 1.)) * (1. + (2. * r) / (n - p - 2.3));
94 r2 = 1. - ((n - 4.) * r / (n - p - 1.)) * (1. + (2. * r) / (n - p + 1.));
98 return( r2 < 0. ? 0. : r2 > 1. ? 1. : r2 );
144 return(
m_y.Add_Row(y) &&
m_x.Add_Row(x) );
152 return(
m_y.Create(nValues, y) &&
m_x.Create(nValues, x) );
344 double s_x = 0., s_y = 0., s_xx = 0., s_xy = 0., s_dx2 = 0., s_dy2 = 0., s_dxdy = 0.;
367 m_R = s_dxdy / sqrt(s_dx2 * s_dy2);
double _X_Transform(double y)
bool Calculate(TSG_Regression_Type Type=REGRESSION_Linear, bool bStdError=false)
bool Set_Values(int nValues, double *x, double *y)
double _Y_Transform(double x)
bool Add_Values(double x, double y)
TSG_Regression_Type m_Type
int Get_Count(void) const
double Get_x(double y) const
virtual ~CSG_Regression(void)
double Get_y(double x) const
const SG_Char * asString(void)
bool Create(bool bHoldValues=false)
double Get_Variance(void)
static CSG_String Format(const char *Format,...)
static double Get_F_Tail_from_R2(double R2, int nPredictors, int nSamples, TSG_Test_Distribution_Type Type=TESTDIST_TYPE_Right)
double SG_Regression_Get_Adjusted_R2(double r2, int n, int p, TSG_Regression_Correction Correction)