//
//clear command
//
//This command clears any enviroments as follow.
//(1)current file close
//(2)project dir defined by prj command
//(3)accume variables defined by accume declare 
//(4)vector variables defined by vector declare
//
//(Quation)
//Clear command is needed befor generate record by for_loop and outrec.
//Otherwize for_loop and outrec is executed by each record of current file.
//

//Syntax
clear;

//
//Example   
//Generate normal distirbution which same distribution of original data 
//
//Read original data which are subject points 
get school.csv@;

//Test nomal distribution. test normal x1 x2 y;

//View y distribution. plot hist y;

//Get statistic and save propety to tempolay file. statis x1 x2 y;

//Save statistic propertis to tempolay file to use by outlook function. get freq@ana; put f_stat; //Clear current file which is statistic property data. clear; //Generate 100 record by for_loop and outrec. for(i=1;i<=100;i++) { //Get average and std from file by outlook function. x1m=outlook(f_stat,"_items_","AVERAGE","y"); x1v=outlook(f_stat,"_items_","STD","y"); //Generate normal distribution by average and std yy = ranstd(x1m,x1v); //Generete record. outrec; }

//View yy statistic propety to compare with original statistic. statis yy;

//View histgram by 100 records. plot hist yy;