The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Data » Dataset use in Stata » Varlist not allowed
Varlist not allowed Mon, 24 July 2017 23:52
 sumonrupop Messages: 21Registered: 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'
}

Md. Nuruzzaman Khan
Re: Varlist not allowed [message #12862 is a reply to message #12858] Tue, 25 July 2017 08:05
 Bridgette-DHS Messages: 1620Registered: February 2013 Senior Member

Following is a response from Senior DHS Stata Specialist, Tom Pullum:

DHS staff will not help with this kind of question. I hope that other forum users will come to the rescue.
Re: Varlist not allowed [message #12866 is a reply to message #12858] Tue, 25 July 2017 09:38
 schoumaker Messages: 36Registered: May 2013 Location: Belgium 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
 Previous Topic: Decomposition of concentration index Next Topic: DECOMPOSING ERREYGERS CONCENTRATION INDEX - STATA
Goto Forum:

Current Time: Wed May 22 05:20:38 Eastern Daylight Time 2019