/*************************************************/ /* Written by: */ /* */ /* G. John Geldhof */ /* Graduate Student, Department of Psychology */ /* University of Kansas */ /* */ /* AND */ /* */ /* Ihno Lee */ /* Graduate Student, Department of Psychology */ /* University of Kansas */ /* */ /* For: */ /* */ /* HTTP://QUANT.KU.EDU */ /* */ /*************************************************/ /*This program imports a LISREL LY matrix and expands it so it can be used as starting values for a model with additional constructs*/ /*Indicate the location of the LY matrix; only edit information in the quotes*/ filename ly "C:\Documents and Settings\psychlab\Desktop\SAS CODES FOR SI\intfact.ly"; /*Indicate the location and filename for your output*/ filename out "C:\Documents and Settings\psychlab\Desktop\SAS CODES FOR SI\edited.ly"; /*Tell the program how many constructs (y-side) existed when the input matrix was created. To do this, change the value "p2" below to read "p#", where # is the number of constructs present in one group of the model that created the input matrix. */ data usely; infile ly; input (p1-p2) (13.) @@; run; proc IML; /*Specify the number of constructs you want to add*/ newconst = 2; /************************************** *************************************** ********** DO NOT EDIT BELOW ********** ********** THIS POINT ********** *************************************** **************************************/ use usely; read all into matly; add0 = j(nrow(matly),1,0); do i = 1 to newconst; matly = matly || add0; end; New_LY_Matrix = matly; print new_ly_matrix; create new FROM New_LY_Matrix; append FROM New_LY_Matrix; quit; data test; set new; blank = ' '; run; data test; set test; file out; put col1--blank; run;