[R] Maximum likelihood estimation in R

Rau, Roland Rau at demogr.mpg.de
Mon Feb 16 10:22:38 CET 2004


Hi,

> -----Original Message-----
> From:	DivineSAAM at aol.com [SMTP:DivineSAAM at aol.com]
> Sent:	Sunday, February 15, 2004 10:24 PM
> To:	edwardweisun at hotmail.com; r-help at stat.math.ethz.ch
> Subject:	Re: [R] Maximum likelihood estimation in R
> 
> Hello,
> 
> Use
> 
> > x=rnorm(100, mean=3, sd=1)
> > library(MASS)
> >fitdistr(x, "normal")
>       mean          sd    
>   2.93666631   0.99673982 
>  (0.09967398) (0.07048015)
> 
	For me, this example does not work. As it looks like copy+paste, I
guess this something platform dependent? At least I have to specify some
starting values as shown below. But maybe I did something wrong?

	Best,
	Roland
	(I am using at the moment R 1.8.1 on WinNT)

	> x=rnorm(100, mean=3, sd=1)
	> library(MASS)
	> fitdistr(x, "normal")
	Error in fitdistr(x, "normal") : 'start' must be a named list
	> fitdistr(x, "normal", start=list(mean=1, sd=0.4))
	      mean          sd    
	  3.03167815   1.06637851 
	 (0.10663786) (0.07539617)
	> 


+++++
This mail has been sent through the MPI for Demographic Research.  Should you receive a mail that is apparently from a MPI user without this text displayed, then the address has most likely been faked.   If you are uncertain about the validity of this message, please check the mail header or ask your system administrator for assistance.




More information about the R-help mailing list