ind.t.test: A t-test with independent samples using individual data:...

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

Description

ind.t.test conducts a t-test with independent samples using individual data.

Usage

1
2
ind.t.test(formula, data, correct=TRUE,
                sig.level = 0.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 one independent variable containing a factor with two levels

data

a data frame contains the variables in the fomrmula

correct

a logical indicating whether to compute an unbiased standardized mean difference (delta) or not (correct = TRUE)

sig.level

a numeric contains the significance level (default 0.05)

digits

the specified number of decimal places (default 3)

Details

This function conducts a t-test with independent samples using individual data. 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 formula and data

(c) significance level specified by sig.level

Value

The returned object of ind.t.test contains the following components:

samp.stat

returns the means, standard deviations, and sample sizes

raw.difference

returns a raw mean difference, its' confidence interval, and standard error

standardized.difference

returns a standardized mean difference (Hedges's g), its' approximate confidence interval for population standardized mean difference, and standard error

power

returns statistical power for detecting small (d = 0.20), medium (d = 0.50), and large (d = 0.80) population effect sizes

Author(s)

Yasuyuki Okumura
Department of Social Psychiatry,
National Institute of Mental Health,
National Center of Neurology and Psychiatry
yokumura@blue.zero.jp

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

Examples

1
2
3
4
5
##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(y~x, data=dat, correct=FALSE)

Example output

Loading required package: gtools
$samp.stat
    m1    sd1     n1     m2    sd2     n2 
13.000  2.739  5.000 11.000  2.236  5.000 

$raw.difference
mean.diff     lower     upper       std 
    2.000    -1.646     5.646     1.581 

$standardized.difference
    es  lower  upper    std 
 0.800 -0.500  2.100  0.663 

$power
 small medium  large 
 0.059  0.108  0.201 

rpsychi documentation built on May 1, 2019, 10:10 p.m.