Dear Austin,
thanks a lot for your kind and helpful reply.
Kind Regards,
Carlo
-----Messaggio originale-----
Da: [email protected]
[mailto:[email protected]] Per conto di Austin Nichols
Inviato: lunedì 13 ottobre 2008 15.35
A: [email protected]
Oggetto: Re: st: Latin Hypercube's sampling with Stata
Carlo Lazzaro <[email protected]> :
If I understand the question correctly, one method would be to make a
Stata dataset with all possible combinations of x variables and then
sample from that dataset using whatever method is desired (e.g. help
sample, help bsample, findit gsample), e.g.
clear
range x1 1 4 4
range x2 1 4
fillin x1 x2
ssc install gsample
ssc install moremata
mata mata mlib index
gsample 160
tab x?
* here is a start on orthogonal sampling (also programmable in Mata
but not done yet to my knowledge):
clear
range x1 1 4 4
range x2 1 4
fillin x1 x2
g u=uniform()
sort x1 u
by x1: drop if x1==1 & _n>1
forv i=2/4 {
loc used=x2[`=`i'-1']
by x1: drop if x1==`i' & x2==`used'
by x1: drop if x1==`i' & _n>1
}
li
On Mon, Oct 13, 2008 at 8:54 AM, Carlo Lazzaro
<[email protected]> wrote:
> Dear Statalisters,
> is there a way for doing Latin Hypercube's sampling with Stata 9.2/SE?
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/