Hi July,
You might want to check out the "moments" package. It has a couple
functions, "all.moments()" and "moment()" that will compute
these for
you.
By the way, "RSeek.org" is a great place to find packages like this; I
searched for "sample moments" and clicked on the "functions"
tab to
find this.
HTH,
Ethan
On Fri, Oct 8, 2010 at 1:19 AM, July <iowncup at gmail.com>
wrote:>
> Dear Experts,
>
> If I have a vector of numbers x.
>
> (1) How can I write R code to compute the moments around zero of order one
> to four?
>
> (2) How can I write R code to compute the moments around the mean of order
> one to four?
>
> Thank you very much!
> --
> View this message in context:
http://r.789695.n4.nabble.com/Writing-R-code-for-moments-tp2967946p2967946.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> 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.
>