Libraries.Compute.Statistics.Tests.CompareMeansPairwise Documentation

This class implements several post hoc analysis tests, which are intended to be used after a significant CompareMeans test with three or more samples. This class can take two approaches. The first, which is the default, called the 'fitted' approach, will use the fitted result of the prior CompareMeans test to calculate the standard error and adjustments to correct for familywise error. The formal names of tests included in fitted approach are as follows: Tukey's HSD, Tukey-Kramer, Games-Howell, Emmeans-Bonferroni, Nemenyi, Dunn-Bonferroni, and Conover-Iman-Bonferroni. The second approach, called the 'unfitted' approach, will not use the fitted result of prior CompareMeans test, instead it will run individual two-sample CompareMeans tests and then correct for familywise error using Bonferroni. The formal names of tests included in the unfitted approach are as follows: t-test, Welch's t-test, paired t-test, paired Wilcoxon test, and Mann-Whitney-Wilcoxon test. There are two types of corrections as well, the first is 'lenient', which is an inherent correction applied in some fitted tests, the second is 'strict' which refers to any test that applies the Bonferroni correction to the p-values. See the INFORMATION comment block at the bottom of this class for more information about each test. For more information: https://en.wikipedia.org/wiki/Post_hoc_analysis

Example Code

use Libraries.Compute.Statistics.DataFrame
use Libraries.Compute.Statistics.Tests.CompareMeansPairwise

DataFrame frame
frame:Load("Data/Data.csv")

// this example will show a two-factor between subjects design

// make a design for the test to follow 
ExperimentalDesign design

// select the name of a column in your frame as a first factor (independent variable)
design:AddBetweenSubjectsFactor("Age")      

// select the name of a column in your frame as a second factor (independent variable)
design:AddBetweenSubjectsFactor("Group")    

// select the name of a column in your frame as the dependent variable
design:AddDependentVariable("Response")    

// tell the frame to use this design and run a compare means pairwise test
CompareMeansPairwise pairwise = frame:CompareMeansPairwise(design)

// output the pairwise summary, a list of adjusted p-values for every comparison
output pairwise:GetPairwiseSummary()

// if you only want a specific set of comparisons based on a certain factor or interaction
output pairwise:GetPairwiseSummary("Age:Group")

Inherits from: Libraries.Compute.Statistics.DataFrameCalculation, Libraries.Compute.Statistics.Inputs.ColumnInput, Libraries.Language.Object, Libraries.Compute.Statistics.Tests.StatisticalTest, Libraries.Compute.Statistics.Tests.CompareMeans, Libraries.Compute.Statistics.Inputs.FactorInput

Actions Documentation

AddBetweenSubjectsFactor(text factorHeader, text variableHeader, text columnHeaders)

For wide data in between design.

Parameters

  • text factorHeader
  • text variableHeader
  • text columnHeaders

AddBetweenSubjectsFactor(text header)

For long or wide data.

Parameters

  • text header

AddBetweenSubjectsFactor(text factorHeader, text columnHeaders)

For wide data in between design.

Parameters

  • text factorHeader
  • text columnHeaders

AddColumn(integer column)

This action adds a value to the end of the input.

Parameters

  • integer column

AddDependentVariable(text header)

For long data.

Parameters

  • text header

AddFactor(integer column)

This action adds a value to the end of the input.

Parameters

  • integer column

AddSubjectIdentifier(text header)

For long or wide data.

Parameters

  • text header

AddWithinSubjectsFactor(text header)

For long data.

Parameters

  • text header

AddWithinSubjectsFactor(text factorHeader, text variableHeader, text columnHeaders)

For wide data in within design or mixed design.

Parameters

  • text factorHeader
  • text variableHeader
  • text columnHeaders

AddWithinSubjectsFactor(text factorHeader, text columnHeaders)

For wide data in within design or mixed design.

Parameters

  • text factorHeader
  • text columnHeaders

AssumeEqualVariances()

Used in 2-sample and N-sample tests

Return

boolean:

AssumeEqualVariances(boolean assume)

Only one result from two-sample test

Parameters

  • boolean assume

