Learn R Programming

rpsychi (version 0.3)

ind.twoway: A two-way design with independent samples using individual data

Description

ind.twoway conducts a two-way design with independent samples, namely two-way randomized-group analysis of variance, using individual data.

Usage

ind.twoway(formula, data, sig.level=.05, digits=3)

Arguments

formula
two-sided formula; the left-hand-side of which gives one dependent variable containing a numeric variable, and the right-hand-side of two independent variables containing a factor with two or more levels
data
a data frame contains the variables in the fomrmula
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 ind.oneway contains the following components:
  • anova.tablereturns a ANOVA table containing sums of squares, degrees of freedom, mean squares, $F$ values
  • omnibus.esreturns a omnibus effect sizes which is a partial $\eta^2$, and its' confidence interval for each main and interaction effect
  • powerreturns statistical power for detecting small ($\eta^2 = 0.01$), medium ($\eta^2 = 0.06$), and large ($\eta^2 = 0.14$) population effect sizes

Details

This function conducts a two-way design with independent samples, namely two-way randomized-group analysis of variance, using individual data. The main effect of the first independent variable will be shown in "(row)" section, and the main effect of the second one will be shown in "(col)" section. Always the interaction effect of the two independent variables will be calculated. Statistical power is calculated using the following specifications: (a) small ($\eta^2 = 0.01$), medium ($\eta^2 = 0.06$), and large ($\eta^2 = 0.14$) population effect sizes, according to the interpretive guideline for effect sizes by Cohen (1992) (b) sample size specified by formula and data (c) significance level specified by sig.level

References

Cohen B (2000) Calculating a factorial ANOVA from means and standard deviations. Understanding Statistics, 1, 191-203. Cohen J (1992) A power primer. Psychological Bulletin, 112, 155-159. Kline RB (2004) Beyond significance testing: Reforming data analysis methods in behavioral research. Washington: American Psychological Association.

See Also

ind.twoway.second

Examples

Run this code
##Kline (2004) Table 7.5
dat <- data.frame(
           y = c(2,3,4,1,3,1,3,4,5,5,6,6,6,7),
           A = factor(c(rep("A1",5), rep("A2", 9))),
           B = factor(c(rep("B1",3), rep("B2",2), rep("B1",2), rep("B2",7)))
           )

ind.twoway(y~A*B, data=dat)

Run the code above in your browser using DataLab