码迷,mamicode.com
首页 > 移动开发 > 详细

Applied Nonparametric Statistics-lec2

时间:2017-06-06 14:16:34      阅读:183      评论:0      收藏:0      [点我收藏+]

标签:alt   success   pre   int   nbsp   设置   eve   normal   exp   

Ref:

https://onlinecourses.science.psu.edu/stat464/print/book/export/html/3


The Binomial Distribution in R:

# return PMF. prob is the probability of success . x can be a list
dbinom(x, size, prob)

# CDF
pbinom(x, size, prob)

# returns a value for a particular percentile
qbinom

The Normal Distribution in R:

# pdf
dnorm(x, mean, sd)
# cdf
pnorm
# percentile
qnorm  

要执行t-test或者查看置信区间,可以这样做:即设置数据、α的值。

> x=c(15, 18,  6,  20, 10, 11,  9,  6, 14, 14, 11,  8, 10,  1,  7,  1, 18, 17, 10, 9)

> t.test(x, conf.level=0.95)

    One Sample t-test

data:  x 
t = 9.0705, df = 19, p-value = 2.473e-08
alternative hypothesis: true mean is not equal to 0 
95 percent confidence interval:
  8.26943 13.23057 
sample estimates:
mean of x 
    10.75

如果是做假设检验,则需要设置μ0和备选假设。  

> t.test(x, alternative="less", mu=10)

查看结果:

技术分享

p值远大于0.05,所以,不能拒绝原假设。

 

Applied Nonparametric Statistics-lec2

标签:alt   success   pre   int   nbsp   设置   eve   normal   exp   

原文地址:http://www.cnblogs.com/pxy7896/p/6951061.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!