Learn R Programming

afex (version 0.22-1)

afex_options: Set/get global afex options

Description

Global afex options are used, for example, by aov_car (et al.) and mixed. But can be changed in each functions directly using an argument (which has precedence over the global options).

Usage

afex_options(...)

Arguments

...

One of four: (1) nothing, then returns all options as a list; (2) a name of an option element, then returns its' value; (3) a name-value pair which sets the corresponding option to the new value (and returns nothing), (4) a list with option-value pairs which sets all the corresponding arguments. The example show all possible cases.

Value

depends on input, see above.

Details

The following arguments are currently set:

  • check_contrasts should contrasts be checked and changed to sum-to-zero contrasts? Default is TRUE.

  • type type of sums-of-squares to be used for testing effects, default is 3 which reports Type 3 tests.

  • method_mixed: Method used to obtain p-values in mixed, default is "KR" (which will change to "LRT" soon). (mixed() only)

  • return_aov: Return value of the ANOVA functions (see aov_car), default is "nice".

  • es_aov: Effect size reported for ANOVAs (see aov_car), default is "ges" (generalized eta-squared).

  • correction_aov: Correction used for within-subjects factors with more than two levels for ANOVAs (see aov_car or nice), default is "GG" (Greenhouse-Geisser correction). (ANOVA functions only)

  • factorize: Should between subject factors be factorized (with note) before running the analysis? Default is TRUE. (ANOVA functions only)

  • sig_symbols: Default significant symbols used for ANOVA and mixed printing. Default isc(" +", " *", " **", " ***").

  • lmer_function: Which lmer function should mixed or lmer_alt use. The default is "lmerTest" which uses lmer, "lme4" is also possible which uses lmer. Note that mixed methods "KR" and "S" only work with "lmerTest". For the other methods, "lme4" could be minimally faster, but does not allow to use lmerTest::anova().

Examples

Run this code
# NOT RUN {
afex_options() # see all options

afex_options("return_aov") #get single option

aop <- afex_options() # save current options

# }
# NOT RUN {
# change options
afex_options(return_aov = "nice")
afex_options("return_aov") #get single option
afex_options(return_aov = "nice", method_mixed = "LRT")
afex_options("method_mixed") #get single option
# do something
# }
# NOT RUN {
afex_options(aop) # reset options

# }

Run the code above in your browser using DataLab