AssumeNormalDistribution(boolean assume)

Parameters

  • boolean assume

AssumeNormalDistribution()

Used in 1-sample, 2-sample, and N-sample tests

Return

boolean:

Calculate(Libraries.Compute.Statistics.DataFrame frame)

The distribution used to calculate the p-value in tukey and nemenyi test.

Parameters

Calculate(Libraries.Compute.Statistics.Reporting.CompareMeansResult result)

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.

Parameters

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)

CompareSeveralMeans(Libraries.Compute.Statistics.DataFrame frame)

Analysis of variance (ANOVA) for 3 or more independent groups. Null hypothesis: The means are equal across all samples. Alternative hypothesis: At least one mean is not equal to the others. Assumptions: 1. Two or more samples: If two samples: Best to use a Two-Sample T-Test > CompareMeans:CompareTwoMeans 2. Samples are independent: If not independent: Use a Repeated Measures Anova > CompareMeans:CompareSeveralRelatedMeans 3. Samples are normally distributed: To test this: Use a Shapiro-Wilk test > CompareDistributions:CompareDistributionToNormal If not normal: Use a Kruskal-Wallis Test > CompareMeans:CompareSeveralRankedMeans 4. Samples have equal variances: To test this: Use a Levene's Test > CompareVariances:CompareIndependentVariances If not equal: Use Welch's Anova > CompareMeans:AssumeEqualVariances(false) Post-Hoc Analysis: If this test is significant it may help to run a post hoc follow-up test This can be done using a CompareMeansPairwise test and passing the result from this test as the parameter Use a Tukey's Multiple Comparison Test > CompareMeansPairwise > UseLenientCorrection(true)

Parameters

Example


    use Libraries.Compute.Statistics.DataFrame
    use Libraries.Compute.Statistics.Tests.CompareMeans

    DataFrame frame
    frame:Load("data.csv")
    frame:AddSelectedColumns(0)
    frame:AddSelectedColumns(1)
    frame:AddSelectedColumns(2)
    CompareMeans compare = frame:CompareMeans()
    output compare:GetSummary()

CompareSeveralRankedMeans(Libraries.Compute.Statistics.DataFrame frame)

Kruskal-Wallis H-Test for 3 or more independent groups. This can be used on 2 independent groups, although the better option would be the Mann-Whitney U Test Null hypothesis: The population medians are equal across all samples. Alternative hypothesis: At least one population median is not equal to the others. Assumptions: 1. Two or more samples: If two samples: Best to use a Mann-Whitney U-Test > CompareMeans:CompareTwoRankedMeans 2. Samples are independent: If not independent: Use a Friedman Test > CompareMeans:CompareSeveralRelatedRankedMeans 3. Samples are skewed, or not normally distributed: To test this: Use a Shapiro-Wilk test > CompareDistributions:CompareDistributionToNormal If not skewed: Use a One-Way Anova Test > CompareMeans:CompareSeveralMeans 4. Samples follow a similarly-shaped distribution To test this: Use a Kolmogorov-Smirnov Test > Post-Hoc Analysis: If this test is significant it may help to run a post hoc follow-up test This can be done using a CompareMeansPairwise test and passing the result from this test as the parameter Use a Dunn's Multiple Comparison Test > CompareMeansPairwise > UseLenientCorrection(true)

Parameters

Example


    use Libraries.Compute.Statistics.DataFrame
    use Libraries.Compute.Statistics.Tests.CompareMeans

    DataFrame frame
    frame:AddSelectedColumnRange(0,3)

    CompareMeans compare = frame:CompareRankedMeans()
    output compare:GetSummary()

CompareSeveralRelatedMeans(Libraries.Compute.Statistics.DataFrame frame)

