Learn R Programming

rpsychi (version 0.3)

dep.oneway.second: A one-way design with dependent samples using published work

Description

dep.oneway.second conducts a one-way design with dependent samples, namely one-way repeated-measures analysis of variance, using published work.

Usage

dep.oneway.second(m, sd, n, corr, 
            unbiased = TRUE, contr = NULL, sig.level = 0.05, digits = 3)

Arguments

m
a numeric vector contains the means (length(m) >= 2)
sd
a numeric vector contains the sample/unbiased standard deviations (length(sd) >= 2)
n
a numeric contains the sample size (length(n) >= 2)
corr
a matrix or data frame contains the correlation matrix
unbiased
sd contains unbiased standard deviations (unbiased = TRUE, default) or sample standard deviations (unbiased = FALSE)
contr
a matrix or vector contains the contrast weights
sig.level
a numeric contains the significance level (default 0.05)
digits
the specified number of decimal places (default 3)

Value

  • The returned object of dep.oneway.second contains the following components:
  • anova.tablereturns a ANOVA table containing sums of squares, degrees of freedom, mean squares, $F$ values, and a $p$ value
  • omnibus.esreturns a omnibus effect size which is a partial $\eta^2$
  • raw.contrastsreturns raw mean differences, their confidence intervals, and standard errors
  • standardized.contrastsreturns standardized mean differences for the contrasts (Hedges's $g$) and their approximate confidence intervals for population standardized mean differences

encoding

UTF-8

Details

This function conducts a one-way design with dependent samples, namely one-way repeated-measures analysis of variance, using published work. If you do not specify contr, all possible pairwise contrasts will be calculated.

References

Kline RB (2004) Beyond significance testing: Reforming data analysis methods in behavioral research. Washington: American Psychological Association.

See Also

dep.oneway, lower2R

Examples

Run this code
##Kline (2004) Table 6.3
dat <- data.frame(y = c(9,12,13,15,16,
                       8,12,11,10,14,
                       10,11,13,11,15),
                  x =  rep(factor(c("a","b","c")), each=5),
                  subj = rep(paste("s", 1:5, sep=""), times=3)
                  )
dep.oneway(formula = y~x, data=dat, block="subj")

datwide <- reshape(dat, direction="wide", idvar="subj", timevar="x")
tmp <- datwide[,-1]
dep.oneway.second(m = mean(tmp), sd(tmp), n = nrow(tmp), corr=cor(tmp))



##Kline (2004) Table 6.15
my.cont <- matrix(c(-5,-3,-1,1,3,5,
                   5,-1,-4,-4,-1,5), ncol=6, nrow=2, byrow=TRUE)
dep.oneway.second(m = c(11.77,21.39,27.5,31.02,32.58,34.2), 
                  sd = c(7.6,8.44,8.95,9.21,9.49,9.62), 
                  n = 137, 
                  corr=lower2R(c(.77,.59,.50,.48,.46,.81,.72,.69,.68,.89,
                  .84,.8,.91,.88,.93)),
                  contr=my.cont)

Run the code above in your browser using DataLab