Re: [R] poisson fit for histogram

2005-07-25 Thread Francisco J. Zagmutt
Ups! Mr. Ripley is right.  I ignored the OS in the posting.  My appologies 
to Tom Isenbarger for the misleading answer.

Regards

Francisco


From: Prof Brian Ripley [EMAIL PROTECTED]
To: Francisco J. Zagmutt [EMAIL PROTECTED]
CC: [EMAIL PROTECTED], r-help@stat.math.ethz.ch
Subject: Re: [R] poisson fit for histogram
Date: Sat, 23 Jul 2005 08:29:28 +0100 (BST)

What does fit.dist do that fitdistr (MASS) does not in this context?  (It 
plots, but that is very easy to do in base R.  However, to see if a Poisson 
fits you need a test of goodness-of-fit.)

BTW, `decompress and store the files in your library folder' is on no OS 
(you did not mention one but Thomas did) the way to install a package. Even 
on Windows (where it might just work) there are simpler and better ways to 
do it, like using a menu.  Note that Lindsey does not provide pre-compiled 
packages for MacOS X, the platform Thomas is using (and as they use 
Fortran, people have reported that they are tricky to install on MacOS X), 
and your recipe is `seriously' misleading there.

On Fri, 22 Jul 2005, Francisco J. Zagmutt wrote:

I would first reccomend you to update your version of R.  Then download 
the
libraries rmutil and gnlm from Jim Lindsey at
http://www.luc.ac.be/~jlindsey/rcode.html decompress and store the files 
in
your library folder.   Sorry but you will have to donwload a package
unless you seriously want to re-invent the wheel.
Finally try
library(gnlm)
?fit.dist()

Cheers

Francisco


From: Thomas Isenbarger [EMAIL PROTECTED]
To: r-help@stat.math.ethz.ch
Subject: [R] poisson fit for histogram
Date: Wed, 20 Jul 2005 10:40:51 -0500

I haven't been an R lister for a bit, but I hope to enlist someone's
help here.  I think this is a simple question, so I hope the answer
is not much trouble.  Can you please respond directly to this email
address in addition to the list (if responding to the list is
warranted)?

I have a histogram and I want to see if the data fit a Poisson
distribution.  How do I do this?  It is preferable if it could be
done without having to install any or many packages.

I use R Version 1.12 (1622) on OS X

Thank-you very much,
Tom Isenbarger


--
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] poisson fit for histogram

2005-07-23 Thread Prof Brian Ripley
What does fit.dist do that fitdistr (MASS) does not in this context?  (It 
plots, but that is very easy to do in base R.  However, to see if a 
Poisson fits you need a test of goodness-of-fit.)

BTW, `decompress and store the files in your library folder' is on no OS 
(you did not mention one but Thomas did) the way to install a package. 
Even on Windows (where it might just work) there are simpler and better 
ways to do it, like using a menu.  Note that Lindsey does not provide 
pre-compiled packages for MacOS X, the platform Thomas is using (and as 
they use Fortran, people have reported that they are tricky to install on 
MacOS X), and your recipe is `seriously' misleading there.

On Fri, 22 Jul 2005, Francisco J. Zagmutt wrote:

 I would first reccomend you to update your version of R.  Then download the
 libraries rmutil and gnlm from Jim Lindsey at
 http://www.luc.ac.be/~jlindsey/rcode.html decompress and store the files in
 your library folder.   Sorry but you will have to donwload a package
 unless you seriously want to re-invent the wheel.
 Finally try
 library(gnlm)
 ?fit.dist()

 Cheers

 Francisco


 From: Thomas Isenbarger [EMAIL PROTECTED]
 To: r-help@stat.math.ethz.ch
 Subject: [R] poisson fit for histogram
 Date: Wed, 20 Jul 2005 10:40:51 -0500

 I haven't been an R lister for a bit, but I hope to enlist someone's
 help here.  I think this is a simple question, so I hope the answer
 is not much trouble.  Can you please respond directly to this email
 address in addition to the list (if responding to the list is
 warranted)?

 I have a histogram and I want to see if the data fit a Poisson
 distribution.  How do I do this?  It is preferable if it could be
 done without having to install any or many packages.

 I use R Version 1.12 (1622) on OS X

 Thank-you very much,
 Tom Isenbarger


-- 
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] poisson fit for histogram

2005-07-22 Thread Francisco J. Zagmutt
I would first reccomend you to update your version of R.  Then download the 
libraries rmutil and gnlm from Jim Lindsey at 
http://www.luc.ac.be/~jlindsey/rcode.html decompress and store the files in 
your library folder.   Sorry but you will have to donwload a package 
unless you seriously want to re-invent the wheel.
Finally try
library(gnlm)
?fit.dist()

Cheers

Francisco


From: Thomas Isenbarger [EMAIL PROTECTED]
To: r-help@stat.math.ethz.ch
Subject: [R] poisson fit for histogram
Date: Wed, 20 Jul 2005 10:40:51 -0500

I haven't been an R lister for a bit, but I hope to enlist someone's
help here.  I think this is a simple question, so I hope the answer
is not much trouble.  Can you please respond directly to this email
address in addition to the list (if responding to the list is
warranted)?

I have a histogram and I want to see if the data fit a Poisson
distribution.  How do I do this?  It is preferable if it could be
done without having to install any or many packages.

I use R Version 1.12 (1622) on OS X

