Skip to content

Class `effectsize_table`

Mattan S. Ben-Shachar edited this page Sep 20, 2022 · 2 revisions

Function inputs and outputs

Inputs

  1. If that function computes the effect size from raw data, the input options should match those of the corresponding htest function. For example, any input to t.test() can be used as input to cohens_d() and it will generate the corresponding effect size for that t-test.

  2. Other inputs for adjusting the effect size computation (e.g., pooled_sd in cohens_d()).

  3. All functions should have the option to estimate CIs

    • Preferably using an analytical method (ncp or normal appriximation), but if there isn't a well established one, can use percentile bootstrapping with the {boot} package, and a iterations set by the user (default to 200).
    • For ncp methods, see the internal .get_ncp_t .get_ncp_F and .get_ncp_chi functions.
    • if ci = NULL in input, no CI should be returned.
  4. CIs should be defined according to alternative argument, which should be one of c("two.sided", "greater", "less"):

    • For two directional effect sizes, default to "two.sided"
    • For uni-directional effect sizes, default to "greater"
    • One-sided CIs should have the non-estimated bound set by the function.
  5. verbose (default to TRUE) for toggling warnings / messages.

  6. For effect size of 2 sample differences: mu value of the null.

Output

Columns

All effectsize_tables are data frames, with the following columns, in this order:

  • Response, Parameter or other (optional) - column(s) that adds information required to identify the the effect size.
  • The effect size - the column name is the name of the effect size. See is_effectsize_name() and the internal es_info data frame.
  • CI (optional) - ci level.
  • CI_low (optional) - lb of CI.
  • CI_high (optional) - ub of CI.

Attributes

The classes are: c("effectsize_table", "see_effectsize_table", "data.frame").

The following attributes are mandatory:

  • ci [numeric] or NULL
  • ci_method - a [list] with:
    • method - the name of the method ("ncp", "normal", "percentile bootstrap")
    • Other information relevant to the method. E.g., list(method = "ncp", distribution = "F"), list(method = "bootstrap", iterations = iterations)
  • alternative [character]
  • approximate [logical]: is the effect size itself only an approximate? E.g., all the F_to_* function have this set to TRUE. Some of the eta_square() options / models set this to FALSE.

Can also add table_footer [character] with any additional information to be presented to the user when printing. Use sparingly.

Case specific attributes

  • For ANOVA effect sizes (see API):

    • generalized [character] - vector of names of effects generalized over. Can also be TRUE if generalized over all.
    • anova_type [numeric] - 1, 2 or 3 for the type of ANOVA table the effects are based on.
  • For effect size of 2 sample differences

    1. Add the effectsize_difference class
    2. Add the following attributes:
      • mu [numeric] - the value used for the null.
      • paired: [logical] for the two sample case, was it paired? For the the one-sample case, NULL.
      • pooled_sd / pooled_cov [logical]: for the two sample case, was a pooled SD used?
Clone this wiki locally