Repeated measures analysis of variance (ANOVA) for 3 or more dependent groups. This action assumes each row in the data set is an individual subject and calculates Null hypothesis: The means are equal across all samples. Alternative hypothesis: At least one mean is not equal to the others. Assumptions: 1. Two or more samples: If two samples: Best to use a Paired T-Test > CompareMeans:CompareTwoRelatedMeans 2. Samples are dependent: If not dependent: Use a One-Way Anova > CompareMeans:CompareSeveralMeans 3. Samples are normally distributed: To test this: Use a Shapiro-Wilk test > CompareDistributions:CompareDistributionToNormal If not normal: Use a Friedman Test > CompareMeans:CompareSeveralRelatedRankedMeans 4. Difference between samples have equal variances: To test this: Use a Mauchly's Test > CompareVariances:CompareDependentVariances If not equal: Use Greenhouse-Geisser correction > CompareMeans:AssumeEqualVariances(false) Post-Hoc Analysis: If this test is significant it may help to run a post hoc follow-up test This can be done using a CompareMeansPairwise test and passing the result from this test as the parameter Use a Bonferroni Pairwise Procedure > CompareMeansPairwise > UseStrictCorrection(true)

Parameters

Example


    use Libraries.Compute.Statistics.DataFrame
    use Libraries.Compute.Statistics.Tests.CompareMeans

    DataFrame frame
    frame:Load("data.csv")
    frame:AddSelectedColumnRange(0,4)
    CompareMeans compare = frame:CompareRelatedMeans()
    output compare:GetSummary()

CompareSeveralRelatedRankedMeans(Libraries.Compute.Statistics.DataFrame frame)

Friedman Test for 3 or more dependent groups. This can be used on 2 dependent groups, although the better option would be the Wilcoxon Signed-Ranks Test Null hypothesis: The population medians are equal across all samples. Alternative hypothesis: At least one population median is not equal to the others. Assumptions: 1. Two or more related samples: If two samples: Best to use a Wilcoxon Signed-Ranks Test > CompareMeans:CompareTwoRelatedRankedMeans 2. Samples are dependent: If not dependent: Use a Kruskal-Wallis H-Test > CompareMeans:CompareSeveralRankedMeans 3. Samples are skewed, or not normally distributed: To test this: Use a Shapiro-Wilk test > CompareDistributions:CompareDistributionToNormal If not skewed: Use a One-Way Repeated-Measures Anova Test > CompareMeans:CompareSeveralRelatedMeans 4. Samples follow a similarly-shaped distribution To test this: Use a Kolmogorov-Smirnov Test > Post-Hoc Analysis: If this test is significant it may help to run a post hoc follow-up test This can be done using a CompareMeansPairwise test and passing the result from this test as the parameter Use a Bonferroni Pairwise Procedure > CompareMeansPairwise > UseStrictCorrection(true)

Parameters

Example


    use Libraries.Compute.Statistics.DataFrame
    use Libraries.Compute.Statistics.Tests.CompareMeans

    DataFrame frame
    frame:Load("data.csv")        
    frame:AddSelectedColumnRange(0,3)

    CompareMeans compare = frame:CompareRelatedRankedMeans()
    output compare:GetSummary()

CompareToMean(Libraries.Compute.Statistics.DataFrame frame)

This is a one-sample t-test against a given mean (default is 0) Null hypothesis: The population mean is equal to a proposed mean Alternative hypothesis: The population mean is not equal to a proposed mean Assumptions: 1. One sample: If more than one sample: Use a Paired T-Test > CompareMeans:CompareTwoRelatedMeans 2. Sample is normally distributed: To test this: Use a Shapiro-Wilk test > CompareDistributions:CompareDistributionToNormal If not normal: Use a Wilcoxon Signed-Ranks Test > CompareMeans:CompareToRankedMean

Parameters

Example


    use Libraries.Compute.Statistics.DataFrame
    use Libraries.Compute.Statistics.Tests.CompareMeans

    DataFrame frame
    frame:Load("data.csv")
    frame:AddSelectedColumn(0)

    CompareMeans compare = frame:CompareToMean(10)
    output compare:GetSummary()

CompareToRankedMean(Libraries.Compute.Statistics.DataFrame frame)

Wilcoxon Signed-Ranks Test for 1 group against a given median (default is 0) Null hypothesis: The median is equal to a proposed median. Alternative hypothesis: The median is not equal to a proposed median.

Parameters

