Ⅰ型错误是拒绝了实际上成立的H0，是一种“弃真”行为，显著水平（检验水平）α实际上就是预先规定的犯Ⅰ型错误的最大概率，常取值0.05、0.01，Ⅰ型错误也用α表示，α可以取单尾也可以取双尾。如α=0.05，当H0实际成立却通过假设检验拒绝了H0时，理论上100次试验有5次会发生这种错误。医学上的假阳性、误诊便属于此类错误。Ⅱ型错误是没有拒绝（“接受”）实际上不成立的H0，是一种“取伪”行为，其概率大小用β表示，β只取单尾，医学上的假阴性、漏诊属于此类错误。形象地讲，Ⅰ类错误是放弃了正确的事实，错杀了好人；Ⅱ类错误选择了错误，放走了坏人。来自知乎的文章【https://www.zhihu.com/question/20993864/answer/30760554】对这两类错误有很形象地诠释：H0:you are not pregnant；H1:you are pregnant。
1-β称为检验功效（power of test），也称把握度，表示当两总体确实有差异，按规定的检验水准α所能发现该差异的能力。比如1-β=0.9，则表示若两总体确有差异，理论上100次检验中有90次能够得出差异有统计学意义的结论。
es:effect size,difference between the means divided by the pooled standard deviation;
n:total number of observations/pairs;
power:power of study;
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".
pwr.t.test(n =NULL,d=NULL,sig.level=0.05, power =NULL,type=c("two.sample","one.sample","paired"),alternative=c("two.sided","less","greater"))
n:Number of observations (per sample);
d:Effect size (Cohen's d) - difference between the means divided by the pooled standard deviation;
sig.level:Significance level (Type I error probability);
power:Power of test (1 minus Type II error probability);
type:Type of t test : one- two- or paired-samples;
alternative:a character string specifying the alternative hypothesis, must be one of "two.sided" (default), "greater" or "less.