作者neoism ()
看板Statistics
标题Re: [问题] 请问R怎麽画theoretical distribution?
时间Tue Apr 3 15:48:05 2007
※ 引述《wesley123 (想睡觉...)》之铭言:
: Draw 100 random numbers from each of the following distribution.
: Compute the sample mean...(略) Finally, draw the histogram of the samples
: along with the theoretical distribution.
: 我想请问theoretical distribution用R要怎麽画啊?
: sample data的很简单我会
: theoretical的应该也很简单吧 但是我真的不知道怎麽画 ...
: introduction to R 有找过但是找不到
: 我今天是第一次用R这个软体
: 还请各位前辈帮帮忙 谢谢!!
参考一下我的想法
有更好方法也请大家提出
# Generate 100 r.s.from specific distribution(e.g. Normal(0,1)) and
draw histogram of the sample
hist(rnorm(100),freq=F)
# Draw density function for the theoretical distribution
points(seq(-3,3,l=101),dnorm(seq(-3,3,l=101)),type="l",col=2,lwd=2)
--
N家的梦: SWM ED VR IF Aspherical
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 218.165.189.92
※ 编辑: neoism 来自: 218.165.189.92 (04/03 15:48)