Example


    use Libraries.Compute.Statistics.DataFrame
    use Libraries.Compute.Statistics.Tests.CompareMeans

    DataFrame frame
    frame:Load("data.csv")
    frame:AddSelectedColumn(0)

    CompareMeans compare = frame:CompareToRankedMean(10)
    output compare:GetSummary()

CompareTwoMeans(Libraries.Compute.Statistics.DataFrame frame)

This action represents a two sample t-test on two columns of data. Null hypothesis: The two means are equal Alternative hypothesis: The two means are not equal Assumptions: 1. Two samples: If more than two samples: Use a One-Way Anova > CompareMeans:CompareSeveralMeans 2. Samples are independent: If not independent: Use a Paired T-Test > CompareMeans:CompareTwoRelatedMeans 3. Samples are normally distributed: To test this: Use a Shapiro-Wilk test > CompareDistributions:CompareDistributionToNormal If not normal: Use a Mann-Whitney U-Test > CompareMeans:CompareTwoRankedMeans 4. Samples have equal variances: To test this: Use a Levene's Test > CompareVariances:CompareIndependentVariances If not equal: Use Welch's T-Test > CompareMeans:AssumeEqualVariances(false)

Parameters

Example


    use Libraries.Compute.Statistics.DataFrame
    use Libraries.Compute.Statistics.Tests.CompareMeans

    DataFrame frame
    frame:Load("data.csv")
    frame:AddSelectedColumn(0)
    frame:AddSelectedColumn(1)
    CompareMeans compare = frame:CompareMeans()
    output compare:GetSummary()

CompareTwoRankedMeans(Libraries.Compute.Statistics.DataFrame frame)

Mann-Whitney U-Test aka Wilcoxon Rank-Sum Test is for 2 independent samples. Null hypothesis: The two populations are equal Alternative hypothesis: The two populations are not equal Assumptions: 1. Two samples: If more than two samples: Use a Kruskal-Wallis Test > CompareMeans:CompareSeveralRankedMeans 2. Samples are independent: If not independent: Wilcoxon Signed-Rank Test > CompareMeans:CompareTwoRelatedRankedMeans 3. Samples are skewed, or not normally distributed: To test this: Use a Shapiro-Wilk test > CompareDistributions:CompareDistributionToNormal If not skewed: Use a Two-Sample T-Test > CompareMeans:CompareTwoMeans 4. Samples follow a similarly-shaped distribution To test this: Use a Kolmogorov-Smirnov Test >

Parameters

Example


    use Libraries.Compute.Statistics.DataFrame
    use Libraries.Compute.Statistics.Tests.CompareMeans

    DataFrame frame
    frame:Load("data.csv")
    frame:AddSelectedColumnRange(0,1)

    CompareMeans compare = frame:CompareRankedMeans()
    output compare:GetSummary()

CompareTwoRelatedMeans(Libraries.Compute.Statistics.DataFrame frame)

This action represents a two sample paired t-test. Null hypothesis: The difference mean is equal to a proposed mean Alternative hypothesis: The difference mean is not equal to a proposed mean Assumptions: 1. Two samples: If more than two samples: Use a Repeated Measures Anova > CompareMeans:CompareSeveralRelatedMeans 2. Samples are dependent: If not dependent: Use a Two-Sample T-Test > CompareMeans:CompareTwoMeans 3. Difference between samples is normally distributed: To test this: Use a Shapiro-Wilk test > CompareDistributions:CompareDistributionToNormal If not normal: Use a Wilcoxon Signed-Ranks Test > CompareMeans:CompareTwoRelatedRankedMeans

Parameters

Example


    use Libraries.Compute.Statistics.DataFrame
    use Libraries.Compute.Statistics.Tests.CompareMeans

    DataFrame frame
    frame:Load("data.csv")
    frame:AddSelectedColumn(0)
    frame:AddSelectedColumn(1)

    CompareMeans compare = frame:CompareRelatedMeans(10)
    output compare:GetSummary()

CompareTwoRelatedRankedMeans(Libraries.Compute.Statistics.DataFrame frame)

