!
! A mixture of two normals from:
!
! Everitt B.S. and Hand D.J. (1981) Finite mixture distributions.
! Chapman and Hall. p.46.
!
! means:       19.96   26.16
! variances:    4.6225  7.6176
! proportions:  0.65    0.35
!
!
set ple -1
macro mixexample
 if (index > %runtot and index <= (%runtot + %3)) then %1=%2
 eval (define runtot (+ runtot %3))
;;;;

set loc yvar
sim ped 1000 1 1
run
eval (define runtot 0)
mixexample yvar 15.5 10    
mixexample yvar 16.5 21    
mixexample yvar 17.5 56    
mixexample yvar 18.5 79    
mixexample yvar 19.5 114   
mixexample yvar 20.5 122   
mixexample yvar 21.5 110   
mixexample yvar 22.5 85    
mixexample yvar 23.5 85    
mixexample yvar 24.5 61    
mixexample yvar 25.5 47    
mixexample yvar 26.5 49    
mixexample yvar 27.5 47    
mixexample yvar 28.5 44    
mixexample yvar 29.5 31    
mixexample yvar 30.5 20    
mixexample yvar 31.5 11    
mixexample yvar 32.5 4     
mixexample yvar 33.5 4     
                  
mix yvar 1
mix yvar 2
lrt

