/************************************************************************/ /* Sample program to run the multi-dimensional scaling procedure */ /* in STATA and then save the coordinates in a file called */ /* coords.dat */ /************************************************************************/ #delimit ; set matsize 800; infile row col dist using mdsinput.dat; scale row col dist, dim(2); /*command line to invoke scale.ado*/ svmat C1, name(coord1); /*converts output vector into variable*/ svmat C2, name(coord2); keep coord1-coord2; keep if _n<=sqrt(_N); /*throws out missing values creates to match number elements of coordinate to sample size*/ outfile coord1 coord2 using coords.dat;