sm_power {smplot2} | R Documentation |
Post-hoc power analysis using two-sample or paired t-test
Description
Post-hoc power analysis using two-sample or paired t-test
Usage
sm_power(group1, group2, paired, sig.level = 0.05, power = 0.8)
Arguments
group1 |
Numeric vector containing data from one sample (i.e., group 1) that is to be compared with another group. |
group2 |
Numeric vector containing data from another sample (i.e., group 2) that is to be compared with the former group. |
paired |
A logical indicating whether your two samples (group1 and group2) are paired. |
sig.level |
Significance level (Type I error probability). Default is set to 0.05. |
power |
Power of test (1 minus Type II error probability). Default is set to 0.8. |
Value
Returns a result with a class of "power.htest" from the pwr package.
Examples
library(smplot2)
group1 <- rnorm(10,0,1)
group2 <- rnorm(10,1,1)
sm_power(group1, group2, paired = TRUE)
[Package smplot2 version 0.2.4 Index]