看drawnorm命令的例子
Examples
Generate 2,000 independent observations (x,y); x with mean 2 and standard deviation .5; y with mean
3 and standard deviation 2
. matrix m = (2,3)
. matrix sd = (.5,2)
. drawnorm x y, n(2000) means(m) sds(sd)
. summarize
Draw a sample of 1,000 observations from a bivariate standard normal distribution, with correlation
0.5
. clear
. matrix C = (1, .5 \ .5, 1)
. drawnorm x y, n(1000) corr(C)
. summarize
Equivalently,
. clear
. matrix C = (1, .5, 1)
. drawnorm x y, n(1000) corr(C) cstorage(lower)
. summarize