help for s2s
Hai-Anh H. Dang
Minh Cong Nguyen
Kseniya Abanokova

s2s - survey to survey imputation tool

s2s depvar indepvars [if] [in] [weight]
, by(varname) from(numlist)
to(numlist) pline(varname) cluster(varname) [method(string) options]

Description

Obtaining consistent estimates on poverty over time as well as monitoring
poverty trends on a timely basis is essential for poverty reduction. However,
these objectives are not readily achieved in practice where household
consumption data are infrequently collected or not constructed using consistent
and transparent criteria. The challenge can be broadly regarded as one
involving missing data: consumption (or income) data are available in one
period but are either unavailable or incomparable in the next period(s).

Dang, Lanjouw, and Serajuddin (2017) propose a method that imputes headcount
poverty in these settings. Dang et al. (2024) employ this method and provide
further validation evidence for other poverty indicators in the
Foster–Greer–Thorbecke (FGT) family of poverty indicators, several other
vulnerability indicators, and mean consumption (income) data.

s2s implements their imputation procedures.

Recent papers that review this method and its applications include
Dang, Jolliffe and Carletto (2019) and Dang and Lanjouw (2023).

This program is designed for datasets with at least two surveys,
where consumption data are available in the survey that we impute from (the
base survey) but are missing in the survey(s) of interest (the target survey(s)
that we impute into). The control variables are non-missing in both
surveys.

The base survey and the target survey can be of a similar design
(i.e., imputing from a household consumption survey into another household
consumption survey) or a different design (i.e., imputing from a household
consumption survey into a labor force survey). Users should check that the same
control (predictor) variables have comparable distributions in both surveys.
If not, it can be useful to implement standardization procedures to ensure
these control variables have similar distributions
(Dang et al., 2017; Sarr et al., 2025).

It is also useful to inspect and remove missing observations with
the control variables in both the base survey and the target survey to avoid
potential issues before running the program. That is, the control variables
for each survey should have the same number of observations.

The estimated standard errors are obtained using the bootstrap
method, except for the method(probit) and method(logit) options
where the standard errors are analytical.

To appropriately control for complex survey design, users should
apply the Stata complex survey design command svyset before running
s2s. If the data are not svyset, the program will apply the basic
svysetting based on users' inputs from cluster(), strata(),
and wtstats() as below:
svyset `cluster' [w= `wtstats'], strata(`strata') singleunit(certainty).

Options

Required

by(varname) specifies the variable that indicates the survey year
(or round). This variable has a numeric format.