Wilcoxon Signed-Ranks Test for 2 dependent (paired) groups. This can also be used on 1 group. Null hypothesis: The difference median is equal to a proposed median. Alternative hypothesis: The difference median is not equal to a proposed median. Assumptions: 1. One or two samples: If more than two samples: Use a Friedman Test > CompareMeans:CompareSeveralRelatedRankedMeans 2. Samples are dependent: If not dependent: Use a Mann-Whitney U-Test > CompareMeans:CompareTwoRankedMeans 3. Samples are skewed, or not normally distributed: To test this: Use a Shapiro-Wilk test > CompareDistributions:CompareDistributionToNormal If not skewed: Use a Paired Two-Sample T-Test > CompareMeans:CompareTwoRelatedMeans 4. Samples follow a similarly-shaped distribution To test this: Use a Kolmogorov-Smirnov Test >

Parameters

Example


    use Libraries.Compute.Statistics.DataFrame
    use Libraries.Compute.Statistics.Tests.CompareMeans

    DataFrame frame
    frame:Load("data.csv")
    frame:AddSelectedColumnRange(0,1)

    CompareMeans compare = CompareTwoRelatedRankedMeans(10)
    output compare:GetSummary()

CorrectFamilyWiseError(boolean correctFamilyWiseError)

Lenient correction fitted approach is the default for most tests if another is not selected

Parameters

  • boolean correctFamilyWiseError

CorrectFamilyWiseError()

Returns true for correction

Return

boolean:

EmptyColumns()

This action empty's the list, clearing out all of the items contained within it.

EmptyFactors()

This action empty's the list, clearing out all of the items contained within it.

Equals(Libraries.Language.Object object)

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

Parameters

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)

GetAssumptionTestSummary()

This returns the assumption test summary if only one result exists. If no assumption tests were conducted, this will return nothing.

Return

text: the assumption test summary.

Example

use Libraries.Compute.Statistics.DataFrame
use Libraries.Compute.Statistics.Tests.CompareMeans
    
DataFrame frame
frame:Load("Data/Data.csv")
    
CompareMeans compare
compare:Add(0)
compare:Add(1)
compare:Add(2)
compare:Add(3)
compare:TestAllAssumptions()
frame:Calculate(compare)

output compare:GetAssumptionTestSummary()

GetChart()

This returns the pairwise summary if only one result exists. Pairwise results are only calculated in N-sample tests, otherwise this will return nothing.

Return

Libraries.Interface.Controls.Charts.BoxPlot: the pairwise summary.

Example

use Libraries.Compute.Statistics.DataFrame
use Libraries.Compute.Statistics.Tests.CompareMeans
    
DataFrame frame
frame:Load("Data/Data.csv")
    
CompareMeans compare
compare:Add(0)
compare:Add(1)
compare:Add(2)
compare:Add(3)
compare:TestPairwise()
frame:Calculate(compare)

output compare:GetPairwiseSummary()

GetColumn(integer index)

This action gets the item at a given location in an array.

Parameters

  • integer index

Return

integer: The item at the given location.

GetColumnIterator()

This action gets an iterator for the object and returns that iterator.

Return

Libraries.Containers.Iterator: Returns the iterator for an object.

GetColumnSize()

This action gets the size of the array.

Return

integer:

GetDegreesOfFreedom()

This returns the degrees of freedom if only one result exists.

Return

number: the Degrees of Freedom.

GetDesign()

This is the class that holds all design selections and design frame.

Return

Libraries.Compute.Statistics.Tests.ExperimentalDesign:

GetDistributionResults()

This returns the distribution assumption test results if only one result exists. If no distribution tests were conducted, this will return undefined.

Return

Libraries.Containers.Array: the distribution results.

Example

use Libraries.Compute.Statistics.DataFrame
use Libraries.Compute.Statistics.Tests.CompareMeans
use Libraries.Compute.Statistics.Reporting.CompareDistributionsResult
    
DataFrame frame
frame:Load("Data/Data.csv")
    
CompareMeans compare
compare:Add(0)
compare:Add(1)
compare:Add(2)
compare:Add(3)
compare:TestDistributionAssumption()
frame:Calculate(compare)

Array<CompareDistributionsResult> dResults = compare:GetDistributionResults()

