R语言T检验

实用标准文案

R语言 T检验介绍

Compute power of tests or determine parameters to obtain target power (similar to power.t.test).

应用:推论差异发生的概率,从而比较两个平均数的差异是否显著等。

格式:

pwr.t.test(n = NULL, d = NULL, sig.level = 0.05, power = NULL, type = c(\c(\

\

参数简介

n d power type

样本数 效应值

功效水平(1-p(二型错误概率)) 检验类型(单样本、双样本、相依样本)

sig.level 显著性水平

alternative 双侧检验、单侧检验

细节补充

Exactly one of the parameters 'd','n','power' and 'sig.level' must be passed as NULL, and that parameter is determined from the others. Notice that the last one has non-NULL default so NULL must be explicitly passed if you want to compute it.

精彩文档

实用标准文案

Object of class '\computed one) augmented with 'method' and 'note' elements.

注意

'uniroot' is used to solve power equation for unknowns, so you may see errors from it, notably about inability to bracket the root when invalid arguments are given.

作者

Stephane Champely but this is a mere copy of Peter Dalgaard work (power.t.test)

参考文献

Cohen, J. (1988). Statistical power analysis for the behavioral sciences (2nd ed.). Hillsdale,NJ: Lawrence Erlbaum.

查看

power.prop.test

举例

## One sample (power)

## Exercise 2.5 p. 47 from Cohen (1988)

pwr.t.test(d=0.2,n=60,sig.level=0.10,type=\sided\

## Paired samples (power)

## Exercise p. 50 from Cohen (1988) d<-8/(16*sqrt(2*(1-0.6)))

精彩文档

实用标准文案

pwr.t.test(d=d,n=40,sig.level=0.05,type=\)

## Two independent samples (power)

## Exercise 2.1 p. 40 from Cohen (1988) d<-2/2.8

pwr.t.test(d=d,n=30,sig.level=0.05,type=\ded\

## Two independent samples (sample size) ## Exercise 2.10 p. 59

pwr.t.test(d=0.3,power=0.75,sig.level=0.05,type=\=\

精彩文档

联系客服:779662525#qq.com(#替换为@) 苏ICP备20003344号-4