# power.t: Power calculations for t-test In powerAnalysis: Power Analysis in Experimental Design

## Description

Power calculations for t-test

## Usage

 ```1 2 3``` ```power.t(es = NULL, n = NULL, power = NULL, sig.level = NULL, ratio = 1, type = c("two", "paired", "one", "unequal"), alternative = c("two.sided", "left", "right")) ```

## Arguments

 `es` effect size. `n` total number of observations/pairs `power` power of study `sig.level` significance level `ratio` the ratio of sample size 1 to sample size 2. Only will be used when 'type' is "unequal". `type` type of t test, must be one of "one","two" (default), "paired", or "unequal". "one" means one sample t test, which test whether the population mean is equal to a specified value. "two"/"unequal" means two sample (equal size/unequal size) t test, which is used to ascertain how likely an observed mean difference between two groups would be to occur by chance alone. "paired" means paired t-test (also called the correlated t-test and the t-test for dependent means), which is used to ascertain how likely the difference between two means that contain the same (or matched) observations is to occur by chance alone. `alternative` One- or two-sided test, must be one of "two.sided" (default), "left", "right"

`ES.t.one`

`ES.t.two`

`ES.t.paired`

## Examples

 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40``` ```## one sample two sided test, calculate power power.t(es=0.2,n=60,sig.level=0.10,type="one",alternative="two.sided") ## one sample one sided (left tail) test, calculate power power.t(es=0.2,n=60,sig.level=0.10,type="one",alternative="left") ## one sample one sided (right tail) test, calculate power power.t(es=0.2,n=60,sig.level=0.10,type="one",alternative="right") ## one sample two sided test, calculate sampe size power.t(es=0.2,power=0.8,sig.level=0.05,type="one",alternative="two.sided") ## one sample two sided test, calculate effect size power.t(n=200,power=0.8,sig.level=0.05,type="one",alternative="two.sided") ## one sample two sided test, calculate sig.level power.t(es=0.2,n=200,power=0.8,type="one",alternative="two.sided") ## paired sample two sided test, calculate power power.t(es=0.559,n=40,sig.level=0.05,type="paired",alternative="two.sided") ## paired sample two sided test, calculate sample size power.t(es=0.15,power=0.8,sig.level=0.05,type="paired",alternative="two.sided") ## paired sample two sided test, calculate effect size power.t(n=200,power=0.8,sig.level=0.05,type="paired",alternative="two.sided") ## two sample two sided test, calculate power power.t(es=0.15,n=300,sig.level=0.05,type="two",alternative="two.sided") ## two sample two sided test, calculate sample size power.t(es=0.15,power=0.8,sig.level=0.05,type="two",alternative="two.sided") ## two sample two sided test, calculate effect size power.t(n=300,power=0.8,sig.level=0.05,type="two",alternative="two.sided") ## two sample (unequal size), calculate sample size power.t(es=0.15,power=0.8,sig.level=0.05,type="unequal",ratio=2,alternative="two.sided") power.t(es=0.1,n=3000,sig.level=0.05,type="unequal",ratio=2,alternative="two.sided") ```

### Example output

```     One-sample t test power calculation

es = 0.2
n = 60
power = 0.4555818
sig.level = 0.1
alternative = two.sided

NOTE: n is the number of observations

One-sample t test power calculation

es = 0.2
n = 60
power = 0.002400866
sig.level = 0.1
alternative = left

NOTE: n is the number of observations

One-sample t test power calculation

es = 0.2
n = 60
power = 0.6013403
sig.level = 0.1
alternative = right

NOTE: n is the number of observations

One-sample t test power calculation

es = 0.2
n = 198.1508
power = 0.8
sig.level = 0.05
alternative = two.sided

NOTE: n is the number of observations

One-sample t test power calculation

es = 0.1990655
n = 200
power = 0.8
sig.level = 0.05
alternative = two.sided

NOTE: n is the number of observations

One-sample t test power calculation

es = 0.2
n = 200
power = 0.8
sig.level = 0.04851422
alternative = two.sided

NOTE: n is the number of observations

Paired t test power calculation

es = 0.559
n = 40
power = 0.931511
sig.level = 0.05
alternative = two.sided

NOTE: n is number of *pairs*

Paired t test power calculation

es = 0.15
n = 350.7638
power = 0.8
sig.level = 0.05
alternative = two.sided

NOTE: n is number of *pairs*

Paired t test power calculation

es = 0.1990655
n = 200
power = 0.8
sig.level = 0.05
alternative = two.sided

NOTE: n is number of *pairs*

Two-sample (equal size) t test power calculation

es = 0.15
n = 300
power = 0.4500203
sig.level = 0.05
alternative = two.sided

NOTE: n is number in *each* group

Two-sample (equal size) t test power calculation

es = 0.15
n = 698.6382
power = 0.8
sig.level = 0.05
alternative = two.sided

NOTE: n is number in *each* group

Two-sample (equal size) t test power calculation

es = 0.2291204
n = 300
power = 0.8
sig.level = 0.05
alternative = two.sided

NOTE: n is number in *each* group

Two-sample (unequal size) t test power calculation

es = 0.15
power = 0.8
n = 1571.695
n1 = 1047.797
n2 = 523.8984
ratio = 2
sig.level = 0.05
alternative = two.sided

NOTE: n is the total number of observations

Two-sample (unequal size) t test power calculation

es = 0.1
power = 0.732768
n = 3000
n1 = 2000
n2 = 1000
ratio = 2
sig.level = 0.05
alternative = two.sided

NOTE: n is the total number of observations
```

powerAnalysis documentation built on May 2, 2019, 12:40 p.m.