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 Ehlers
David Winsemius, MD
Heritage Laboratories
West Hartford, CT
______________________________________________
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.