GetEffectSize()

This returns the effect size if only one result exists.

Return

number: the effect size.

GetFactor(integer index)

This action gets the item at a given location in an array.

Parameters

  • integer index

Return

integer: The item at the given location.

GetFactorIterator()

This action gets an iterator for the object and returns that iterator.

Return

Libraries.Containers.Iterator: Returns the iterator for an object.

GetFactorSize()

This action gets the size of the array.

Return

integer:

GetFormalSummary()

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

Return

text: a condensed formal result of the test

Example

use Libraries.Compute.Statistics.DataFrame
use Libraries.Compute.Statistics.Tests.CompareMeans
    
DataFrame frame
frame:Load("Data/Data.csv")
    
CompareMeans compare
compare:Add(0)
compare:Add(1)
frame:Calculate(compare)

output compare:GetFormalSummary()

GetGroups(Libraries.Compute.Statistics.DataFrame frame)

Gets the the fully factored samples/groups in an array of dataframes. Using an array of dataframes instead of a single dataframe helps with multivariate cases.

Parameters

Return

Libraries.Containers.HashTable:

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()

GetPairwiseResults()

This returns the pairwise results if only one result exists. Pairwise results are only calculated in N-sample tests, otherwise this will return undefined.

Return

Libraries.Containers.Array: the pairwise results.

Example

use Libraries.Compute.Statistics.DataFrame
use Libraries.Compute.Statistics.Tests.CompareMeans
use Libraries.Compute.Statistics.Reporting.CompareMeansResult
    
DataFrame frame
frame:Load("Data/Data.csv")
    
CompareMeans compare
compare:Add(0)
compare:Add(1)
compare:Add(2)
compare:Add(3)
compare:TestPairwise()
frame:Calculate(compare)

Array<CompareMeansResult> pairwise = compare:GetPairwiseResults()

GetPairwiseSummary()

This returns the simple pairwise summary of the results for all effects.

Return

text: the pairwise summary.

Example

use Libraries.Compute.Statistics.DataFrame
use Libraries.Compute.Statistics.Tests.CompareMeansPairwise
    
DataFrame frame
frame:Load("Data/Data.csv")
    
ExperimentalDesign design
design:AddBetweenSubjectsFactor("Age")
design:AddBetweenSubjectsFactor("Group")
design:AddDependentVariable("Response")
    
CompareMeansPairwise compare
compare:SetExperimentalDesign(design)
frame:Calculate(compare)

output compare:GetPairwiseSummary()

GetPairwiseSummary(text source)

This returns the simple pairwise summary of the results for a given effect.

Parameters

  • text source

Return

text: the pairwise summary.

Example

use Libraries.Compute.Statistics.DataFrame
use Libraries.Compute.Statistics.Tests.CompareMeansPairwise
    
DataFrame frame
frame:Load("Data/Data.csv")
    
ExperimentalDesign design
design:AddBetweenSubjectsFactor("Age")
design:AddBetweenSubjectsFactor("Group")
design:AddDependentVariable("Response")
    
CompareMeansPairwise compare
compare:SetExperimentalDesign(design)
frame:Calculate(compare)

output compare:GetPairwiseSummary("Age")

GetProbabilities()

This returns the probabilities of all results in a dataframe

Return

Libraries.Compute.Statistics.DataFrame: the probability frame

GetProbabilityValue()

This returns the probability if only one result exists.

Return

number: the P-Value.

GetReport(Libraries.System.File file)

Example

use Libraries.Compute.Statistics.DataFrame
use Libraries.Compute.Statistics.Tests.CompareMeans
    
DataFrame frame
frame:Load("Data/Data.csv")
    
CompareMeans compare
compare:AddColumn(0)
compare:AddColumn(1)
compare:AddColumn(2)
frame:Calculate(compare)

Array<CompareMeansResult> results = compare:GetResults()

GetResult()

This returns a result if only one exists.

Return

Libraries.Compute.Statistics.Reporting.CompareMeansResult: the CompareMeansResult object

Example

use Libraries.Compute.Statistics.DataFrame
use Libraries.Compute.Statistics.Tests.CompareMeans
    
