Description Usage Arguments Details Value Warnings Author(s) See Also Examples
This function provides easy computation of descriptive statistics (between-Ss means, between-Ss SD, Fisher's Least Significant Difference) for data from factorial experiments, including purely within-Ss designs (a.k.a. “repeated measures”), purely between-Ss designs, and mixed within-and-between-Ss designs.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
data |
Data frame containing the data to be analyzed. |
dv |
Name of the column in |
wid |
Name of the column in |
within |
Names of columns in |
within_full |
Same as within, but intended to specify the full within-Ss design in cases where the data have not already been collapsed to means per condition specified by |
within_covariates |
Names of columns in |
between |
Names of columns in |
between_full |
Same as |
between_covariates |
Names of columns in |
diff |
Names of any variables to collapse to a difference score. If a single value, may be specified by name alone; if multiple values, must be specified as a .() list. All supplied variables must be factors, ideally with only two levels (especially if setting the |
reverse_diff |
Logical. If TRUE, triggers reversal of the difference collapse requested by |
type |
Numeric value (either |
check_args |
Users should leave this as its default (TRUE) value. This argument is intended for internal use only. |
ANCOVA is implemented by first regressing the DV against each covariate (after collapsing the data to the means of that covariate's levels per subject) and subtracting from the raw data the fitted values from this regression (then adding back the mean to maintain scale). These regressions are computed across Ss in the case of between-Ss covariates and computed within each Ss in the case of within-Ss covariates.
Fisher's Least Significant Difference is computed as sqrt(2)*qt(.975,DFd)*sqrt(MSd/N), where N is taken as the mean N per group in cases of unbalanced designs.
A data frame containing the descriptive statistics for the requested effect. N = number of Ss per cell. Mean = between-Ss mean. SD = between-Ss SD. FLSD = Fisher's Least Significant Difference.
Prior to running (though after obtaining running ANCOVA regressions as described in the details
section), dv
is collapsed to a mean for each cell defined by the combination of wid
and any variables supplied to within
and/or between
and/or diff
. Users are warned that while convenient when used properly, this automatic collapsing can lead to inconsistencies if the pre-collapsed data are unbalanced (with respect to cells in the full design) and only the partial design is supplied to ezANOVA
. When this is the case, use within_full
to specify the full design to ensure proper automatic collapsing.
The descriptives include Fisher's Least Significant Difference for the plotted effect, facilitating visual post-hoc multiple comparisons. To obtain accurate FLSDs when only a subset of the full between-Ss design is supplied to between
, the full design must be supplied to between_full
. Also note that in the context of mixed within-and-between-Ss designs, the computed FLSD values can only be used for within-Ss comparisons.
Michael A. Lawrence mike.lwrnc@gmail.com
Visit the ez
development site at http://github.com/mike-lawrence/ez
for the bug/issue tracker and the link to the mailing list.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | #Read in the ANT data (see ?ANT).
data(ANT)
head(ANT)
ezPrecis(ANT)
#Run an ANOVA on the mean correct RT data.
mean_rt_anova = ezANOVA(
data = ANT[ANT$error==0,]
, dv = rt
, wid = subnum
, within = .(cue,flank)
, between = group
)
#Show the ANOVA and assumption tests.
print(mean_rt_anova)
#Compute descriptives for the main effect of group.
group_descriptives = ezStats(
data = ANT[ANT$error==0,]
, dv = rt
, wid = subnum
, between = .(group)
)
#Show the descriptives.
print(group_descriptives)
|
subnum group block trial cue flank location direction rt
1 1 Treatment 1 1 None Neutral up left 398.6773
2 1 Treatment 1 2 Center Neutral up left 389.1822
3 1 Treatment 1 3 Double Neutral up left 333.2186
4 1 Treatment 1 4 Spatial Neutral up left 419.7640
5 1 Treatment 1 5 None Congruent up left 446.4754
6 1 Treatment 1 6 Center Congruent up left 338.9766
error
1 0
2 0
3 0
4 0
5 0
6 0
Data frame dimensions: 5760 rows, 10 columns
type missing values min max
subnum factor 0 20 1 20
group factor 0 2 Control Treatment
block numeric 0 6 1 6
trial numeric 0 48 1 48
cue factor 0 4 None Spatial
flank factor 0 3 Neutral Incongruent
location factor 0 2 down up
direction factor 0 2 left right
rt numeric 0 5760 179.5972 657.6986
error numeric 0 2 0 1
Warning: Collapsing data to cell means. *IF* the requested effects are a subset of the full design, you must use the "within_full" argument, else results may be inaccurate.
$ANOVA
Effect DFn DFd F p p<.05 ges
2 group 1 18 18.430592 4.377562e-04 * 0.07633358
3 cue 3 54 516.605213 1.005518e-39 * 0.89662286
5 flank 2 36 1350.598810 1.386546e-34 * 0.92710583
4 group:cue 3 54 2.553236 6.497492e-02 0.04110445
6 group:flank 2 36 8.768499 7.900829e-04 * 0.07627434
7 cue:flank 6 108 5.193357 9.938494e-05 * 0.11436699
8 group:cue:flank 6 108 6.377225 9.012515e-06 * 0.13686958
$`Mauchly's Test for Sphericity`
Effect W p p<.05
3 cue 0.7828347 0.5366835
4 group:cue 0.7828347 0.5366835
5 flank 0.8812738 0.3415406
6 group:flank 0.8812738 0.3415406
7 cue:flank 0.1737053 0.1254796
8 group:cue:flank 0.1737053 0.1254796
$`Sphericity Corrections`
Effect GGe p[GG] p[GG]<.05 HFe p[HF]
3 cue 0.8652559 1.115029e-34 * 1.0239520 1.005518e-39
4 group:cue 0.8652559 7.472046e-02 1.0239520 6.497492e-02
5 flank 0.8938738 3.763312e-31 * 0.9858964 3.964046e-34
6 group:flank 0.8938738 1.297752e-03 * 0.9858964 8.438369e-04
7 cue:flank 0.6022111 1.546166e-03 * 0.7721473 4.745714e-04
8 group:cue:flank 0.6022111 3.424499e-04 * 0.7721473 7.170939e-05
p[HF]<.05
3 *
4
5 *
6 *
7 *
8 *
Warning: Collapsing data to cell means. *IF* the requested effects are a subset of the full design, you must use the "within_full" argument, else results may be inaccurate.
Coefficient covariances computed by hccm()
group N Mean SD FLSD
1 Control 10 410.2575 3.436650 2.973601
2 Treatment 10 404.1686 2.867476 2.973601
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.