Class SampleSizeTree

java.lang.Object
org.gsusers.gsmv.model.SampleSizeTree

public class SampleSizeTree extends Object
Class SampleSizeTree The SampleSizeTree object contains the whole structure of the sample sizes for both crossed and nested facets, as well management of indices, incrementing indices (stepping), and calculation of range for each configuration ('Effect').
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    SampleSizeTree(Nest _nest, gsLogger _logger, Preferences _prefs)
    Constructor for SampleSizeTree
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addSampleSize(char _c, String[] sss)
    This method runs when sample sizes are entered.
    void
    addSampleSize(int _iFacet, int[] sss)
    This method runs when sample sizes are entered.
    void
    utility for setting up Sample Size Page
    void
    completes sizeArray offsets from size array
    void
     
    void
    utility converts Factor string array lists to string arrays
    void
    DoOver(Boolean _bDoOver)
    setter of 'doOver' flag (use script)
    dumpArray(int[] array)
    utility to convert int array to text string
    getConfiguration(int _iConfig)
    getter of Effects, both primary (per Facet) and cross-interactions.
    int
    getter of Effect count (primary and cross-interactions).
    int
    getCount(int iConf)
    getter of current state in 'Effect'.
    int
    getDepth(char cF)
    Getter of iarDepth by facet character
    int
    getDepth(int _iC)
    getter of iarDepth by "Effect' pointer.
    getter of Facet dictionary in original order
    int
    getDim(char _c)
    total number of states per Facet (Analysis)
    getter of 'Effect Size', i.e.
    getFacet(char _c)
    getter of Facet by designation char.
    Harmonic mean of sample sizes per Facet in nested context, according to Brennan for calculation of G coefficients.
    int
    getHIndex(char c)
    getter of Facet indices by Facet designation char (the order in which the Facet indices step through the score data file)
    int[]
    returns sample size array according to the position of the Facet in the hierarchic order
    int[]
    getHSums(Integer _iHOrd)
    getter of sample size sums per Facet by position in hierarchic order for Analysis.
    getIndex(Integer _iFacet, Integer _iPointer)
    current Facet index in nested environment
    int[]
    getter of all Facet indices
    getLevel(Integer _iFacet)
    Arithmetic mean of sample size per Facet in nested context, according to Brennan for calculation of G coefficients.
    int
    getMaxSum(char _cF)
    Total number of states for Facet cF
    getNest(char _c)
    getter of primary nested configuration of Facets (as in script).
    int
    getOffset(char _cFacet, int _iPointer)
    getter of index offset in nested Facets resulting from the 'Nestor's' index.
    int[]
    returns sample size array according to the position of the Facet in the original order
    int[]
    getter of sample size sums per Facet by position in original order for Analysis.
    javafx.scene.layout.VBox
    getPage(Integer _iSample)
    composes JavaFX code page (vBox to collect sample sizes for a nested Facet.
    void
    getSamples(char _cFacet)
    intializes Facet
    int
    getSize(int iConf)
    getter of maximal state count of 'Effect' as product of Factors.
    int[]
    getSizes(char c)
    returns sample size array by Facet designation char
    int[]
    getSums(char c)
    getter of sample size sums per Facet by Facet designation char for Analysis.
    void
    hasChanged(Integer _iLevel, Integer _iPointer, Integer _value)
    updater of sample size arrays accumulations
    int
    iGetRepFactor(char _cReplicate)
    Calculates the number of fixed scores presenting for each replication
    Incrementer for simulation for each call the Facet indices get incremented according to the nesting order, such that the count of the last Effect goes up by one count.
    void
    initializes the variables used for stepping (incrementing) through Facet indices.
    getter of total score count.
    static String
    padRight(String s, int n)
     
    void
    reset all Facet indices and iarCurrentIndexSet.
    sDump(String[] sar)
    utility to format string array for text output.
    void
    setArrays(String _sDictionary)
    Establishes the structural arrays.
    void
    setAsterisk(char _cAsterisk)
    sets the char for the starred Facet
    void
    setConfigurations(String[] _sarConfigs)
    1D String array with syntax od design
    void
    setCrossed(char _c, Boolean _bCrossed)
    Setter for Facet 'bCrossed' status (vs bNested).
    void
    calculates total number of possible states for each Facet
    void
    setDepths(int[] _iarDepths)
    Setter of facet number of states
    void
    setDictionary(String _sDictionary)
    setter for sDictionary
    void
    setFacetCount(int _iFacetCount)
    setter of FacetCount and indices array establishment.
    void
    setFacets(Facet[] _farFacets)
    Setter for facet array.
    void
    setHDictionary(String _sHDictionary)
    setter for sHDictionary
    void
    setHIndex(char c, int iIndex)
    setter of Facet indices by Facet designation char (the order in which the Facet indices step through the score data file)
    void
    setNests(String[] _sarNested)
    assign appropriate array of primary nests to sarNests
    void
    setProducts(String[][] _sarProducts)
    Setter for 2D String array containing project design
    size(Integer _iPointer)
    cumulative sample size per Facet.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SampleSizeTree

      public SampleSizeTree(Nest _nest, gsLogger _logger, Preferences _prefs)
      Constructor for SampleSizeTree
      Parameters:
      _nest - pointer to Nest
      _logger - pointer to org.gs_users.gs_lv.GS_Application logger
      _prefs - pointer to Preferences
  • Method Details

    • setDictionary

      public void setDictionary(String _sDictionary)
      setter for sDictionary
      Parameters:
      _sDictionary - String of all Facet designation chars in original order.
    • setHDictionary

      public void setHDictionary(String _sHDictionary)
      setter for sHDictionary
      Parameters:
      _sHDictionary - String of all Facet designation chars in hierarchic order.
    • addSampleSize

      public void addSampleSize(int _iFacet, int[] sss)
      This method runs when sample sizes are entered. sums and cumuls are calculated when a facet is added by facet number (original).
      Parameters:
      _iFacet - basic index to facet
      sss - array of integer sample sizes for a specifies facet
    • addSampleSize

      public void addSampleSize(char _c, String[] sss)
      This method runs when sample sizes are entered. sums and cumuls are calculated when a facet is added by facet Designation char.
      Parameters:
      _c - Facet char designation
      sss - string array of sample sizes as text
    • setCrossed

      public void setCrossed(char _c, Boolean _bCrossed)
      Setter for Facet 'bCrossed' status (vs bNested).
      Parameters:
      _c - Facet designation char
      _bCrossed - flag that Facet is crossed (vs nested)
    • setNests

      public void setNests(String[] _sarNested)
      assign appropriate array of primary nests to sarNests
      Parameters:
      _sarNested - external string array
    • getPage

      public javafx.scene.layout.VBox getPage(Integer _iSample)
      composes JavaFX code page (vBox to collect sample sizes for a nested Facet.
      Parameters:
      _iSample - index to nested Facet (corresponds to order in script)
      Returns:
      vBox
    • getSamples

      public void getSamples(char _cFacet)
      intializes Facet
      Parameters:
      _cFacet - facet designation char
    • getEffect

      public String getEffect(Integer iRow)
      getter of 'Effect Size', i.e. the sample sizes for a Facet according of its 'Nestor', if any. 'Crossed' Facets only have one sample size.
      Parameters:
      iRow - Facet position in original order.
      Returns:
      String containing one or more sample size values
    • getNest

      public String getNest(char _c)
      getter of primary nested configuration of Facets (as in script).
      Parameters:
      _c - Facet designation char
      Returns:
      nested configuration of Facet
    • padRight

      public static String padRight(String s, int n)
      Parameters:
      s - original text
      n - number of spaces to pad
      Returns:
      padded text
    • hasChanged

      public void hasChanged(Integer _iLevel, Integer _iPointer, Integer _value)
      updater of sample size arrays accumulations
      Parameters:
      _iLevel - Facet position in original order
      _iPointer - pointer to each of the individual sample sizes for this Facet
      _value - actual value of the sample size
    • DoOver

      public void DoOver(Boolean _bDoOver)
      setter of 'doOver' flag (use script)
      Parameters:
      _bDoOver - boolean flag
    • numRecords

      public Integer numRecords()
      getter of total score count.
      Returns:
      iRecordCount total number of scores
    • getIndex

      public String getIndex(Integer _iFacet, Integer _iPointer)
      current Facet index in nested environment
      Parameters:
      _iFacet - integer facet pointer (original order)
      _iPointer - offset according to 'Nestor'
      Returns:
      Facet index
    • size

      public Integer size(Integer _iPointer)
      cumulative sample size per Facet.
      Parameters:
      _iPointer - Facet as Integer in original order
      Returns:
      total sample size for Facet
    • getSizes

      public int[] getSizes(char c)
      returns sample size array by Facet designation char
      Parameters:
      c - Facet designation char
      Returns:
      sample size array
    • getOSizes

      public int[] getOSizes(Integer iOrder)
      returns sample size array according to the position of the Facet in the original order
      Parameters:
      iOrder - position of Facet in original order
      Returns:
      sample size array
    • getHSizes

      public int[] getHSizes(Integer iHOrd)
      returns sample size array according to the position of the Facet in the hierarchic order
      Parameters:
      iHOrd - Facet position in hierarchic order
      Returns:
      sample size array
    • getSums

      public int[] getSums(char c)
      getter of sample size sums per Facet by Facet designation char for Analysis.
      Parameters:
      c - Facet designation char
      Returns:
      cumulative sample size per Facet
    • getMaxSum

      public int getMaxSum(char _cF)
      Total number of states for Facet cF
      Parameters:
      _cF - designation char for facet
      Returns:
      total number of possible states for facet
    • getOSums

      public int[] getOSums(Integer _iOrd)
      getter of sample size sums per Facet by position in original order for Analysis.
      Parameters:
      _iOrd - Facet position in original order
      Returns:
      cumulative sample size per Facet
    • getHSums

      public int[] getHSums(Integer _iHOrd)
      getter of sample size sums per Facet by position in hierarchic order for Analysis.
      Parameters:
      _iHOrd - Facet position in hierarchic order
      Returns:
      cumulative sample size per Facet
    • getLevel

      public Double getLevel(Integer _iFacet)
      Arithmetic mean of sample size per Facet in nested context, according to Brennan for calculation of G coefficients.
      Parameters:
      _iFacet - position of Facet in original order
      Returns:
      arithmetic mean of Sample Size per Facet
    • getHarmonic

      public Double getHarmonic(Integer _iFacet)
      Harmonic mean of sample sizes per Facet in nested context, according to Brennan for calculation of G coefficients.
      Parameters:
      _iFacet - position of Facet in original order
      Returns:
      harmonic mean of Sample Size per Facet
    • collectSampleSizes

      public void collectSampleSizes()
      utility for setting up Sample Size Page
    • setAsterisk

      public void setAsterisk(char _cAsterisk)
      sets the char for the starred Facet
      Parameters:
      _cAsterisk - char of Facet carrying Asterisk
    • increment

      public Boolean increment()
      Incrementer for simulation for each call the Facet indices get incremented according to the nesting order, such that the count of the last Effect goes up by one count. The 'Effect' corresponding to the residual variance component gets split into its factors. The indices are then incremented separately for each factor in the appropriate order by the recursive method 'bClimb'.
      Returns:
      false when all Facet indices have reached their maximum, true otherwise
    • getHIndex

      public int getHIndex(char c)
      getter of Facet indices by Facet designation char (the order in which the Facet indices step through the score data file)
      Parameters:
      c - Facet designation char
      Returns:
      Facet index for that Facet
    • setHIndex

      public void setHIndex(char c, int iIndex)
      setter of Facet indices by Facet designation char (the order in which the Facet indices step through the score data file)
      Parameters:
      c - Facet designation char
      iIndex - Facet index for that Facet
    • resetIndices

      public void resetIndices()
      reset all Facet indices and iarCurrentIndexSet.
    • getIndices

      public int[] getIndices()
      getter of all Facet indices
      Returns:
      int array of Facet indices
    • setFacetCount

      public void setFacetCount(int _iFacetCount)
      setter of FacetCount and indices array establishment.
      Parameters:
      _iFacetCount - number of facets
    • getConfiguration

      public String getConfiguration(int _iConfig)
      getter of Effects, both primary (per Facet) and cross-interactions.
      Parameters:
      _iConfig - index of Effect
      Returns:
      Effect string (ordered, nested Facet chars)
    • setConfigurations

      public void setConfigurations(String[] _sarConfigs)
      1D String array with syntax od design
      Parameters:
      _sarConfigs - design syntax
    • setProducts

      public void setProducts(String[][] _sarProducts)
      Setter for 2D String array containing project design
      Parameters:
      _sarProducts - 2D String array containing project design
    • sDump

      public String sDump(String[] sar)
      utility to format string array for text output.
      Parameters:
      sar - generic String array
      Returns:
      formatted text String
    • getConfigurationCount

      public int getConfigurationCount()
      getter of Effect count (primary and cross-interactions).
      Returns:
      int count
    • initCounter

      public void initCounter()
      initializes the variables used for stepping (incrementing) through Facet indices.
    • getFacet

      public Facet getFacet(char _c)
      getter of Facet by designation char.
      Parameters:
      _c - Facet designation char
      Returns:
      Facet corresponding to _c
    • consolidateSplits

      public void consolidateSplits()
      utility converts Factor string array lists to string arrays
    • getCount

      public int getCount(int iConf)
      getter of current state in 'Effect'.
      Parameters:
      iConf - pointer to 'Effect'
      Returns:
      int current state of 'Effect', less than iarDepth
    • getSize

      public int getSize(int iConf)
      getter of maximal state count of 'Effect' as product of Factors.
      Parameters:
      iConf - int pointer to 'Effect'
      Returns:
      int maximal number of states for an 'Effect', when Facet indices go through all combinations.
    • getOffset

      public int getOffset(char _cFacet, int _iPointer)
      getter of index offset in nested Facets resulting from the 'Nestor's' index.
      Parameters:
      _cFacet - Facet designation char
      _iPointer - index of 'Nestor'
      Returns:
      sum of sample sizes less than iPointer
    • getDictionary

      public String getDictionary()
      getter of Facet dictionary in original order
      Returns:
      sDictionary String
    • getDim

      public int getDim(char _c)
      total number of states per Facet (Analysis)
      Parameters:
      _c - Facet designation char
      Returns:
      total number of states
    • getDepth

      public int getDepth(int _iC)
      getter of iarDepth by "Effect' pointer.
      Parameters:
      _iC - pointer to 'Effect' (Configuration)
      Returns:
      int maximal number of states per 'Effect'
    • getDepth

      public int getDepth(char cF)
      Getter of iarDepth by facet character
      Parameters:
      cF - char of 'Effect' facet
      Returns:
      int maximal number of states per 'Effect'
    • setDepths

      public void setDepths()
      calculates total number of possible states for each Facet
    • setDepths

      public void setDepths(int[] _iarDepths)
      Setter of facet number of states
      Parameters:
      _iarDepths - facet number of states
    • completeOffsets

      public void completeOffsets()
      completes sizeArray offsets from size array
    • setFacets

      public void setFacets(Facet[] _farFacets)
      Setter for facet array.
      Parameters:
      _farFacets - facet array
    • setArrays

      public void setArrays(String _sDictionary)
      Establishes the structural arrays.
      Parameters:
      _sDictionary - string of facets
    • iGetRepFactor

      public int iGetRepFactor(char _cReplicate)
      Calculates the number of fixed scores presenting for each replication
      Parameters:
      _cReplicate - designation of replicating facet
      Returns:
      number of fixed scores per replication
    • dumpArray

      public String dumpArray(int[] array)
      utility to convert int array to text string
      Parameters:
      array - arbitrary int array
      Returns:
      formatted text
    • completeSSS

      public void completeSSS()