From da4be85724a72ee6bb3fcc03c46f79e3a50b389d Mon Sep 17 00:00:00 2001 From: singmann Date: Tue, 11 Apr 2017 22:24:55 +0200 Subject: [PATCH] updates to documentation --- DESCRIPTION | 4 ++-- R/afex-package.R | 4 ++-- dev.R | 2 +- examples/examples.aov_car.R | 13 ++++++------- examples/examples.mixed.R | 7 +++++++ man/afex-package.Rd | 4 ++-- man/afex_aov-methods.Rd | 2 +- man/aov_car.Rd | 15 +++++++-------- man/mixed.Rd | 11 ++++++++++- man/nice.Rd | 3 ++- 10 files changed, 40 insertions(+), 25 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 3b56c9b..be176f7 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -29,6 +29,6 @@ Authors@R: c(person(given="Henrik", family="Singmann", role=c("aut", "cre"), A.", family="Lawrence", role=c("ctb")), person(given="Ulf", family="Mertens", role=c("ctb")), person(given="Jonathan", family="Love", role=c("ctb")) ) -Version: 0.17-7 -Date: 2017-04-07 +Version: 0.17-8 +Date: 2017-04-11 RoxygenNote: 6.0.1 diff --git a/R/afex-package.R b/R/afex-package.R index d1ad73c..bc9584f 100644 --- a/R/afex-package.R +++ b/R/afex-package.R @@ -3,8 +3,8 @@ #' \tabular{ll}{ #' Package: \tab afex\cr #' Type: \tab Package\cr -#' Version: \tab 0.17-7\cr -#' Date: \tab 2017-04-07\cr +#' Version: \tab 0.17-8\cr +#' Date: \tab 2017-04-11\cr #' Depends: \tab R (>= 3.1.0), lme4 (>= 1.1-8), lsmeans (>= 2.17)\cr #' Encoding: \tab UTF-8\cr #' License: \tab GPL (>=2)\cr diff --git a/dev.R b/dev.R index 1757bec..b45ed61 100644 --- a/dev.R +++ b/dev.R @@ -37,7 +37,7 @@ R.libs <- "./packages/library" closeAllConnections() roxy.package( pck.source.dir = pkg.src.dir, - pck.version = "0.17-7", + pck.version = "0.17-8", pck.description = data.frame( Package = "afex", Type = "Package", diff --git a/examples/examples.aov_car.R b/examples/examples.aov_car.R index 9033e87..9527f5b 100644 --- a/examples/examples.aov_car.R +++ b/examples/examples.aov_car.R @@ -152,13 +152,12 @@ obk_anova <- aov_car(value ~ treatment * gender + Error(id/(phase*hour)), # in contrast to aov you do not need the within-subject factors outside Error() str(obk_anova, 1, give.attr = FALSE) -## List of 6 -## $ anova_table:Classes 'anova' and 'data.frame': 15 obs. of 6 variables: -## $ aov :List of 5 -## $ Anova :List of 14 -## $ lm :List of 13 -## $ data :List of 3 -## $ information:List of 5 +# List of 5 +# $ anova_table:Classes ‘anova’ and 'data.frame': 15 obs. of 6 variables: +# $ aov :List of 5 +# $ Anova :List of 14 +# $ lm :List of 13 +# $ data :List of 3 obk_anova$Anova ## Type II Repeated Measures MANOVA Tests: Pillai test statistic diff --git a/examples/examples.mixed.R b/examples/examples.mixed.R index cc9a8c5..c59c817 100644 --- a/examples/examples.mixed.R +++ b/examples/examples.mixed.R @@ -167,6 +167,11 @@ data(lexdec, package = "languageR") m1 <- mixed(RT ~ Correct + Trial + PrevType * meanWeight + Frequency + NativeLanguage * Length + (1|Subject) + (1|Word), data = lexdec) m1 +# Mixed Model Anova Table (Type 3 tests, KR-method) +# +# Model: RT ~ Correct + Trial + PrevType * meanWeight + Frequency + NativeLanguage * +# Model: Length + (1 | Subject) + (1 | Word) +# Data: lexdec # Effect df F p.value # 1 Correct 1, 1627.73 8.15 ** .004 # 2 Trial 1, 1592.43 7.57 ** .006 @@ -177,6 +182,8 @@ m1 # 7 Length 1, 75.83 8.70 ** .004 # 8 PrevType:meanWeight 1, 1601.18 6.18 * .01 # 9 NativeLanguage:Length 1, 1555.49 14.24 *** .0002 +# --- +# Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘+’ 0.1 ‘ ’ 1 # Fitting a GLMM using parametric bootstrap: require("mlmRev") # for the data, see ?Contraception diff --git a/man/afex-package.Rd b/man/afex-package.Rd index 7792583..6e65e16 100644 --- a/man/afex-package.Rd +++ b/man/afex-package.Rd @@ -11,8 +11,8 @@ Analysis of Factorial Experiments. \tabular{ll}{ Package: \tab afex\cr Type: \tab Package\cr -Version: \tab 0.17-7\cr -Date: \tab 2017-04-07\cr +Version: \tab 0.17-8\cr +Date: \tab 2017-04-11\cr Depends: \tab R (>= 3.1.0), lme4 (>= 1.1-8), lsmeans (>= 2.17)\cr Encoding: \tab UTF-8\cr License: \tab GPL (>=2)\cr diff --git a/man/afex_aov-methods.Rd b/man/afex_aov-methods.Rd index a9ccb28..54ad496 100644 --- a/man/afex_aov-methods.Rd +++ b/man/afex_aov-methods.Rd @@ -12,7 +12,7 @@ \method{anova}{afex_aov}(object, es = afex_options("es_aov"), observed = NULL, correction = afex_options("correction_aov"), MSE = TRUE, intercept = FALSE, p_adjust_method = NULL, - sig_symbols = afex_options("sig_symbols"), ...) + sig_symbols = attr(object$anova_table, "sig_symbols"), ...) \method{print}{afex_aov}(x, ...) diff --git a/man/aov_car.Rd b/man/aov_car.Rd index d11766f..dc77998 100644 --- a/man/aov_car.Rd +++ b/man/aov_car.Rd @@ -43,7 +43,7 @@ aov_4(formula, data, observed = NULL, fun_aggregate = NULL, type = afex_options( \item{observed}{\code{character} vector indicating which of the variables are observed (i.e, measured) as compared to experimentally manipulated. The default effect size reported (generalized eta-squared) requires correct specification of the obsered (in contrast to manipulated) variables.} -\item{anova_table}{\code{list} of further arguments passed to function producing the ANOVA table. Arguments such as \code{es} (effect size) or \code{correction} are passed to either \code{anova.afex_aov} or \code{nice}. \code{sig_symbols} is currently ignored. Note that those settings can also be changed once an object of class \code{afex_aov} is created by invoking the \code{anova} method directly.} +\item{anova_table}{\code{list} of further arguments passed to function producing the ANOVA table. Arguments such as \code{es} (effect size) or \code{correction} are passed to either \code{anova.afex_aov} or \code{nice}. Note that those settings can also be changed once an object of class \code{afex_aov} is created by invoking the \code{anova} method directly.} \item{...}{Further arguments passed to \code{fun_aggregate}.} @@ -288,13 +288,12 @@ obk_anova <- aov_car(value ~ treatment * gender + Error(id/(phase*hour)), # in contrast to aov you do not need the within-subject factors outside Error() str(obk_anova, 1, give.attr = FALSE) -## List of 6 -## $ anova_table:Classes 'anova' and 'data.frame': 15 obs. of 6 variables: -## $ aov :List of 5 -## $ Anova :List of 14 -## $ lm :List of 13 -## $ data :List of 3 -## $ information:List of 5 +# List of 5 +# $ anova_table:Classes ‘anova’ and 'data.frame': 15 obs. of 6 variables: +# $ aov :List of 5 +# $ Anova :List of 14 +# $ lm :List of 13 +# $ data :List of 3 obk_anova$Anova ## Type II Repeated Measures MANOVA Tests: Pillai test statistic diff --git a/man/mixed.Rd b/man/mixed.Rd index 16bf63c..cb7f525 100644 --- a/man/mixed.Rd +++ b/man/mixed.Rd @@ -11,7 +11,7 @@ mixed(formula, data, type = afex_options("type"), args_test = list(), test_intercept = FALSE, check_contrasts = afex_options("check_contrasts"), expand_re = FALSE, all_fit = FALSE, set_data_arg = TRUE, progress = TRUE, cl = NULL, - return = "mixed", ...) + return = "mixed", sig_symbols = afex_options("sig_symbols"), ...) lmer_alt(formula, data, check_contrasts = FALSE, ...) } @@ -44,6 +44,8 @@ lmer_alt(formula, data, check_contrasts = FALSE, ...) \item{return}{the default is to return an object of class \code{"mixed"}. \code{return = "merMod"} will skip the calculation of all submodels and p-values and simply return the full model fitted with lmer. Can be useful in combination with \code{expand_re = TRUE} which allows to use "||" with factors. \code{return = "data"} will not fit any models but just return the data that would have been used for fitting the model (note that the data is also part of the returned object).} +\item{sig_symbols}{Character. What should be the symbols designating significance? When entering an vector with \code{length(sig.symbol) < 4} only those elements of the default (\code{c(" +", " *", " **", " ***")}) will be replaced. \code{sig_symbols = ""} will display the stars but not the \code{+}, \code{sig_symbols = rep("", 4)} will display no symbols. The default is given by \code{afex_options("sig_symbols")}.} + \item{...}{further arguments (such as \code{weights}/\code{family}) passed to \code{\link{lmer}}/\code{\link{glmer}}, such as \code{control}.} } \value{ @@ -309,6 +311,11 @@ data(lexdec, package = "languageR") m1 <- mixed(RT ~ Correct + Trial + PrevType * meanWeight + Frequency + NativeLanguage * Length + (1|Subject) + (1|Word), data = lexdec) m1 +# Mixed Model Anova Table (Type 3 tests, KR-method) +# +# Model: RT ~ Correct + Trial + PrevType * meanWeight + Frequency + NativeLanguage * +# Model: Length + (1 | Subject) + (1 | Word) +# Data: lexdec # Effect df F p.value # 1 Correct 1, 1627.73 8.15 ** .004 # 2 Trial 1, 1592.43 7.57 ** .006 @@ -319,6 +326,8 @@ m1 # 7 Length 1, 75.83 8.70 ** .004 # 8 PrevType:meanWeight 1, 1601.18 6.18 * .01 # 9 NativeLanguage:Length 1, 1555.49 14.24 *** .0002 +# --- +# Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘+’ 0.1 ‘ ’ 1 # Fitting a GLMM using parametric bootstrap: require("mlmRev") # for the data, see ?Contraception diff --git a/man/nice.Rd b/man/nice.Rd index ca5c68a..f365e97 100644 --- a/man/nice.Rd +++ b/man/nice.Rd @@ -21,7 +21,8 @@ nice(object, ...) \method{nice}{anova}(object, MSE = NULL, intercept = NULL, sig_symbols = attr(object, "sig_symbols"), sig.symbols, ...) -\method{nice}{mixed}(object, sig_symbols = afex_options("sig_symbols"), ...) +\method{nice}{mixed}(object, sig_symbols = attr(object$anova_table, + "sig_symbols"), ...) \method{print}{nice_table}(x, ...) }