from(#) specifies the survey year (or round) that has consumption data
and that provides the underlying regression for imputation. This is the base
survey that we impute from. The number for this base survey takes one of the
values specified in the variable used in the by(varname) option. For
example, if the year variable has two values 2008 and 2010, either of which
can be specified as a number to be used.

to(#) specifies the survey year (or round) that has missing consumption
data and needs to be imputed into. This is the target survey that we impute
into. The number for this survey year takes one of the values specified in the
variable used in the by(varname) option. For example, if the year
variable has two values 2008 and 2010, either of which can be specified
as a number to be used.

method(string) specifies the imputation method. Four methods are allowed.

normal: using the linear regression (OLS) model with the distributions
of the error terms assumed to be normal. This is the default option.

empirical: using the linear regression (OLS) model with the empirical
distributions of the error terms.

probit: using the probit regression model. This option only applies to
headcount poverty. If this option is specified, the estimated standard errors
are analytical.

logit: using the logit regression model. This option only applies to
headcount poverty. If this option is specified, the estimated standard errors
are analytical.

pline(varname) specifies the variable that indicates the poverty line.
This variable has a numeric format.

cluster(varname) specifies the cluster variable or the primary sampling
unit. This variable has a numeric format.

Optional

wtstats(varname) specifies the weight variable for the summary
statistics. If left blank, unweighted estimates are provided. Note that
weights should generally be used for the summary statistics unless the data
are self-weighted, but unweighted estimates are an optional feature. This
variable has a numeric format.

alpha(integer) specifies the power of the parameter alpha as defined in
the Foster–Greer–Thorbecke (FGT) family of poverty indicators. The default
alpha is 1.

strata(varname) specifies the strata variable. This variable has a
numeric format.

pline2(varname) specifies the variable that indicates the extreme
poverty line. The extreme poverty line should be lower than the (regular)
poverty line that is specified in the option pline(). This variable
has a numeric format.

vline(varname) specifies the variable that indicates the vulnerability
line. The vulnerability line should be larger than the poverty line. This
variable has a numeric format.

lny specifies that the left-hand side variable is converted to
logarithmic terms. Note that the poverty line variables always remain in
level terms.

rep(#) specifies the number of simulations. We recommend using 1,000
simulations or more for robust estimation of standard errors. If left blank,
the default number of replications in Stata is 50.

brep(#) specifies the number of bootstraps for standard errors. We
recommend using 400 bootstraps or more for robust estimation of standard
errors. If left blank, the default number of bootstraps in Stata is 10.

seed(#) specifies the random seed number that can be used for
replication of results. The default seed is 1234567.

bseed(#) specifies the random seed number that can be used for
bootstraps of results. The default seed is 7654321.

saving(string) specifies the filename and filepath to save the
imputed data.

replace: to overwrite the existing imputed data

Saved Results

s2s returns results in e() format.
By typing ereturn list, the following results are reported:

Scalars

e(cmdline) the code line used in the session

e(pov_imp) headcount poverty rate (alpha= 0) based on
imputed data

e(pov_var) bootstrap variance of headcount poverty based
on imputed data

e(fgt1_imp) FGT poverty indicator with the specified alpha
based on imputed data

e(fgt1_var) bootstrap variance of FGT poverty indicator with
the specified alpha based on imputed data

e(pfgt1_imp) FGT poverty indicator with the specified alpha
among the poor based on imputed data

e(pfgt1_var) bootstrap variance of FGT poverty indicator with
the specified alpha among the poor based on imputed data

e(exp_imp) extreme poverty rate based on imputed data

e(exp_var) bootstrap variance of extreme poverty rate based
on imputed data

e(np_imp) near poverty (vulnerability) rate based on imputed
data

e(np_var) bootstrap variance of near poverty (vulnerability)
rate based on imputed data

e(mean_imp) mean of dependent variable based on imputed
data

e(mean_var) bootstrap variance of dependent variable based
on imputed data

e(p#_imp) percentile mean of dependent variable based on imputed
data. Available percetiles (p#) are 5, 10, 25, 50, 75, 90, 95

e(p#_var) bootstrap variance of percentile mean of dependent
variable based on imputed data

e(N1) estimation sample in the base survey

e(N2) estimation sample in the target survey

Examples

We provide some illustrative examples using the Tanzania National Panel
Survey (TZNPS) 2019/20 and 2020/21 rounds. These datasets were collected
by the Living Standards Measurement Unit (LSMS), World Bank and were
analyzed in Dang et al. (2024).
The example data are provided in the s2s package.

Note: the data may be downloaded into the current working folder instead of
the suggested path ../t/Tanzania_dataset.dta. User can type net get s2s
to download the data and subsequently type pwd to identify the current
working folder.

Example 1

For illustration, assume that consumption data are available in the
2019/20 survey round but are either missing or not comparably constructed in
the 2020/2021 survey round. We impute from the 2019/20 survey into the
2020/21 survey. The outcomes of interest include

i)	the headcount poverty rate

ii)	the near-poverty rate

iii)	the extreme poverty rate

iv)	the poverty gap index (Foster-Greer-Thorbecke (FGT) index with alpha = 1)

v)	a variant of poverty gap that focuses on the poor population (the USAID poverty gap), and

vi)	mean consumption levels.

We use the normal linear regression model, with the distribution of
the error terms assumed to be normal. The given poverty line is 475630.7 TZS,
and the given extreme poverty line is 377785.1 TZS (both poverty lines are
annual and per adult equivalent). The vulnerability line is specified at
125% of the poverty line in 2019.

The results are similar to those shown in Table 1 in Dang et al. (2024).

. use Tanzania_dataset.dta, clear

. clonevar dep = lnpcex

. replace dep = . if year == 2021

. gen vline = povline*1.25

* Model 1

. global xvars hhsize age female pri lws ups age0to14sh age15to24sh age60tosh wageemp selfemp area_1 area_2 area_4

. s2s dep $xvars, by(year) from(2019) to(2021) pline(povline) method(normal) cluster(psu) wt(hhszwt) strata(strata) pline2(epovline) vline(vline) lny rep(1000) brep(1000)

* Model 9

. s2s dep $xvars lnpcewg, by(year) from(2019) to(2021) pline(povline) method(normal) cluster(psu) wt(hhszwt) strata(strata) pline2(epovline) vline(vline) lny rep(1000) brep(1000)

* Comparing with estimates using the actual consumption data

. use Tanzania_dataset.dta, clear

. svyset psu [w= hhszwt ], strata( strata) singleunit(certainty)

. gen vline = povline*1.25

. generate poor = lnpcex<ln(povline)

. generate epoor = lnpcex<ln(epovline)

. gen vpoor = ( lnpcex >= ln( povline) & lnpcex < ln( vline ))

. generate pcex = exp( lnpcex)

. generate fgt = poor*(( povline - pcex )/ povline )^(1)

. svy: mean poor epoor vpoor fgt if year == 2021

. svy, subpop(poor): mean fgt if year == 2021

Example 2

We can generate a dataset with imputed consumption for each household.
The example below shows a dataset ("predicted_data.dta") that has 100 imputed
consumption variables for each household. The number of imputed consumption
variables is specified by the number in the rep() option. The imputed
data is saved in the current working folder, see pwd.

. use Tanzania_dataset.dta, clear

. clonevar dep = lnpcex

. replace dep = . if year == 2021

. global xvars hhsize age female pri lws ups age0to14sh age15to24sh age60tosh wageemp selfemp area_1 area_2 area_4 lnpcewg

. s2s dep $xvars, by(year) from(2019) to(2021) pline(povline) method(normal) cluster(psu) wt(hhszwt) strata(strata) lny rep(100) brep(100) saving("predicted_data.dta") replace

Example 3

We can give more weight to poorer people by using a higher value for
alpha in the FGT index, including the variant of poverty gap that focuses
on the poor population.

. use Tanzania_dataset.dta, clear

. clonevar dep = lnpcex

. replace dep = . if year == 2021

. global xvars hhsize age female pri lws ups age0to14sh age15to24sh age60tosh wageemp selfemp area_1 area_2 area_4 lnpcewg

. s2s dep $xvars, by(year) from(2019) to(2021) pline(povline) method(normal) cluster(psu) wt(hhszwt) strata(strata) lny rep(10) brep(100) a(5)

Example 4

We can impute for headcount poverty using the probit model instead
of the linear regression model.

. use Tanzania_dataset.dta, clear

. clonevar dep = lnpcex

. replace dep = . if year == 2021

. global xvars hhsize age female pri lws ups age0to14sh age15to24sh age60tosh wageemp selfemp area_1 area_2 area_4 lnpcewg

. s2s dep $xvars, by(year) from(2019) to(2021) pline(povline) method(probit) cluster(psu) wt(hhszwt) strata(strata) lny rep(1000) brep(1000)

Example 5

We can use the empirical distribution of the error terms instead of
the default normal linear regression.

. use Tanzania_dataset.dta, clear

. clonevar dep = lnpcex

. replace dep = . if year == 2021

. global xvars hhsize age female pri lws ups age0to14sh age15to24sh age60tosh wageemp selfemp area_1 area_2 area_4 lnpcewg

. s2s dep $xvars, by(year) from(2019) to(2021) pline(povline) method(empirical) cluster(psu) wt(hhszwt) strata(strata) lny rep(1000) brep(1000) a(1)

References

Dang, H.-A. H. and Nguyen, M.C. (2014) POVIMP: Stata Module to
Provide Poverty Estimates in the Absence of Actual Consumption Data.
Statistical Software Components S457934, Boston College,
Department of Economics.

Dang, H.-A. H. and Lanjouw, P. F. (2023). "Regression-based
Imputation for Poverty Measurement in Data Scarce Settings". In Jacques Silber. (Eds.).
Handbook of Research on Measuring Poverty and Deprivation. Edward Elgar Press.

Dang, H.-A. H., Jolliffe, D., & Carletto, C. (2019). Data gaps,
data incomparability, and data imputation: A review of poverty measurement
methods for data‐scarce environments. Journal of Economic Surveys, 33(3), 757-797.

Dang, H.-A. H., Lanjouw, P. F., & Serajuddin, U. (2017). Updating
poverty estimates in the absence of regular and comparable consumption data:
methods and illustration with reference to a middle-income country.
Oxford Economic Papers, 69(4), 939-962.

Dang, H.-A. H., Kilic, T., Abanokova, K., & Carletto, C. (2024).
Imputing Poverty Indicators without Consumption Data. World Bank Policy
Research Working Paper no. 10867.

Sarr, I., Dang, H. A. H., Guzman Gutierrez, C. S., Beltramo, T., &
Verme, P. (2025). Using cross-survey imputation to estimate poverty for
Venezuelan refugees in Colombia. Social Indicators Research.
DOI: https://doi.org/10.1007/s11205-024-03492-8

Authors

Hai-Anh H. Dang, Senior Economist, World Bank, USA, hdang@worldbank.org

Minh Cong Nguyen, Senior Economist, World Bank, USA, mnguyen3@worldbank.org

Kseniya Abanokova, Economist, World Bank, USA, kabanokova@worldbank.org

Suggested citation

Dang, H. A. H., Nguyen, M. C., and Abanokova, K. (2025).
s2s: Stata module to impute poverty in the absence of consumption (income) data.
World Bank, Development Data Group and Global Poverty Department.
Available from (insert Repec link)

Acknowledgements

We use the user-written program epctile from
https://staskolenikov.net/stata
that provides estimation and inference for percentiles.

We would like to thank Kit Baum and various colleagues at and outside
the World Bank for comments on previous versions of the program. This is a work
in progress. This program builds on and adds more modelling options to a
previous version named povimp (Dang and Nguyen, 2014). (But note
povimp offers additional test statistics for imputed headcount poverty).

We would like to thank the United States Agency for International
Development (USAID) and UK Foreign Commonwealth and Development Office
(FCDO) for funding assistance.

All errors and omissions are exclusively our responsibility.