I am trying to simulate the diet of the participants of an observational cohort (say n=10,000 - but could be larger). The purpose is two-fold: first I would like to use this to test some scripts, but second it would also be useful for teaching (to provide students with data as close as possible to real life without using actual data - which can be difficult).
The data I would like to simulate is the amount of intake of different foods (several 100), which in a future step can then be used to estimate intake of carbohydrates, fats etc.
My initial approach has been the following (i: subject, j: food, D: amount consumed; min: minimum j amount consumed, max: maximum j consusmd)
D[i,j] <- runif(1,min[j],max[j])
(I have also used log-normal or normal distributions, this does not make a big difference)
The 'problem' occurs if I create several simulated cohorts. Each simulated participant will be different, but the mean intake of each food will be virtually the same. In hindsight, this is not surprising as the (pesudo)random values are all taken from the same distribution.
What I am looking for is a method to create different simulated datasets, and this might be clearer with an example with just one food (say wine, average daily consumption between 0 and 750 g):
A single cohort (n=10,000) can thus be simulated as:
D <- runif(n,0,750)
The mean wine intake in this cohort is approximately 375 g/d, and this remains fairly constant with every repeat.
What I would like is to have not only different intakes in each individual, but also a different cohort-mean for each simulation. Is this possible?