grouped data: generating a random error with zero group mean
Show older comments
I have a variable 'group' with 20 distinct values randomly assigned for 8000 observations. I need to generate a random error term,u, with zero mean in each group, and a specific covariance, say 10. how to do that?
I can do for an overall zero mean, as
u = random('Normal',0,10,length(group),1)
but not for zero group means.
Accepted Answer
More Answers (0)
Categories
Find more on Random Number Generation in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!