This vignette analyzes data from a two-factor between-subjects design.
FactorA <- c(1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2)
FactorB <- c(1,1,1,1,2,2,2,2,1,1,1,1,2,2,2,2)
Outcome <- c(0,0,3,5,4,7,4,9,9,6,4,9,3,6,8,3)
FactorA <- factor(FactorA,levels=c(1,2),labels=c("A1","A2"))
FactorB <- factor(FactorB,levels=c(1,2),labels=c("B1","B2"))
FactorialData <- data.frame(FactorA,FactorB,Outcome)
FactorialData
## FactorA FactorB Outcome
## 1 A1 B1 0
## 2 A1 B1 0
## 3 A1 B1 3
## 4 A1 B1 5
## 5 A1 B2 4
## 6 A1 B2 7
## 7 A1 B2 4
## 8 A1 B2 9
## 9 A2 B1 9
## 10 A2 B1 6
## 11 A2 B1 4
## 12 A2 B1 9
## 13 A2 B2 3
## 14 A2 B2 6
## 15 A2 B2 8
## 16 A2 B2 3
descMeansBy(Outcome~FactorA,by=FactorB)
## $`Descriptive Statistics for the Data: B1`
## N M SD
## A1 4.000 2.000 2.449
## A2 4.000 7.000 2.449
##
## $`Descriptive Statistics for the Data: B2`
## N M SD
## A1 4.000 6.000 2.449
## A2 4.000 5.000 2.449
ciMeansBy(Outcome~FactorA,by=FactorB)
## $`Confidence Intervals for the Means: B1`
## M SE df LL UL
## A1 2.000 1.225 6.000 -0.997 4.997
## A2 7.000 1.225 6.000 4.003 9.997
##
## $`Confidence Intervals for the Means: B2`
## M SE df LL UL
## A1 6.000 1.225 6.000 3.003 8.997
## A2 5.000 1.225 6.000 2.003 7.997
ciMeansBy(Outcome~FactorA,by=FactorB,conf.level=.99)
## $`Confidence Intervals for the Means: B1`
## M SE df LL UL
## A1 2.000 1.225 6.000 -2.541 6.541
## A2 7.000 1.225 6.000 2.459 11.541
##
## $`Confidence Intervals for the Means: B2`
## M SE df LL UL
## A1 6.000 1.225 6.000 1.459 10.541
## A2 5.000 1.225 6.000 0.459 9.541
nhstMeansBy(Outcome~FactorA,by=FactorB)
## $`Hypothesis Tests for the Means: B1`
## Diff SE t df p
## A1 2.000 1.225 1.633 6.000 0.154
## A2 7.000 1.225 5.715 6.000 0.001
##
## $`Hypothesis Tests for the Means: B2`
## Diff SE t df p
## A1 6.000 1.225 4.899 6.000 0.003
## A2 5.000 1.225 4.082 6.000 0.006
nhstMeansBy(Outcome~FactorA,by=FactorB,mu=5)
## $`Hypothesis Tests for the Means: B1`
## Diff SE t df p
## A1 -3.000 1.225 -2.449 6.000 0.050
## A2 2.000 1.225 1.633 6.000 0.154
##
## $`Hypothesis Tests for the Means: B2`
## Diff SE t df p
## A1 1.000 1.225 0.816 6.000 0.445
## A2 0.000 1.225 0.000 6.000 1.000
descMultifactor(Outcome~FactorA,by=FactorB)
## $`Source Table for the Effects: Between Subjects`
## SS df MS
## FactorA 4.000 1.000 4.000
## FactorB 16.000 1.000 16.000
## FactorA:FactorB 36.000 1.000 36.000
## Residuals 72.000 12.000 6.000
nhstMultifactor(Outcome~FactorA,by=FactorB)
## $`Hypothesis Tests for the Effects: Between Subjects`
## F df p
## FactorA 0.667 1.000 0.430
## FactorB 2.667 1.000 0.128
## FactorA:FactorB 6.000 1.000 0.031
## Residuals NA 12.000 NA
pvaMultifactor(Outcome~FactorA,by=FactorB)
## $`Proportion of Variance Accounted for by the Effects: Between Subjects`
## EtaSq ParEtaSq
## FactorA 0.031 0.053
## FactorB 0.125 0.182
## FactorA:FactorB 0.281 0.333
## Residuals 0.563 NA
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.