//
//Vector variable
//
//You can declare vector variable.Vector can be defined for 1 or 2 dimension.

//Syntax for 1 dimension
vector [vectorname][size]; 

//Syntax for 2 dimension
vector [vectorname][size1][size2];
//(Caution)
//size1 must be larger than size2 (size1 >= size2).

//Remark
//In the case of vec[20], they are written in file as follows.
$vec_1,vec_2,vec_3, ..... ,vec_20
//In the case of vec[3][2],they are written in file as follows.
$vec_1,vec_2,vec_3,vec_4,vec_5,vec_6
//vec[i][j] -> vec_x  x=3*(i-1)+j;


//Example 1 vectorize inputed data.
get haz2@;


//vectorize inputed data for different names of series variables. //Otherwize you can directly set as 'vector tim[32]' . // vector vec[12]=tim1_12; for(i=0;i<=12;i++) { censor=1; pstime=i; if(i == 0) { default=0; } else { default=vec[i]; } grade=rating; outrec; } select grade censor pstime default;

//Example 2 writes standard distribution. clear; vector v[4]; for(i=1;i<=100;i++) { for(j=1;j<=4;j++) { v[j]=ranstd(j,1.0); } outrec; } plot scat v_1 - 4 ;