| 
		
			| Varlist not allowed  [message #12858] | Mon, 24 July 2017 23:52  |  
			| 
				
				
					|  sumonrupop Messages: 23
 Registered: August 2015
 Location: Rajshahi
 | Member |  
 |  |  
	| Dear All, I am trying to do decomposition analysis using DHS data. I wrote the command given below. But when I run the program, it is stopped and shows error message "varlist not allowed". Can anyone help me please to solve this problem?
 
 //use cdelivery_decomposfinal, clear
 **concentration index_corrected version
 egen raw_rank= rank(quintile), unique
 sort raw_rank
 quietly sum v005
 gen wi=v005/r(sum)
 gen cusum=sum(wi)
 gen wj=cusum[_n-1]
 replace wj=0 if wj==.
 gen rank=wj+0.05*wi
 //drop raw_rank wi cumsum wj
 
 qui sum m17_1[aw=v005]
 scalar mean= r(mean)
 cor m17_1 rank [aw=v005], c
 sca c=(2/mean)*r(cov_12)
 sca list c
 sca CI=8*r(cov_12)
 //sca list c
 display "concentration index by convenient covariance method", CI
 
 **Computing the semi-elasticities, CI and contributions of each factor
 //clear matrix
 global X "quintile1 quintile2 quintile3 quintile4 quintile5 resd1 resd2"
 qui regress m17_1 $X [pw=v005]
 ***decomposition start here
 foreach x of global X {
 qui {
 sca b_'x'=_b['x']
 corr rank 'x' [pw=v005], c
 sca cov_'x'=r(cov_12)
 sum 'x' [pw=v005]
 sca elas_'x'= (b_'x'*r(mean))/m_y
 sca CI_'x'=2*cov_'x'/r(mean)
 sca con_'x'= elas_'x'*CI_'x'
 sca prcnt_'x'= con_'x'/CI
 }
 di "'x' elasticity:", elas_'x'
 di "'x' concentration index:'", CI_'x'
 di "'x' contribution:", con_'x'
 di "'x' percentage contribution:", prcnt_'x'
 }
 Thanks in advanece
 
 Md. Nuruzzaman Khan
 |  
	|  |  | 
	|  | 
	| 
		
			| Re: Varlist not allowed  [message #12866 is a reply to message #12858] | Tue, 25 July 2017 09:38  |  
			| 
				
				
					|  schoumaker Messages: 66
 Registered: May 2013
 Location: Belgium
 | Senior Member |  |  |  
	| you should type "set trace on" and run your program again to identify precisely where the program stops. Best,
 Bruno
 
 
 Bruno Schoumaker
 Centre for Demographic Research
 Université catholique de Louvain
 |  
	|  |  |