Re: [R] cdf in R give probability of random variable

2016-10-22 Thread Martin Maechler
> peter dalgaard > on Fri, 21 Oct 2016 22:10:22 +0200 writes: >> On 21 Oct 2016, at 20:23 , peter dalgaard >> wrote: >> >> In both cases it works out nicer if you do >> >> names(px) <- x >> barplot(px) > Um, unless of course you want the cdf as a st

Re: [R] cdf in R give probability of random variable

2016-10-21 Thread peter dalgaard
> On 21 Oct 2016, at 20:23 , peter dalgaard wrote: > > In both cases it works out nicer if you do > > names(px) <- x > barplot(px) > Um, unless of course you want the cdf as a step function, in which case check the help page for plot for possible values of the type= argument. -- Peter Dalg

Re: [R] cdf in R give probability of random variable

2016-10-21 Thread peter dalgaard
This looks like homework, but doing it in R might not be, so I'll give you the benefit of doubt... > On 21 Oct 2016, at 18:30 , Ragia . wrote: > > > Dear Grooup > > kindly > > how can I plot these graphs in R.. > > > Suppose that X is a discrete random variable with P(X = 0) = .25, P(X

[R] cdf in R give probability of random variable

2016-10-21 Thread Ragia .
Dear Grooup kindly how can I plot these graphs in R.. Suppose that X is a discrete random variable with P(X = 0) = .25, P(X = 1) = .125, P(X = 2) = .125, and P(X = 3) = .5. Graph the frequency function and the cumulative distribution function of X. my solution was: x=c(0,1,3) px=c(.25,.1

Re: [R] CDF of Sample Quantile

2011-03-08 Thread peter dalgaard
On Mar 7, 2011, at 19:12 , Bentley Coffey wrote: > Just to tie up this thread, I wanted to report my solution: > > When (n-1)p is an integer, there is a closed form solution: > pbinom(j-1,n,...) > > When it is not an integer, its fairly easy to approximate the solution by > interpolating betwee

[R] CDF of Sample Quantile

2011-03-07 Thread Bentley Coffey
Just to tie up this thread, I wanted to report my solution: When (n-1)p is an integer, there is a closed form solution: pbinom(j-1,n,...) When it is not an integer, its fairly easy to approximate the solution by interpolating between the closed-form solutions: fitting log(1 - probability from clo

Re: [R] CDF of Sample Quantile

2011-02-17 Thread Bentley Coffey
Duncan, I'm not sure how I missed your message. Sorry. What you describe is what I do when (n-1)p is an integer so that R computes the sample quantile using a single order statistic. My later posting has that exact binomial expression in there as a special case. When (n-1)p is not an integer then

Re: [R] CDF of Sample Quantile

2011-02-14 Thread Bentley Coffey
rneysville WV, 25430 > (304) 724-4480 > "Is the room still a room when its empty? Does the room, > the thing itself have purpose? Or do we, what's the word... imbue it." > - Jubal Early, Firefly > > r-help-boun...@r-project.org wrote on 02/14/2011 09:58:09 AM:

Re: [R] CDF of Sample Quantile

2011-02-14 Thread Duncan Murdoch
On 14/02/2011 9:58 AM, Bentley Coffey wrote: I need to calculate the probability that a sample quantile will exceed a threshold given the size of the iid sample and the parameters describing the distribution of each observation (normal, in my case). I can compute the probability with brute force

Re: [R] CDF of Sample Quantile

2011-02-14 Thread Jonathan P Daily
ly r-help-boun...@r-project.org wrote on 02/14/2011 09:58:09 AM: > [image removed] > > [R] CDF of Sample Quantile > > Bentley Coffey > > to: > > r-help > > 02/14/2011 01:58 PM > > Sent by: > > r-help-boun...@r-project.org > > I need

[R] CDF of Sample Quantile

2011-02-14 Thread Bentley Coffey
I need to calculate the probability that a sample quantile will exceed a threshold given the size of the iid sample and the parameters describing the distribution of each observation (normal, in my case). I can compute the probability with brute force simulation: simulate a size N sample, apply R's

[R] CDF calculation from kernel density estimates for a 324X 15 matrix

2010-03-26 Thread Tarana Solaiman
Hi, I have a 324X15 matrix (No of years vs. heavy precipitation days) and I want to calculate the cdf at 5 different data points for each row. I tried by the following codes but it's not working. heavyprec <- read.csv (file="heavyprecdays_CSV.csv",header=TRUE,sep=",") a <- heavyprec pdf <- densit

Re: [R] cdf

2009-10-14 Thread David Winsemius
On Oct 13, 2009, at 6:53 PM, Duncan Murdoch wrote: On 13/10/2009 6:43 PM, David Winsemius wrote: On Oct 13, 2009, at 5:12 PM, maram salem wrote: Dear all, I have the cdf of the following power fuction distribution: F(y)=(y/350)^a ,00. I want to use it as the argument of the disc

Re: [R] cdf

2009-10-13 Thread Duncan Murdoch
On 13/10/2009 6:43 PM, David Winsemius wrote: On Oct 13, 2009, at 5:12 PM, maram salem wrote: Dear all, I have the cdf of the following power fuction distribution: F(y)=(y/350)^a ,00. I want to use it as the argument of the discretize function of the actuar package. So I think

Re: [R] cdf

2009-10-13 Thread David Winsemius
On Oct 13, 2009, at 5:12 PM, maram salem wrote: Dear all, I have the cdf of the following power fuction distribution: F(y)=(y/350)^a ,00. I want to use it as the argument of the discretize function of the actuar package. So I think I need to define this function to R so that i

Re: [R] cdf

2009-10-13 Thread Duncan Murdoch
maram salem wrote: Dear all, I have the cdf of the following power fuction distribution: F(y)=(y/350)^a ,00. I want to use it as the argument of the discretize function of the actuar package. So I think I need to define this function to R so that if I entered a=1, I get the follo

Re: [R] cdf

2009-10-13 Thread Nordlund, Dan (DSHS/RDA)
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On > Behalf Of maram salem > Sent: Tuesday, October 13, 2009 2:13 PM > To: r-help > Subject: [R] cdf > > Dear all, > I have the cdf of the following power fuction dis

[R] cdf

2009-10-13 Thread maram salem
Dear all, I have the cdf of the following power fuction distribution: F(y)=(y/350)^a   ,00. I want to use it as the argument of the discretize function of the actuar package. So I think I need to define this function to R so that if I entered a=1, I get the following F(y)=(y/350) and