This vignette demonstrates how to use the {samplezoo} package to generate datasets of varying sizes (small, medium, and large) with variables from multiple probability distributions.
Each dataset contains:
Variables/columns from common distributions such as Normal, Binomial, Poisson, and others.
Adjustable sample sizes to meet needs.
data_small <- samplezoo("small")
head(data_small)
#> norm norm_2 norm_3 bern neg pois exp unif beta
#> 1 44.90970 65.23047 31.18120 1 0 2 1.042566 0.08487187 0.55247864
#> 2 36.71933 60.47493 72.73016 0 4 2 3.457949 0.64026850 0.22861180
#> 3 72.41336 57.50654 45.07389 0 1 2 10.351526 0.59246253 0.40923992
#> 4 56.05509 54.59662 39.04121 1 0 4 11.524659 0.47636723 0.13316897
#> 5 20.07632 85.88292 38.55907 1 0 2 26.751444 0.97107490 0.23512538
#> 6 55.91194 51.45511 20.20991 1 4 9 1.726511 0.08822913 0.07561506
#> gamma chi_sq t_dist f_dist
#> 1 2.565832 17.510221 -0.07364878 0.4452523
#> 2 0.509493 14.801420 0.16121096 0.4654042
#> 3 5.050747 11.532787 1.29922524 0.5093725
#> 4 2.458743 13.503876 0.81713377 0.6331953
#> 5 1.467356 8.066145 1.54636526 1.7186081
#> 6 2.311179 25.503001 -0.12909456 0.6790994data_medium <- samplezoo("medium")
head(data_medium)
#> norm norm_2 norm_3 bern neg pois exp unif beta
#> 1 73.95331 76.83632 34.54663 0 1 3 17.683275 0.7453704 0.39834064
#> 2 36.50966 54.08104 36.36955 0 0 3 18.002636 0.1983455 0.18349521
#> 3 21.05337 59.96590 63.98394 1 0 0 5.388558 0.8319189 0.32973832
#> 4 35.36233 56.33797 68.93853 1 10 4 1.735120 0.5210453 0.20810689
#> 5 34.05864 68.98882 -11.68721 0 0 3 4.462630 0.7692889 0.58322034
#> 6 55.30236 66.04690 32.38687 0 4 5 25.550969 0.1205313 0.06132068
#> gamma chi_sq t_dist f_dist
#> 1 9.448710 17.94340 -0.7719927 6.1658079
#> 2 3.696554 15.60725 0.6671920 0.6066750
#> 3 2.491506 3.89703 0.0445972 0.6248676
#> 4 1.748696 15.12634 1.0655717 0.6091193
#> 5 9.325295 15.00274 -1.8382956 1.4365422
#> 6 1.958863 13.37806 0.5216301 3.3573803data_large <- samplezoo("large")
head(data_large)
#> norm norm_2 norm_3 bern neg pois exp unif beta
#> 1 61.14212 53.89915 62.10915 0 1 4 9.351896 0.1299596 0.41766065
#> 2 43.76001 29.49692 69.29421 0 2 1 16.302070 0.6354492 0.34433022
#> 3 41.33548 56.23732 39.00584 0 0 2 5.119934 0.6023650 0.05993020
#> 4 50.26887 60.91798 37.96349 1 1 3 8.313524 0.9545024 0.21681874
#> 5 47.86378 46.88926 26.21767 0 2 0 2.827751 0.2656276 0.09578465
#> 6 44.66521 51.91459 17.39353 1 0 2 2.223394 0.8864514 0.66051955
#> gamma chi_sq t_dist f_dist
#> 1 0.3227889 6.906108 -0.20995035 0.2353618
#> 2 2.0940828 21.989446 0.34696457 0.6208091
#> 3 16.4869507 12.235001 -0.16816956 1.3597789
#> 4 7.4552655 4.273836 -0.07584019 4.8219177
#> 5 1.2710996 8.672925 -0.75758989 0.4855973
#> 6 2.8085683 10.745570 -1.08398436 0.2965725To ensure reproducibility and introduce controlled variation in your dataset, use set.seed() before generating random data.
Reproducibility
set.seed(123)
data_large <- samplezoo("large")
head(data_large)
#> norm norm_2 norm_3 bern neg pois exp unif beta
#> 1 41.59287 83.70725 23.274065 0 1 6 6.628373 0.5468223 0.08294255
#> 2 46.54734 58.33188 35.588540 1 0 5 21.305366 0.3900809 0.63544684
#> 3 73.38062 69.26961 -2.070295 1 2 4 0.189645 0.7262119 0.11520674
#> 4 51.05763 54.31848 6.643849 0 2 2 8.479098 0.5101462 0.38184206
#> 5 51.93932 62.25090 18.040743 0 0 2 11.885521 0.2964126 0.17196046
#> 6 75.72597 71.31986 6.687576 0 1 4 6.363993 0.1442317 0.35908460
#> gamma chi_sq t_dist f_dist
#> 1 6.9893762 10.286282 -0.3814568 0.7264343
#> 2 5.4087626 6.519658 -2.3409216 0.9698166
#> 3 1.2587867 8.011417 -0.4744159 0.4329175
#> 4 0.9871787 14.780626 0.4292511 1.0227474
#> 5 2.4021943 6.799788 -0.6692669 2.7446729
#> 6 4.2109032 17.858701 -0.3370763 1.3993853set.seed(123)
data_large <- samplezoo("large")
head(data_large)
#> norm norm_2 norm_3 bern neg pois exp unif beta
#> 1 41.59287 83.70725 23.274065 0 1 6 6.628373 0.5468223 0.08294255
#> 2 46.54734 58.33188 35.588540 1 0 5 21.305366 0.3900809 0.63544684
#> 3 73.38062 69.26961 -2.070295 1 2 4 0.189645 0.7262119 0.11520674
#> 4 51.05763 54.31848 6.643849 0 2 2 8.479098 0.5101462 0.38184206
#> 5 51.93932 62.25090 18.040743 0 0 2 11.885521 0.2964126 0.17196046
#> 6 75.72597 71.31986 6.687576 0 1 4 6.363993 0.1442317 0.35908460
#> gamma chi_sq t_dist f_dist
#> 1 6.9893762 10.286282 -0.3814568 0.7264343
#> 2 5.4087626 6.519658 -2.3409216 0.9698166
#> 3 1.2587867 8.011417 -0.4744159 0.4329175
#> 4 0.9871787 14.780626 0.4292511 1.0227474
#> 5 2.4021943 6.799788 -0.6692669 2.7446729
#> 6 4.2109032 17.858701 -0.3370763 1.3993853Variation
set.seed(123)
data_large <- samplezoo("large")
head(data_large)
#> norm norm_2 norm_3 bern neg pois exp unif beta
#> 1 41.59287 83.70725 23.274065 0 1 6 6.628373 0.5468223 0.08294255
#> 2 46.54734 58.33188 35.588540 1 0 5 21.305366 0.3900809 0.63544684
#> 3 73.38062 69.26961 -2.070295 1 2 4 0.189645 0.7262119 0.11520674
#> 4 51.05763 54.31848 6.643849 0 2 2 8.479098 0.5101462 0.38184206
#> 5 51.93932 62.25090 18.040743 0 0 2 11.885521 0.2964126 0.17196046
#> 6 75.72597 71.31986 6.687576 0 1 4 6.363993 0.1442317 0.35908460
#> gamma chi_sq t_dist f_dist
#> 1 6.9893762 10.286282 -0.3814568 0.7264343
#> 2 5.4087626 6.519658 -2.3409216 0.9698166
#> 3 1.2587867 8.011417 -0.4744159 0.4329175
#> 4 0.9871787 14.780626 0.4292511 1.0227474
#> 5 2.4021943 6.799788 -0.6692669 2.7446729
#> 6 4.2109032 17.858701 -0.3370763 1.3993853set.seed(456)
data_large <- samplezoo("large")
head(data_large)
#> norm norm_2 norm_3 bern neg pois exp unif beta
#> 1 29.84718 68.13494 7.9885694 0 0 5 3.4417303 0.8866347 0.05413307
#> 2 59.32663 52.32066 21.2526086 0 3 3 0.8114356 0.7976466 0.07195440
#> 3 62.01312 62.47569 38.4789563 0 2 6 46.8038907 0.6469920 0.22555129
#> 4 29.16661 53.51086 -0.8656269 0 1 5 11.6955326 0.2036753 0.71455809
#> 5 39.28465 47.19406 47.7819258 1 1 1 0.3535625 0.3653401 0.34619912
#> 6 45.13908 63.33566 53.3620528 1 1 2 4.5592136 0.7628573 0.25880522
#> gamma chi_sq t_dist f_dist
#> 1 6.7914120 4.464348 -1.0150596 2.2557295
#> 2 3.0132520 8.062120 0.3262369 1.4955877
#> 3 4.7360954 10.969593 1.5141157 1.0766901
#> 4 5.1235878 6.249247 0.6432708 1.1251542
#> 5 6.6851637 4.358815 0.2025742 0.4754946
#> 6 0.3903841 20.019575 1.6257109 0.6653886