Raymond Wong
2009-Nov-20 18:31 UTC
[R] How to use results of distribution fitting for further processing?
This is probably simple, but I have a hard time finding the solution. Any help greatly appreciated. I would like to use the results of fitdistr(z,densfun=dweibull,start=list(scale=1,shape=1)) for further processing. How do I assign the values of scale and shape to b and a without manually entering the numbers? TIA __________________________________________________________________ Looking for the perfect gift? Give the gift of Flickr! [[alternative HTML version deleted]]
Peter Ehlers
2009-Nov-20 18:47 UTC
[R] How to use results of distribution fitting for further processing?
Raymond Wong wrote:> This is probably simple, but I have a hard time finding the solution. Any help greatly appreciated. > > I would like to use the results of fitdistr(z,densfun=dweibull,start=list(scale=1,shape=1)) for further processing. How do I assign the values of scale and shape to b and a without manually entering the numbers?fd <- fitdistr(z,densfun=dweibull,start=list(scale=1,shape=1)) str(fd) fd$estimate fd$estimate[1] etc Remember the ever useful str(). -Peter Ehlers> > TIA > > > __________________________________________________________________ > Looking for the perfect gift? Give the gift of Flickr! > > > [[alternative HTML version deleted]] > > > > ------------------------------------------------------------------------ > > ______________________________________________ > R-help at 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.
David Winsemius
2009-Nov-20 19:02 UTC
[R] How to use results of distribution fitting for further processing?
On Nov 20, 2009, at 1:47 PM, Peter Ehlers wrote:> > > Raymond Wong wrote: >> This is probably simple, but I have a hard time finding the >> solution. Any help greatly appreciated. >> I would like to use the results of >> fitdistr(z,densfun=dweibull,start=list(scale=1,shape=1)) for >> further processing. How do I assign the values of scale and shape >> to b and a without manually entering the numbers? >library(MASS)> fd <- fitdistr(z,densfun=dweibull,start=list(scale=1,shape=1)) > str(fd) > fd$estimate > fd$estimate[1] > > etc > > Remember the ever useful str().Agree! You cannot learn R without knowing to use str(). Could also get more self-documenting code with: fd$estimate[c("scale", "shape")] -- David> > -Peter EhlersDavid Winsemius, MD Heritage Laboratories West Hartford, CT