/* ******************************************************************************************; * *CTAFILE.mac *By John R. Hipp * *Updated May 20, 2003 * *This program is used when performing the Vanishing Tetrads test on categorical data; * *Reads in ACM and polychoric matrix files from M-plus; * *The polychoric file statements are optional, as it can be pasted directly *in to CTANEST1.mac instead; * ******************************************************************************************; */ %macro CTAFILE(vars=, mplus=0, lisrel=0, pcm=0, pcmfile=, acmfile=); %let rows = %eval (&vars*(&vars-1)/2); %let cells = %eval (&rows *(&rows+1)/2); %let cellpoly = %eval (&vars*(&vars+1)/2); /* *********************************************************; *bringing the ACM; *********************************************************; */ data acm1; infile "&acmfile" lrecl=6000; if &mplus = 1 then input x1-x&cells; if &lisrel = 1 then input (x1-x&cells) (e23.); run; /* *********************************************************; *Optional: bringing the polychoric; *********************************************************; */ %if &pcm=1 %then %do; data pchor1; infile "&pcmfile"; input x1-x&cellpoly; run; %end; %mend;