Thank-you very much,
Tom Isenbarger


--
Tom Isenbarger PhD
[EMAIL PROTECTED]
608.265.0850


   [[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! 
http://www.R-project.org/posting-guide.html

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] poisson fit for histogram

2005-07-21 Thread Vito Ricci
Hi,

see: 

http://cran.r-project.org/doc/contrib/Ricci-distributions-en.pdf

Regards,

Vito


Thomas Isenbarger isen at plantpath.wisc.edu 
wrote:
I haven't been an R lister for a bit, but I hope to
enlist someone's  
help here.  I think this is a simple question, so I
hope the answer  
is not much trouble.  Can you please respond directly
to this email  
address in addition to the list (if responding to the
list is  
warranted)?

I have a histogram and I want to see if the data fit a
Poisson  
distribution.  How do I do this?  It is preferable if
it could be  
done without having to install any or many packages.

I use R Version 1.12 (1622) on OS X

Thank-you very much,
Tom Isenbarger


--
Tom Isenbarger PhD
[EMAIL PROTECTED]
608.265.0850


Diventare costruttori di soluzioni
Became solutions' constructors

The business of the statistician is to catalyze 
the scientific learning process.  
George E. P. Box

Statistical thinking will one day be as necessary for efficient citizenship as 
the ability to read and write
H. G. Wells

Top 10 reasons to become a Statistician

 1. Deviation is considered normal
 2. We feel complete and sufficient
 3. We are 'mean' lovers
 4. Statisticians do it discretely and continuously
 5. We are right 95% of the time
 6. We can legally comment on someone's posterior distribution
 7. We may not be normal, but we are transformable
 8. We never have to say we are certain
 9. We are honestly significantly different
10. No one wants our jobs


Visitate il portale http://www.modugno.it/
e in particolare la sezione su Palese  
http://www.modugno.it/archivio/palesesanto_spirito/

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] poisson fit for histogram

2005-07-20 Thread Thomas Isenbarger
I haven't been an R lister for a bit, but I hope to enlist someone's  
help here.  I think this is a simple question, so I hope the answer  
is not much trouble.  Can you please respond directly to this email  
address in addition to the list (if responding to the list is  
warranted)?

I have a histogram and I want to see if the data fit a Poisson  
distribution.  How do I do this?  It is preferable if it could be  
done without having to install any or many packages.

I use R Version 1.12 (1622) on OS X

Thank-you very much,
Tom Isenbarger


--
Tom Isenbarger PhD
[EMAIL PROTECTED]
608.265.0850


[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] poisson fit for histogram

2005-07-20 Thread Ben Bolker
Thomas Isenbarger isen at plantpath.wisc.edu writes:

 
 I haven't been an R lister for a bit, but I hope to enlist someone's  
 help here.  I think this is a simple question, so I hope the answer  
 is not much trouble.  Can you please respond directly to this email  
 address in addition to the list (if responding to the list is  
 warranted)?
 
 I have a histogram and I want to see if the data fit a Poisson  
 distribution.  How do I do this?  It is preferable if it could be  
 done without having to install any or many packages.
 
 I use R Version 1.12 (1622) on OS X
 
 Thank-you very much,
 Tom Isenbarger
 
 --
 Tom Isenbarger PhD
 isen at plantpath.wisc.edu
 608.265.0850
 
   [[alternative HTML version deleted]]
 
 __
 R-help at stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
 
 

  by histogram do you mean that you have counts for each
non-negative integer?  or are the data more binned than that?
(I'll assume the former since it's slightly easier to deal with.)
Say you have vectors number and count.  The mean of
the sample is meanval - sum(number*count).  The _expected_ number
of counts in each bin if the distribution is
Poisson is expval - sum(count)*dpois(number,meanval).
The chi-square statistic is csq - sum((expval-count)^2/expval), with
df - length(count)-2 degrees of freedom (for the mean and the total
number of observations).  pchisq(csq,df=df,lower.tail=FALSE)
should give you the chi-squared probability.

  A couple of minor issues: (1) beware, this is shooting from
the hip -- haven't tested at all; (2) you may have to deal
with lumping categories (rule of thumb is that expected number
of counts in a bin should not be  5).

  Other ways to tackle this: use fitdistr() from MASS with
different candidate distributions (Poisson, neg. bin.) and
do a likelihood ratio test or compare AICs; compare variance and
mean of distribution (much cruder).

See
http://www.zoo.ufl.edu/bolker/emd/probs/ED-4.1.html
for a worked example of a similar problem.

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] poisson fit for histogram

2005-07-20 Thread Gabor Grothendieck
See ?goodfit in package vcd.


On 7/20/05, Thomas Isenbarger [EMAIL PROTECTED] wrote:
 I haven't been an R lister for a bit, but I hope to enlist someone's
 help here.  I think this is a simple question, so I hope the answer
 is not much trouble.  Can you please respond directly to this email
 address in addition to the list (if responding to the list is
 warranted)?
 
 I have a histogram and I want to see if the data fit a Poisson
 distribution.  How do I do this?  It is preferable if it could be
 done without having to install any or many packages.
 
 I use R Version 1.12 (1622) on OS X
 
 Thank-you very much,
 Tom Isenbarger
 
 
 --
 Tom Isenbarger PhD
 [EMAIL PROTECTED]
 608.265.0850
 
 
[[alternative HTML version deleted]]
 
 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html