Generating Dataset with Known Skewness and Kurtosis

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Generating Dataset with Known Skewness and Kurtosis

Brian Dates
Hi, all. Does anyone know of syntax that will produce a dataset with known skewness and kurtosis as well as mean and standard deviation? Thanks.

Brian

Brian G. Dates
Consultant in Program Evaluation and Statistics
248-229-2865
===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: Generating Dataset with Known Skewness and Kurtosis

David Marso-2
I have no code but the following might be useful.
https://www.researchgate.net/publication/289994220_A_simple_simulation_technique_for_non-normal_data_with_pre-specified_skewness_kurtosis_and_covariance_matrix/download

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: Generating Dataset with Known Skewness and Kurtosis

Jon Peck
The reference David cites refers to a method that is available in R, but it requires at least R3.4.  Here is code for this

install.packages("semTools")
library(semTools)
dta=data.frame(mvrnonnorm(n=100, mu=c(1, 2), Sigma=matrix(c(10, 2, 2, 5), 2, 2), skewness = c(5, 2), kurtosis = c(3, 3)))
save(file="c:/temp/nonnorm.Rdata", dta)

Consult the help for this function for details on the parameter definitions.  Note that the kurtosis parameter refers to "excess kurtosis.  Although it isn't documented, it appears that you must generate at least two variables or it fails.

If you want to use the result in Statistics, you can read the R Rdata file using the STATS GET R extension command available via the Extensions menu or save the file in csv format instead of as an R workspace.

STATS GET R FILE="c:\temp\nonnorm.Rdata"  CLEARENV=NO   ALLDATA=NO
/GET DATASET=dta DATAFRAME=dta.

On Sat, Feb 23, 2019 at 1:03 PM David Marso <[hidden email]> wrote:
I have no code but the following might be useful.
https://www.researchgate.net/publication/289994220_A_simple_simulation_technique_for_non-normal_data_with_pre-specified_skewness_kurtosis_and_covariance_matrix/download

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD


--
Jon K Peck
[hidden email]

===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: Generating Dataset with Known Skewness and Kurtosis

bdates
In reply to this post by David Marso-2

Thanks David and Jon. The article is great and fits what's necessary in the R program well.


Take care.


Brian

From: SPSSX(r) Discussion <[hidden email]> on behalf of David Marso <[hidden email]>
Sent: Saturday, February 23, 2019 3:03:11 PM
To: [hidden email]
Subject: Re: Generating Dataset with Known Skewness and Kurtosis
 
I have no code but the following might be useful.
https://www.researchgate.net/publication/289994220_A_simple_simulation_technique_for_non-normal_data_with_pre-specified_skewness_kurtosis_and_covariance_matrix/download

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD