Hi there, I'm a newbie, plesae bear with me. I have a dataset with about 10000 ~ 30000 data points. Would like fit to both Gamma and Normal distribution to see which one fits better. How do I do this in R? Or I could do a normality test of the data, if it's normal, I then will do a normal fit, otherwise, a gamma fit. But again, I don't know how to do this either. Please help! David [[alternative HTML version deleted]]
This is an "iceberg" question -- most of it (i.e. statistical issues) is hidden beneath the surface. To avoid a lengthy dissertation on statistical philosophy, I would merely suggest: 1. require(lattice) ?qqmath 2. With that many points **any** test for a specific distributional form will be rejected. Goodness of fit tests are essentially meaningless in this context. This is a somewhat contentious assertion that might generate heated disagreement. What a lawyer would call "argumentative." ;-) Cheers, -- Bert Gunter Genentech Non-Clinical Statistics South San Francisco, CA "The business of the statistician is to catalyze the scientific learning process." - George E. P. Box> -----Original Message----- > From: r-help-bounces at stat.math.ethz.ch > [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of David Zhao > Sent: Thursday, November 17, 2005 9:45 AM > To: r-help at stat.math.ethz.ch > Subject: [R] Goodness fit test HELP! > > Hi there, > > I'm a newbie, plesae bear with me. > I have a dataset with about 10000 ~ 30000 data points. Would > like fit to > both Gamma and Normal distribution to see which one fits > better. How do I do > this in R? Or I could do a normality test of the data, if > it's normal, I > then will do a normal fit, otherwise, a gamma fit. But again, > I don't know > how to do this either. > Please help! > > David > > [[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 >
Hi David, you could see my contribute: "Fitting distributions with R" http://cran.r-project.org/doc/contrib/Ricci-distributions-en.pdf Hoping it could be helpful. Regards, Vito You wrote: Hi there, I'm a newbie, plesae bear with me. I have a dataset with about 10000 ~ 30000 data points. Would like fit to both Gamma and Normal distribution to see which one fits better. How do I do this in R? Or I could do a normality test of the data, if it's normal, I then will do a normal fit, otherwise, a gamma fit. But again, I don't know how to do this either. Please help! David 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/
What about trying a qqplot to see how the distribution fits... For the normal distribution thta is very stright forward, use qqnorm. To test gamma distribtution (or any other) do some thing like this n<-length(data) for(i in 1:n){ prob<-(i-1/3)/(n1/3) } quantiles<-qgamma(prob,shape=mean(data)/var(data),scale=var(data)/mean(data)} qqplot(data,quantiles) If the distribution is a good for, you should a stright line, like wiht a qqnorm plot! Good luck!! Elizbaeth Lawson David Zhao <wzhao6898@gmail.com> wrote: Hi there, I'm a newbie, plesae bear with me. I have a dataset with about 10000 ~ 30000 data points. Would like fit to both Gamma and Normal distribution to see which one fits better. How do I do this in R? Or I could do a normality test of the data, if it's normal, I then will do a normal fit, otherwise, a gamma fit. But again, I don't know how to do this either. Please help! David [[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 --------------------------------- [[alternative HTML version deleted]]