divides data into quantiles with a kernel method
res=cod_kern(data,nbqua)
* data = a (N X k) data matrix
* nbqua = a (2 x 1 ) vector with nbqua(1) = # of quantiles used to divide the data (nbqua(2) can have any value)
* res_code = a (N x (k*nbqua(1)) matrix of 0 and 1, with:
- res_code(i,1:nbqua(1)) = e with e(j)= 1 if obs i for the first variable is in the j-th quantile and 0 for all other j
- res_code(i,nbqua(1)+1:2*nbqua(1)) = e with e(j)= 1 if obs i for the second variable is in the j-th quantile and 0 for all other j
- etc.
load(GROCERDIR+'/macros/grocer/db/BusinessSurvey.dat') list_enq=dblist(GROCERDIR+'/macros/grocer/db/BusinessSurvey.dat') mat_enq=explone(list_enq(1:$-1)) res=cod_kern(mat_enq,[3 0]) // This example takes the variables contained in the database BusinessSurvey // (except for the last one, which is a summary of all others) // and codes them into 3 quantiles. | ![]() | ![]() |