I want to check if the numbers produced by my random number generator are uniformly distributed. My code is below - is the statistical approach correct?
Disclaimers - this isn't homework, it's personal interest. And for the 'what research have you done' brigade, I have done a fair bit of rummaging on stats.stackexchange, and while there's plenty of similar questions I cannot find any that answer the above question specifically.
c(126L, 106L, 182L, 162L, 232L, 130L, 113L, 75L, 191L, 19L, 242L, 245L, 152L, 241L, 240L, 140L, 208L, 163L, 174L, 194L, 69L, 194L, 200L, 7L, 213L, 145L, 170L, 198L, 50L, 207L, 247L, 116L, 162L, 173L, 168L, 232L, 23L, 156L, 62L, 165L, 19L, 206L, 250L, 150L, 170L, 29L, 62L, 26L, 209L, 120L, 131L, 170L, 197L, 1L, 153L, 195L, 250L, 29L, 151L, 912L, 139L, 23L, 211L, 237L, 10L, 248L, 119L, 138L, 118L, 190L, 207L, 136L, 13L, 55L, 117L, 239L, 90L, 18L, 196L, 120L, 140L, 170L, 189L, 44L, 250L, 131L, 241L, 150L, 86L, 146L, 84L, 138L, 56L, 125L, 199L, 188L, 225L, 67L, 63L, 914L, 77L, 190L, 121L, 206L, 150L, 226L, 50L, 77L, 76L, 36L, 12L, 126L, 169L, 168L, 160L, 199L, 173L, 68L, 192L, 21L, 246L, 250L, 88L, 244L, 196L, 244L, 46L, 142L, 133L, 224L, 73L, 78L, 38L, 222L, 174L, 39L, 49L) -> numbers_from_random_app
table(numbers_from_random_app) -> distribution
stats::chisq.test(distribution)
table(numbers_from_random_app)and see if that's the object you want to be testing. – Sal Mangiafico Feb 02 '23 at 18:09A = round(rlnorm(100, 0, 1), 2); hist(A); Table = table(A); Table; chisq.test(Table)– Sal Mangiafico Feb 02 '23 at 19:20