Produces a random sample of k groups drawn from the same distribution with different parameters.
generateSample(N, k, distr = "gaussian")
N | sample size |
---|---|
k | number of groups |
distr | type of distribution from |
list
with two fields: numeric variable response
and factor variable factor
.
generateSample(100, 2)#> $factor #> [1] A B B B B A A B B B A B A A A A A A B B A B A B B B B B A B B A B A A B A #> [38] A A A B A A B A A B A A A A B B B B A A B B A A A B B B B A B B B A B A A #> [75] A B B A B B A A A A B B A B B A B A B A A A A B A A #> Levels: A B #> #> $response #> [1] 0.40221800 -0.25467048 -0.88092126 0.19259632 2.27959755 1.36492804 #> [7] -0.46551407 1.22163592 0.89616690 1.22624483 0.47097269 0.01395136 #> [13] 0.84017713 -1.86317778 -0.21364949 0.66371773 -1.25734831 1.01558863 #> [19] 0.08285354 0.36143609 -1.95680556 -1.52648840 0.85051330 0.01404623 #> [25] 2.85465654 0.46541170 2.76796242 1.12661013 1.84186931 1.38868804 #> [31] -0.65408315 -0.20329117 -0.27859075 -0.15325190 0.80866647 -2.93454983 #> [37] -0.14571019 -0.08351672 1.37095720 0.82457326 0.63446857 -0.11532139 #> [43] 0.05742531 0.65874994 0.23531716 1.45692297 0.89541665 0.61473051 #> [49] 0.60537798 -0.47638450 -1.77926751 -0.64234219 -0.02456646 0.31301597 #> [55] 1.09044611 0.98326199 0.32317994 -0.61758619 0.29086118 -0.49410378 #> [61] 0.61184639 -0.10183299 1.42140353 0.06466686 -2.33513344 1.05980936 #> [67] -1.17303168 0.09741056 -0.32100523 2.47181018 0.61419600 0.63077595 #> [73] -1.37078881 0.31653094 0.50751298 0.97915455 -0.58761179 0.31478129 #> [79] -1.29295942 -1.08165804 0.15235619 -0.46610904 -0.88128250 -1.10038512 #> [85] 1.53321679 -1.15703574 1.34912231 0.59198341 0.10864691 0.06548090 #> [91] 2.12096271 0.64400349 -0.64964038 0.37729197 0.22671565 2.56267853 #> [97] 0.46040871 1.14211199 0.11500096 -0.00136386 #> #> attr(,"class") #> [1] "generatedSample" "list"generateSample(100, 2, "exp")#> $factor #> [1] B B A B B A A A A B B B B B A A B A A B B B B B A B B B A B A B B B A A A #> [38] B A B A A B A B A B B B B B B B B B A A A B A A A B A A A A B B A A A B A #> [75] B A A B A A A A A A A A B B A A A A B A B A B B B B #> Levels: B A #> #> $response #> [1] 0.3161140 2.0333590 1.8273303 0.3778498 0.6249416 0.6952508 1.0237449 #> [8] 0.2945933 1.2071201 0.1618311 0.1677913 0.8562328 0.2036708 1.4399243 #> [15] 1.1421323 0.2084679 0.9668378 0.8916982 1.0751106 0.9589103 1.8588506 #> [22] 0.2772891 0.1834818 0.7365230 1.2757808 0.8406167 0.4083550 1.3689175 #> [29] 0.8287353 0.9389918 0.7104029 0.7901420 0.7695172 4.8459320 0.5151001 #> [36] 3.6236479 0.4347071 0.8837467 0.1503162 1.0891889 1.5776536 0.5756949 #> [43] 1.6457717 1.3189860 3.8005199 3.0834435 0.9587048 1.1415283 0.2591629 #> [50] 0.4487603 0.4373686 0.3871397 1.4249602 0.4162831 1.4954866 1.2388019 #> [57] 1.2729773 2.4324783 2.7515390 1.8515965 0.5098725 0.8917013 0.1374186 #> [64] 0.3077254 1.0933252 0.4149888 1.7367632 2.0696102 0.6062510 0.2780385 #> [71] 1.0490442 1.5613366 0.4228814 1.9633208 0.1986110 1.5136984 1.1813801 #> [78] 0.9486047 0.1980834 0.1155213 0.4852631 0.2320874 0.2272871 0.2198097 #> [85] 2.9543412 0.9320765 1.7321826 0.1871516 2.4067771 0.1909800 1.2051492 #> [92] 2.5563988 1.1177393 0.4390042 0.1299382 0.2507498 0.8322406 1.4549134 #> [99] 0.2030644 1.9827614 #> #> attr(,"class") #> [1] "generatedSample" "list"