I have a set of data in R. 800 samples with 12 observations generated randomly between 10 and 20. From this, i have two options, if the random generated number is less than 15, then the selection is option one and above 15, its option B. Now i want to generated a set of data for option one from its mean and sd as the normal distribution where the option A is true.
Run1 <- replicate(800, rnorm(12, mean=16, sd=3.1))
Im not sure how to link my other piece of code that says whether the option A is TRUE and thus generate a value for Run1?
edit: i essentially currently have a matrix which comprises of TRUE and FALSE, for the arguments above (option A - mean=16, sd=3.1 and option B - mean=18, sd=3.3) where A is TRUE for values below 15 and FALSE for values above 15. so a matrix like this is derived (just a small sample of full matrix)
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] TRUE TRUE FALSE TRUE FALSE FALSE TRUE
[2,] TRUE TRUE FALSE FALSE TRUE TRUE TRUE
So what i want now is two matrices (one for A and on for B) which provide a mean value where A is TRUE (matrix A) from a normal distribution of the option A values detailed above and a mean value for B where it is FALSE (matrix B) from a normal distribution of the option B values detailed above ideally posessing N/A or similar where the value should not be generated in the corresponding matrix.
and then finally i would also like to combine these two matrices to form a third final matrix. may seem labourious but its necessary.
Thanks