// //Proption test command // //This command is used to test proportion of sample by T test statistic. // //Syntax without option test rate [variables]; //Syntax with option test rate [variables]/ option ; //Option mother=.yy //yy is rate of population. 0.0 < .yy < 1.0 plevel=.xx //0.0 < .xx < 1.0 .xx is level of significance. (default=0.01) side=1 or 2 //1 is single side test and 2 is both sides test. //(Caation) // variable which is tested for proporatain must be 0 or 1 as binominal data. //Example 1 //read employment data of a bank in USA. get bank@; //discriminate jobcat by worker or elite. if(jobcat >= 3) { jobw=1; } else { jobw=0; } //separate group by minority. if(minority == 0) { outrec min0; } else { outrec min1; } get min0; no=#; rename jobw=jobw0; put min0; get min1; no=#; rename jobw=jobw1; merge min0 by no; select jobw0 jobw1; //test proportion of woker by minority. test rate jobw0 jobw1; //Example 2 //average test by average of population. hand hight/ 171.6 173.6 167.6 169.1 183.0 173.7 168.3 169.9 182.3 166.0 172.8 184.1 158.9 168.1 168.5 175.3 179.6 170.7 173.1 173.6 169.1 167.9 177.8 171.8 178.1 ; if(hight > 170) { hh=1; } else { hh=0; } //execute average test for ratio of 170cm over test rate hh/ mother=0.157 ;