ez.anovas1b: anova or ancova 1b, aov(y~x+covar), for many y and/or many x

View source: R/stats.R

ez.anovas1bR Documentation

anova or ancova 1b, aov(y~x+covar), for many y and/or many x

Description

anova or ancova 1b, aov(y~x+covar), for many y and/or many x

Usage

ez.anovas1b(
  df,
  y,
  x = NULL,
  covar = NULL,
  report = T,
  reportF = F,
  view = F,
  plot = F,
  cols = 3,
  pmethods = c("bonferroni", "fdr"),
  point.size = 10,
  point.shape = 16,
  lab.size = 18,
  text.size = 16,
  error = T,
  prefix = 2,
  pe = F,
  ...
)

Arguments

df

a data frame, Internally go through dropna –> ez.2value(y),ez.2factor(x),ez.2value(covar)

y

compatible with ez.selcol, or y could be cmd from ez.barplot where not necessary to specify x, covar. y|x or y|x+covar, y~x or y~x+covar. cmd format can only handel 1 y, 1 x (and covars)

x

compatible with ez.selcol

covar

NULL=no covar, compatible with ez.selcol

view

call View(result)

plot

T/F, the black dash line is bonferroni p = 0.05 (again for tests only with a non-NA p values), the grey black dash is uncorrected p = 0.05

cols

number of columns for multiplot. NULL=auto calculate

pmethods

c('bonferroni','fdr'), type p.adjust.methods for all methods. This correction applies for all possible tests that have been/could be done.

error

whether show error message when error occurs (also result will have an empty row when error occurs)

Value

an invisible data frame or list of data frame (if many y and many x)
the means column in excel can be split into mulitiple columns using Data >Text to Columns
dof: from F-statistic

Note

In R, aov for 1- or mutiple- way (use : * syntax to include interactions–not implemented in this function yet) between anova, it takes the output from lm and returns it to us in a way that is more in keeping with a traditional ANOVA approach.

Anova calculates type-II or type-III analysis-of-variance tables for model objects. Also, anova analyses the result of a model, producing type I (sequential) ANOVA table.

Within and mixed anova use lme, because Repeated-measures designs have dependent data, therefore dependent residuals, which can be handled by nlme::lme

Eta squared measures the proportion of the total variance in a dependent variable Y that can be accounted for by knowledge of X (ie, the membership of different groups defined by an independent variable). For one-way anova, eta squared is the same as partial eta squared, and the same as R2 (these are true only for one-way anova, not the case for ancova or two-way anova). Eta squared is analogous to R2 in lm. Both are biased and have the weakness that each adding additional variable will automatically increase the value of Eta squared or R2. Eta squared for factor1 = SSfactor1/SStotal, where SStotal = SSfactor1 + SSfactor2 + SSinteraction + SSerror

Partial eta squared is a similar measure in which the effects of other independent variables and interactions are partialled out (ie, the proportion of variance that a variable explains that is not explained by other variables in the analysis). Partial Eta squared for factor1 = SSfactor1/(SSfactor1+SSerror)

If covariates provided, adjusted means with SD, partial eta squared. Otherwise, raw mean SD, and (partial) eta squared. se=sd/sqrt(n)

posthoc results are very close to spss output, but may have tiny differences (e.g., R .304 vs. SPSS .310)


jerryzhujian9/ezmisc documentation built on March 9, 2024, 12:44 a.m.