## Libraries.Compute.Statistics.Tests.Regression Documentation

Example Code

``````use Libraries.Compute.Statistics.DataFrame
use Libraries.Compute.Statistics.Tests.Regression

DataFrame frame

Regression regression = frame:RegressionOnSelected()
output regression:GetSummary()
``````

## Actions Documentation

### Calculate(Libraries.Compute.Statistics.DataFrame frame)

Total sum of squares: index for each dependent variable

### Compare(Libraries.Language.Object object)

This action compares two object hash codes and returns an integer. The result is larger if this hash code is larger than the object passed as a parameter, smaller, or equal. In this case, -1 means smaller, 0 means equal, and 1 means larger. This action was changed in Quorum 7 to return an integer, instead of a CompareResult object, because the previous implementation was causing efficiency issues.

#### Return

integer: The Compare result, Smaller, Equal, or Larger.

Example

``````Object o
Object t
integer result = o:Compare(t) //1 (larger), 0 (equal), or -1 (smaller)
``````

### Equals(Libraries.Language.Object object)

This action determines if two objects are equal based on their hash code values.

#### Return

boolean: True if the hash codes are equal and false if they are not equal.

Example

``````use Libraries.Language.Object
use Libraries.Language.Types.Text
Object o
Text t
boolean result = o:Equals(t)
``````

Returns the total adjusted effect size, in statistics typically termed adjusted R^2 (R-squared). This action returns 0 unless the regression has been calculated.

#### Return

number: The adjusted R^2 if the regression is calculated

Returns the total adjusted effect size, in statistics typically termed adjusted R^2 (R-squared). This action returns 0 unless the regression has been calculated.

#### Return

Libraries.Compute.Vector: The adjusted R^2 if the regression is calculated

### GetCoefficientMatrix()

Returns the total beta coefficients. This action returns 0 unless the regression has been calculated.

#### Return

Libraries.Compute.Matrix: The beta coefficients

### GetCoefficientProbabilityValueMatrix()

Returns the probability values for the beta coefficients

### GetCoefficientProbabilityValues()

Returns the probability values for the beta coefficients

### GetCoefficientStandardErrorMatrix()

Returns the standard errors for the beta coefficients

### GetCoefficientStandardErrors()

Returns the standard errors for the beta coefficients

### GetCoefficientTestStatisticMatrix()

Returns the test statistics for the beta coefficients

### GetCoefficientTestStatistics()

Returns the test statistics for the beta coefficients

### GetCoefficients()

Returns the total beta coefficients. This action returns 0 unless the regression has been calculated.

#### Return

Libraries.Compute.Vector: The beta coefficients

### GetCriticalValue()

Outdated, this returns the test statistic not the critical value at alpha.

number:

### GetDenominatorDegreesOfFreedom()

This calculates the degrees of freedom of the denominator in the F-ratio. It is equivalent to the number of rows in the matrix - the number of columns

#### Return

number: The number of rows in the matrix - the number of columns.

### GetEffectSize()

Returns the total effect size, in statistics typically termed R^2 (R-squared). This action returns 0 unless the regression has been calculated.

#### Return

number: The R^2 if the regression is calculated

### GetEffectSizeVector()

Returns the total effect size, in statistics typically termed R^2 (R-squared). This action returns 0 unless the regression has been calculated.

#### Return

Libraries.Compute.Vector: The R^2 if the regression is calculated

### GetEquation()

This action return the linear equation for the regression model.

text:

### GetEquation(integer index)

This action return the linear equation for the regression model.

#### Parameters

• integer index

text:

### GetFormalNumericalResult()

This action summarizes the result and places it into formal academic language, in APA format. For more information: https://apastyle.apa.org/instructional-aids/numbers-statistics-guide.pdf

text:

### GetFormalNumericalResult(integer index)

This action summarizes the result and places it into formal academic language, in APA format. For more information: https://apastyle.apa.org/instructional-aids/numbers-statistics-guide.pdf

#### Parameters

• integer index

text:

### GetFormalSummary()

This action summarizes the result and places it into formal academic language, in APA format.

text:

### GetHashCode()

This action gets the hash code for an object.

#### Return

integer: The integer hash code of the object.

Example

``````Object o
integer hash = o:GetHashCode()
``````

### GetNumeratorDegreesOfFreedom()

This calculates the degrees of freedom of the numerator in the F-ratio. It is equivalent to the number of columns in the matrix - 1

#### Return

number: The number of columns in the matrix - 1

### GetProbabilityValue()

Returns the probability value

number:

### GetProbabilityValueVector()

Returns the probability value

### GetRegressionDegreesOfFreedom()

This calculates the degrees of freedom of the numerator in the F-ratio. It is equivalent to the number of columns in the matrix - 1

#### Return

number: The number of columns in the matrix - 1

### GetRegressionSumOfSquares()

Returns the regression/model sum of squares. This action returns 0 unless the regression has been calculated.

#### Return

number: The regression (model) sum of squares

### GetRegressionSumOfSquaresVector()

Returns the regression/model sum of squares. This action returns 0 unless the regression has been calculated.

#### Return

Libraries.Compute.Vector: The regression (model) sum of squares

### GetResidualDegreesOfFreedom()

This calculates the degrees of freedom of the denominator in the F-ratio. It is equivalent to the number of rows in the matrix - the number of columns

#### Return

number: The number of rows in the matrix - the number of columns.

### GetResidualHistogram()

Returns the histogram chart of the residuals. Each column(series) will show each dependent variable's residuals

### GetResidualMatrix()

Returns the residuals. This action returns 0 unless the regression has been calculated.

#### Return

Libraries.Compute.Matrix: The residuals

### GetResidualStandardError()

Returns the standard error for the residuals

number:

### GetResidualStandardErrorVector()

Returns the standard error for the residuals

### GetResidualSumOfSquares()

Returns the total residual sum of squares. This action returns 0 unless the regression has been calculated.

#### Return

number: The residual sum of squares

### GetResidualSumOfSquaresVector()

Returns the total residual sum of squares. This action returns 0 unless the regression has been calculated.

#### Return

Libraries.Compute.Vector: The residual sum of squares

### GetResiduals()

Returns the residuals. This action returns 0 unless the regression has been calculated.

#### Return

Libraries.Compute.Vector: The residuals

### GetSignificanceLevel()

P-Value: index for each dependent variable

number:

### GetStatisticalFormatting()

Design/Predictor Matrix (X)

### GetSummary()

This action summarizes the result and lists it informally.

text:

### GetTestStatistic()

Returns the test statistic

number:

### GetTestStatisticVector()

Returns the test statistic

### GetTotalSumOfSquares()

Returns the total sum of squares. This action returns 0 unless the regression has been calculated.

#### Return

number: The total sum of squares

### GetTotalSumOfSquaresVector()

Returns the total sum of squares. This action returns 0 unless the regression has been calculated.

#### Return

Libraries.Compute.Vector: The total sum of squares

### HasIntercept()

Returns whether or not this regression includes an intercept.

boolean:

### Predict(Libraries.Compute.Statistics.DataFrame frame)

Outdated, this returns the test statistic not the critical value at alpha.

### SetHasIntercept(boolean hasIntercept)

Sets whether or not this regression includes an intercept.

#### Parameters

• boolean hasIntercept

### SetSignificanceLevel(number significanceLevel)

Sets the significance level of the test (default is 0.05).

#### Parameters

• number significanceLevel: the significance level between 0 and 1.

### SetStatisticalFormatting(Libraries.Compute.Statistics.Reporting.StatisticsFormatting formatting)

Regression sum of squares: index for each dependent variable