Learn R Programming

rpsychi (version 0.3)

ind.t.test.second: A t-test with independent samples using published work

Description

ind.t.test.second conducts a t-test with independent samples using published work.

Usage

ind.t.test.second(m, sd, n, 
        unbiased = TRUE, 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)
unbiased
sd contains unbiased standard deviations (unbiased = TRUE, default) or sample standard deviations (unbiased = FALSE)
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.t.test.second contains the following components:
  • samp.statreturns the means, standard deviations, and sample sizes
  • raw.differencereturns a raw mean difference, its' confidence interval, and standard error
  • standardized.differencereturns a standardized mean difference (Hedges's $g$), its' approximate confidence interval for population standardized mean difference, and standard error
  • powerreturns statistical power for detecting small ($d = 0.20$), medium ($d = 0.50$), and large ($d = 0.80$) population effect sizes

encoding

UTF-8

Details

This function conducts a t-test with independent samples using published work. Statistical power is calculated using the following specifications: (a) small ($d = 0.20$), medium ($d = 0.50$), and large ($d = 0.80$) population effect sizes, according to the interpretive guideline for effect sizes by Cohen (1992) (b) sample size specified by n (c) significance level specified by sig.level

References

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.t.test, samplesize.d

Examples

Run this code
##Kline (2004) Table 4.4
dat <- data.frame(y = c(9,12,13,15,16,8,12,11,10,14),
                  x =  rep(factor(c("a","b")), each=5)
                  )
ind.t.test.second(m = tapply(dat$y, dat$x, mean),
                  sd = tapply(dat$y, dat$x, sd),
                  n = tapply(dat$y, dat$x, length)
                  )

Run the code above in your browser using DataLab