R语言绘图(FZ)

P-Value

Central Lmit Theorem(CLT)

mean(null>diff)

hist(null)

qqnorm(null)

qqline(null)

pops<-read.cssv("mice_pheno.csv")

hed(pops)

hf<- pops[popsSDiet=="hf"&popsSSex=="F",3]

chow<-pops[popsSDiet=="chow"&popsSSex=="F",3]

mean(hf)-mean(chow)

x<- sample(hf,12)

y<-sample(chow,12)

mean(x)_mean(y)

Ns<-c(3,5,10,25)

B<-10000

res<-sapply(Ns,funtion(n){sapply(1:8,function(j){mean(sample(hf,n))})})

lbrary(rafalib)

mypar2(2,2)

未完

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

sample variance

sample standard deviations

confidence intervals

t-statics:

开始编辑


dat<-read.csv("femaleMiceWeights.csv")

dat

control <- dat[1:12,2]

treatment<-dat[12+1:12,2]

diff <- mean(treatment)-mean(control)

print(diff)

t.test(treatment,control)

sd(control)

sd(control)/sqrt(length(control))

se <- sqrt(var(treatment)/length(treatment)+var(control)/length(control))

tstat <- diff/se

1-pnorm(tstat)+pnorm(-tstat)

qqnorm(treatment)

qqline(treatment)

t.test(treatment,control)

原文地址:https://www.cnblogs.com/chenwenyan/p/4849067.html