Is there an R package that allows one to calculate skewness and curtosis - but weighted with individual level weights (one weight per observation)? Thank you!
Dimitri Liakhovitski
8 messages · David Winsemius, Bert Gunter, Dimitri Liakhovitski +1 more
Is there an R package that allows one to calculate skewness and curtosis - but weighted with individual level weights (one weight per observation)? Thank you!
Dimitri Liakhovitski
Is there an R package that allows one to calculate skewness and curtosis - but weighted with individual level weights (one weight per observation)?
Integer weights?
David Winsemius Alameda, CA, USA
Unfortunately not - more like 0.7654, 1.2345. I understand that I could multiply each number by 100, round it to no decimal point and then unroll my data in proportion. I was just hoping someone has done it in C and put it into a package... On Thu, Jul 16, 2015 at 11:27 AM, David Winsemius
On Jul 16, 2015, at 8:10 AM, Dimitri Liakhovitski wrote:
Is there an R package that allows one to calculate skewness and curtosis - but weighted with individual level weights (one weight per observation)?
Integer weights? -- David Winsemius Alameda, CA, USA
Dimitri Liakhovitski
rep() **does** do it essentially in C !! See also the "moments" package, which I found instantly by googling "sample moments in R", though I don't know whether it does what you want (but probably shouldn't do). Of course, sample skewness and kurtosis are basically useless, but that's another, off topic, issue. Cheers, Bert Cheers, Bert Bert Gunter "Data is not information. Information is not knowledge. And knowledge is certainly not wisdom." -- Clifford Stoll On Thu, Jul 16, 2015 at 8:37 AM, Dimitri Liakhovitski
Unfortunately not - more like 0.7654, 1.2345. I understand that I could multiply each number by 100, round it to no decimal point and then unroll my data in proportion. I was just hoping someone has done it in C and put it into a package... On Thu, Jul 16, 2015 at 11:27 AM, David Winsemius <dwinsemius at comcast.net> wrote:
On Jul 16, 2015, at 8:10 AM, Dimitri Liakhovitski wrote:
Is there an R package that allows one to calculate skewness and curtosis - but weighted with individual level weights (one weight per observation)?
Integer weights? -- David Winsemius Alameda, CA, USA
-- Dimitri Liakhovitski
______________________________________________ R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see 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.
Thank you!
rep() **does** do it essentially in C !! See also the "moments" package, which I found instantly by googling "sample moments in R", though I don't know whether it does what you want (but probably shouldn't do). Of course, sample skewness and kurtosis are basically useless, but that's another, off topic, issue. Cheers, Bert Cheers, Bert Bert Gunter "Data is not information. Information is not knowledge. And knowledge is certainly not wisdom." -- Clifford Stoll On Thu, Jul 16, 2015 at 8:37 AM, Dimitri Liakhovitski <dimitri.liakhovitski at gmail.com> wrote:
Unfortunately not - more like 0.7654, 1.2345. I understand that I could multiply each number by 100, round it to no decimal point and then unroll my data in proportion. I was just hoping someone has done it in C and put it into a package... On Thu, Jul 16, 2015 at 11:27 AM, David Winsemius <dwinsemius at comcast.net> wrote:
On Jul 16, 2015, at 8:10 AM, Dimitri Liakhovitski wrote:
Is there an R package that allows one to calculate skewness and curtosis - but weighted with individual level weights (one weight per observation)?
Integer weights? -- David Winsemius Alameda, CA, USA
-- Dimitri Liakhovitski
______________________________________________ R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see 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.
Dimitri Liakhovitski
Unfortunately not - more like 0.7654, 1.2345. I understand that I could multiply each number by 100, round it to no decimal point and then unroll my data in proportion. I was just hoping someone has done it in C and put it into a package...
I saw Bert's comments but I don't think that `rep` handles fractional weights. Take a look at Hmisc::wtd.var (since I have that package loaded and see that code is easy to grasp).
Also appears after after using sos::findFn("weighted moments") that the package:lmomco deserves your attention.
On Thu, Jul 16, 2015 at 11:27 AM, David Winsemius <dwinsemius at comcast.net> wrote:
On Jul 16, 2015, at 8:10 AM, Dimitri Liakhovitski wrote:
Is there an R package that allows one to calculate skewness and curtosis - but weighted with individual level weights (one weight per observation)?
Integer weights? -- David Winsemius
David Winsemius Alameda, CA, USA
David: I think you missed my point. As I understand him, Dmitri mentioned rounding off to e.g. 2 decimal digits and multiplying by 100 to produce integer weights, which would then lead to "unrolling" the vector via rep(). Your "weighted moments" reference is probably closer to what he sought, however. Cheers, Bert Bert Gunter "Data is not information. Information is not knowledge. And knowledge is certainly not wisdom." -- Clifford Stoll
On Jul 16, 2015, at 8:37 AM, Dimitri Liakhovitski wrote:
Unfortunately not - more like 0.7654, 1.2345. I understand that I could multiply each number by 100, round it to no decimal point and then unroll my data in proportion. I was just hoping someone has done it in C and put it into a package...
I saw Bert's comments but I don't think that `rep` handles fractional weights. Take a look at Hmisc::wtd.var (since I have that package loaded and see that code is easy to grasp).
Also appears after after using sos::findFn("weighted moments") that the package:lmomco deserves your attention.
On Thu, Jul 16, 2015 at 11:27 AM, David Winsemius <dwinsemius at comcast.net> wrote:
On Jul 16, 2015, at 8:10 AM, Dimitri Liakhovitski wrote:
Is there an R package that allows one to calculate skewness and curtosis - but weighted with individual level weights (one weight per observation)?
Integer weights? -- David Winsemius
David Winsemius Alameda, CA, USA
______________________________________________ R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see 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.
<SNIP>
Of course, sample skewness and kurtosis are basically useless, but that's another, off topic, issue.
Fortune nomination! cheers, Rolf
Technical Editor ANZJS Department of Statistics University of Auckland Phone: +64-9-373-7599 ext. 88276