DataFrame frame
frame:Load("Data/Data.csv")

CompareMeans compare
compare:AddColumn(0)
compare:AddColumn(1)
compare:Calculate(frame)

CompareMeansResult result = compare:GetResult()

GetResults(text source)

Parameters

  • text source

Return

Libraries.Containers.Array: an array of the CompareMeansResult objects for a single source (i.e. a main effect or an interaction effect)

Example

use Libraries.Compute.Statistics.DataFrame
use Libraries.Compute.Statistics.Tests.CompareMeansPairwise
    
DataFrame frame
frame:Load("Data/Data.csv")

ExperimentalDesign design
design:AddBetweenSubjectsFactor("Age")
design:AddBetweenSubjectsFactor("Group")
design:AddDependentVariable("Response")
    
CompareMeansPairwise compare
compare:SetExperimentalDesign(design)
frame:Calculate(compare)

Array<CompareMeansResult> results = compare:GetResults("Age")

GetResults()

Return

Libraries.Containers.Array: an array of all the CompareMeansResult objects

Example

use Libraries.Compute.Statistics.DataFrame
use Libraries.Compute.Statistics.Tests.CompareMeansPairwise
    
DataFrame frame
frame:Load("Data/Data.csv")
    
ExperimentalDesign design
design:AddBetweenSubjectsFactor("Age")
design:AddBetweenSubjectsFactor("Group")
design:AddDependentVariable("Response")
    
CompareMeansPairwise compare
compare:SetExperimentalDesign(design)
frame:Calculate(compare)

Array<CompareMeansResult> results = compare:GetResults()

GetSignificanceLevel()

A list of unique items of the factor

Return

number:

GetSources()

This returns the simple pairwise summary of the results for a given effect.

Return

Libraries.Containers.Array: the pairwise summary.

Example

use Libraries.Compute.Statistics.DataFrame
use Libraries.Compute.Statistics.Tests.CompareMeansPairwise
    
DataFrame frame
frame:Load("Data/Data.csv")
    
ExperimentalDesign design
design:AddBetweenSubjectsFactor("Age")
design:AddBetweenSubjectsFactor("Group")
design:AddDependentVariable("Response")
    
CompareMeansPairwise compare
compare:SetExperimentalDesign(design)
frame:Calculate(compare)

output compare:GetPairwiseSummary("Age")

GetStatisticalFormatting()

GetSummary()

Return

text: a list of the important statistics of the test

Example

use Libraries.Compute.Statistics.DataFrame
use Libraries.Compute.Statistics.Tests.CompareMeans
    
DataFrame frame
frame:Load("Data/Data.csv")
    
CompareMeans compare
compare:Add(0)
compare:Add(1)
frame:Calculate(compare)

output compare:GetSummary()

GetSummaryDataFrame()

Return

Libraries.Compute.Statistics.DataFrame: a DataFrame of the important statistics of the test

Example

use Libraries.Compute.Statistics.DataFrame
use Libraries.Compute.Statistics.Tests.CompareMeans
    
DataFrame frame
frame:Load("Data/Data.csv")
    
CompareMeans compare
compare:Add(0)
compare:Add(1)
frame:Calculate(compare)

DataFrame result = compare:GetSummaryDataFrame()
result:Save("myresult.csv")

GetTestStatistic()

This returns the test statistic if only one result exists.

Return

number: the test statistic.

GetVarianceResult()

This returns the variance assumption test result if only one result exists. If no variance tests were conducted, this will return undefined.

Return

Libraries.Compute.Statistics.Reporting.CompareVariancesResult: the variance result.

Example

use Libraries.Compute.Statistics.DataFrame
use Libraries.Compute.Statistics.Tests.CompareMeans
use Libraries.Compute.Statistics.Reporting.CompareVariancesResult
    
DataFrame frame
frame:Load("Data/Data.csv")
    
CompareMeans compare
compare:Add(0)
compare:Add(1)
compare:Add(2)
compare:Add(3)
compare:TestVarianceAssumption()
frame:Calculate(compare)

CompareVariancesResult vResult = compare:GetVarianceResult()

