eta2.contr.d: Compute (partial) eta-squared for contrast d

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/variances.R

Description

Return the proportion of variance explained by the contrast over the variance not explained by other effects. The result is the partial eta-squared unless, there's only one possible contrast in the model, the is the eta-squared

Usage

1
eta2.contr.d(cont, d, scale = "g")

Arguments

cont

vector of contrast weights.

d

d coefficient for given contrast.

scale

method to scale d.

Details

The parameter scale controls the method used to scale the effect size d.

  1. scale="g" assumes scaling by dividing 2*d by the sum of absolute coefficients

  2. scale="q" assumes scaling by dividing d by the square-root of the sum of squares of the coefficients

  3. numeric any constant that multiplies the unscaled d to obtain the scaled d

Value

eta-squared.

Author(s)

Marcello Gallucci, mcfanda@gmail.com

See Also

eta2.contr

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
### sim some data
cont<-c(-3,-1,1,3)
means<-c(10,12,10,12)
y<-rep(means,1000)+rnorm(4000,0,2)
x<-factor(rep(1:4,1000))
### compute eta-squared
mod<-lm(y~x)
eta2.contr(cont,xname = "x",model = mod)

#### check from the d coefficient
d<-d.contr(cont,x=x,y=y)
eta2.contr.d(cont = cont,d=d,scale = "g")

mcfanda/cpower documentation built on May 28, 2019, 1 p.m.