[R] binomial distribution

2010-08-28 Thread tamas barjak
Hello!

I need some help.
How I know it to draw the formula of the binomial distribution?

expr-expression(P(xi == k) == choose(n, k)* p^k*(1-p)^(n-k)) --- not good

on the screen the choose(n, k) not the Binomial Formula, but choose(n,
k)

Thanx!

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] binomial distribution

2010-08-28 Thread Cuckovic Paik

try:
?pbinom

-- 
View this message in context: 
http://r.789695.n4.nabble.com/binomial-distribution-tp2398568p2398705.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] binomial distribution

2010-08-28 Thread Peter Dalgaard
On 08/28/2010 10:23 PM, tamas barjak wrote:
 Hello!
 
 I need some help.
 How I know it to draw the formula of the binomial distribution?
 
 expr-expression(P(xi == k) == choose(n, k)* p^k*(1-p)^(n-k)) --- not good
 
 on the screen the choose(n, k) not the Binomial Formula, but choose(n,
 k)

Check demo(plotmath), 4th-to-last example.

-- 
Peter Dalgaard
Center for Statistics, Copenhagen Business School
Phone: (+45)38153501
Email: pd@cbs.dk  Priv: pda...@gmail.com

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] binomial distribution

2010-08-28 Thread tamas barjak
Perfect!

Thank You!

2010/8/28 Peter Dalgaard pda...@gmail.com

 On 08/28/2010 10:23 PM, tamas barjak wrote:
  Hello!
 
  I need some help.
  How I know it to draw the formula of the binomial distribution?
 
  expr-expression(P(xi == k) == choose(n, k)* p^k*(1-p)^(n-k)) --- not
 good
 
  on the screen the choose(n, k) not the Binomial Formula, but choose(n,
  k)

 Check demo(plotmath), 4th-to-last example.

 --
 Peter Dalgaard
 Center for Statistics, Copenhagen Business School
 Phone: (+45)38153501
 Email: pd@cbs.dk  Priv: pda...@gmail.com


[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] binomial distribution

2008-06-27 Thread Peng Jiang

Hi, xiechao
 i don't think that is a R specific problem. you mean u got two  
random variables X,Y and both
of them binomial distributed and you want to find the distribution of  
a new variable Z = X/Y.
That is a basic transformation problem. u can start with introducing a  
new r.v. namely W, by
 letting it equal to X you obtain W=X,Z=X/Y from which u have X = W  
and Y  = W / Z.  It is easy

to find the Jacobian of this transformation, and the left is routinely.

  regards.
On 2008-6-27, at 下午8:29, Xie Chao wrote:


Hi all,

I am a biological student and need your help in statistics.

I have two sets of  binomial distributed numbers: {a1, a2, ..., an}  
and {b1,

b2, ..., bn}.
How can I get the distribution of the ratios of the two sets of  
numbers

{a1/b1, a2/b2, ..., an/bn}? Is there a formula to transform the
distributions? Or where I can start if I want to learn necessary  
techniques?

Thank you a lot!

xiechao

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


---
Peng Jiang
江鹏
Ph.D. Candidate
Antai College of Economics  Management
安泰经济管理学院
Department of Mathematics
数学系
Shanghai Jiaotong University (Minhang Campus)
800 Dongchuan Road
200240 Shanghai
P. R. China

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] binomial distribution

2008-06-27 Thread Peter Dalgaard
Peng Jiang wrote:
 Hi, xiechao
  i don't think that is a R specific problem. you mean u got two random
 variables X,Y and both
 of them binomial distributed and you want to find the distribution of
 a new variable Z = X/Y.
 That is a basic transformation problem. u can start with introducing a
 new r.v. namely W, by
  letting it equal to X you obtain W=X,Z=X/Y from which u have X = W
 and Y  = W / Z.  It is easy
 to find the Jacobian of this transformation, and the left is routinely.
Not that easy! X and Y are discrete, and the result is an improper
distribution since there is a positive probability of dividing by 0. If
the mean of X and Y are moderately large, the delta method can be used.
If they have a small(-ish) number of different values, I'd be tempted
just to use brute force, as in

r - outer(x,y,/)
r[0,0] - 0 # 0/0 defaults to NaN
p - outer(dbinom(x,10,.5), dbinom(y,10,.5))
o - order(r)
plot(r[o],cumsum(p[o]), type=s)
plot(unique(r[o]),tapply(p[o],list(r[o]), sum), type=h)

(the latter plot is not quite right --- should take better care of
rounding issues)

   regards.
 On 2008-6-27, at 下午8:29, Xie Chao wrote:

 Hi all,

 I am a biological student and need your help in statistics.

 I have two sets of  binomial distributed numbers: {a1, a2, ..., an}
 and {b1,
 b2, ..., bn}.
 How can I get the distribution of the ratios of the two sets of numbers
 {a1/b1, a2/b2, ..., an/bn}? Is there a formula to transform the
 distributions? Or where I can start if I want to learn necessary
 techniques?
 Thank you a lot!

 xiechao

 [[alternative HTML version deleted]]

 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.

 ---
 Peng Jiang
 江鹏
 Ph.D. Candidate
 Antai College of Economics  Management
 安泰经济管理学院
 Department of Mathematics
 数学系
 Shanghai Jiaotong University (Minhang Campus)
 800 Dongchuan Road
 200240 Shanghai
 P. R. China

 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.


-- 
   O__   Peter Dalgaard Øster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark  Ph:  (+45) 35327918
~~ - ([EMAIL PROTECTED])  FAX: (+45) 35327907

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.