Hello everyone, I am generating categorical data (X=1, X=2, X=3) with the same probability (.333,.333,.333). I want to ask if there is a way to simulate data for these three groups and ensure that the groups have the same number of observations. Thanks, DATA SIM; call streaminit(331980); totaln=&NSIM*&NOBS; DO I=1 TO totaln; X=RAND('Table',.333, .333.333); D1=0; D2=0; if X=1 THEN DO; D1=0; D2=0; end; if X=2 THEN DO; D1=1; D2=0; end; if X=3 THEN DO; D1=0; D2=1; end; M = &i0m + (&a1*D1)+(&a2*D2)+(&errorm)*RAND('NORMAL'); XM=x*m; D1M=D1*M; D2M=D2*M; Y= &i0y +(&cp1*D1)+(&cp2*D2)+(&b*M)+(&h1*D1M)+ (&h2*D2M)+(&errory)*RAND('NORMAL'); OUTPUT; END;
... View more