[R] Generating series of distributions with the same skewness and different kurtosis or with same kurtosis and different skewness?
Greg Snow
Greg.Snow at imail.org
Wed Sep 24 19:49:20 CEST 2008
And here is one way of using JohnsonFit to display how a distribution changes with changes in the moments:
library(TeachingDemos)
library(SuppDists)
tmpfun <- function(m1=0,m2=1,m3=-0.2,m4=3.7, xmin=-3, xmax=3){
parms <- JohnsonFit( c(m1,m2,m3,m4), 'use')
plot(function(x) dJohnson(x,parms), xmin, xmax)
}
tmplst <- list( Parameters=list(
m1=list('slider', init=0, from=-1, to=1, resolution=0.1),
m2=list('slider', init=1, from=0 , to=3, resolution=0.1),
m3=list('slider', init=-0.2, from=-1, to=1, resolution=0.1),
m4=list('slider', init=3.7, from=0 , to=10, resolution=0.5)),
xmin=list('numentry', init=-3, width=5),
xmax=list('numentry', init=3 , width=5) )
tkexamp( tmpfun, tmplst, plotloc='left' )
of course assuming that you have SuppDists and TeachingDemos packages installed, play around with this (and possibly change parameters and/or limits in tmplst) before demoing it as there are many combinations of the parameters that cause errors.
--
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.snow at imail.org
801.408.8111
> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
> project.org] On Behalf Of Gabor Grothendieck
> Sent: Wednesday, September 24, 2008 6:29 AM
> To: zhijie zhang
> Cc: R-help at stat.math.ethz.ch
> Subject: Re: [R] Generating series of distributions with the same
> skewness and different kurtosis or with same kurtosis and different
> skewness?
>
> Check out JohnsonFit in SuppDists.
>
> On Tue, Sep 23, 2008 at 10:59 AM, zhijie zhang <epistat at gmail.com>
> wrote:
> > Dear R users,
> > I hope to explain the concepts of skewness and kurtosis by
> generating
> > series of distributions with same skewness and different kurtosis or
> with
> > same kurtosis and different skewness, but it seems that i cannot find
> the
> > right functions.
> > I have searched the mailing list, but no answers were found.
> > Is it possible to do that in R? Which function could be used?
> > Thanks a lot.
> >
> > --
> > With Kind Regards,
> >
> > oooO:::::::::
> > (..):::::::::
> > :\.(:::Oooo::
> > ::\_)::(..)::
> > :::::::)./:::
> > ::::::(_/::::
> > :::::::::::::
> >
> [**********************************************************************
> *]
> > Zhi Jie,Zhang ,PHD
> > Tel:+86-21-54237149
> > Dept. of Epidemiology,School of Public Health,Fudan University
> > Address:No. 138 Yi Xue Yuan Road,Shanghai,China
> > Postcode:200032
> > Email:epistat at gmail.com <Email%3Aepistat at gmail.com>
> > Website: www.statABC.com
> >
> [**********************************************************************
> *]
> > oooO:::::::::
> > (..):::::::::
> > :\.(:::Oooo::
> > ::\_)::(..)::
> > :::::::)./:::
> > ::::::(_/::::
> > :::::::::::::
> >
> > [[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.
> >
>
> ______________________________________________
> 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.
More information about the R-help
mailing list