IsEmptyColumns()

This action returns a boolean value, true if the container is empty and false if it contains any items.

Return

boolean: Returns true when the container is empty and false when it is not.

IsEmptyFactors()

This action returns a boolean value, true if the container is empty and false if it contains any items.

Return

boolean: Returns true when the container is empty and false when it is not.

Paired(boolean paired)

Used in 2-sample tests

Parameters

  • boolean paired

Paired()

Used in 2-sample tests

Return

boolean:

Ranked()

Used in 1-sample, 2-sample, and N-sample tests

Return

boolean:

Ranked(boolean ranked)

Used in 1-sample, 2-sample, and N-sample tests

Parameters

  • boolean ranked

RemoveColumn(integer column)

This action removes the first occurrence of an item that is found in the Addable object.

Parameters

  • integer column

Return

boolean: Returns true if the item was removed and false if it was not removed.

RemoveColumnAt(integer index)

This action removes an item from an indexed object and returns that item.

Parameters

  • integer index

RemoveFactor(integer column)

This action removes the first occurrence of an item that is found in the Addable object.

Parameters

  • integer column

Return

boolean: Returns true if the item was removed and false if it was not removed.

RemoveFactorAt(integer index)

This action removes an item from an indexed object and returns that item.

Parameters

  • integer index

RepeatedMeasures()

Used in N-sample tests

Return

boolean:

RepeatedMeasures(boolean repeatedMeasures)

Used in N-sample tests

Parameters

  • boolean repeatedMeasures

SaveReport(text filepath)

Parameters

  • text filepath

Example

use Libraries.Compute.Statistics.DataFrame
use Libraries.Compute.Statistics.Tests.CompareMeans
    
DataFrame frame
frame:Load("Data/Data.csv")
    
CompareMeans compare
compare:Add(0)
compare:Add(1)
frame:Calculate(compare)

DataFrame result = compare:GetSummaryDataFrame()
result:Save("myresult.csv")

SetExperimentalDesign(Libraries.Compute.Statistics.Tests.ExperimentalDesign design)

Pairwise tests are only necessary if the test is significant

Parameters

SetMean(number mean)

Used in 1-sample and 2-sample (paired) tests

Parameters

  • number mean

SetMedian(number median)

Used in 1-sample and 2-sample (paired) rank tests

Parameters

  • number median

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)

Create a new frame based on that list

Parameters

TestAllAssumptions()

This action will set all of the relevant assumption tests to be calculated

TestDistributionAssumption()

Used in 1-sample, 2-sample, and N-sample tests

TestPairwise()

Used in N-sample tests

TestPairwise(boolean test)

Used in N-sample tests

Parameters

  • boolean test

TestVarianceAssumption()

Used in 2-sample and N-sample tests

TestVarianceAssumption(boolean test)

Used in 2-sample and N-sample tests

Parameters

  • boolean test

UseFittedApproach(boolean useFittedApproach)

Choose fitted (unplanned) approach pairwise comparisons for N-sample pairwise tests

Parameters

  • boolean useFittedApproach

UseLenientCorrection(boolean useLenientCorrection)

Choose lenient multiple comparison as correction for N-sample pairwise tests

Parameters

  • boolean useLenientCorrection

UseStrictCorrection(boolean useStrictCorrection)

Choose strict pairwise comparison as correction for N-sample pairwise tests

Parameters

  • boolean useStrictCorrection

UseUnfittedApproach(boolean useUnfittedApproach)

Choose unfitted (planned) approach pairwise comparisons for N-sample pairwise tests

Parameters

  • boolean useUnfittedApproach

UsingFittedApproach()

Returns true for multiple comparisons to use the model as a reference for N-sample pairwise tests

Return

boolean:

UsingLenientCorrection()

Returns true for lenient multiple comparison as correction for N-sample pairwise tests

Return

boolean:

UsingStrictCorrection()

Returns true for strict pairwise comparison as correction for N-sample pairwise tests

Return

boolean:

UsingUnfittedApproach()

Returns true for multiple comparisons to use individual tests for N-sample pairwise tests

Return

boolean: