Simulate data from a negatively skewed distribution

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

Simulate data from a negatively skewed distribution

Snuffy Dog
How would simulate data, say 1000 cases from a negatively skewed distribution with scores ranging from 1 through 7 using whole integers only. 
This would need to be done in SPSS without python integration.
Reply | Threaded
Open this post in threaded view
|

Re: Simulate data from a negatively skewed distribution

Bruce Weaver
Administrator
Snuffy Dog wrote
How would simulate data, say 1000 cases from a negatively skewed
distribution with scores ranging from 1 through 7 using whole integers
only.
This would need to be done in SPSS without python integration.
A binomial distribution with p > .5 will be negatively skewed.  So something like this should do it.

new file.
- input program.
-  loop #i = 1 to 1000.
-  compute Y = rv.binom(6,0.75) + 1.
-  end case.
- end loop.
end file.
end input program.
exe.

FREQUENCIES VARIABLES=Y /BARCHART FREQ .

--
Bruce Weaver
bweaver@lakeheadu.ca
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

PLEASE NOTE THE FOLLOWING: 
1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above.
2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (https://listserv.uga.edu/).