The do files are designed to allow users to add variables according to their needs. As explained above (see “Coding Steps”), variables are created in discrete modules within each country-wave pair. They can then be stored in a user-defined location that is dedicated to temporary files. Users can therefore add their own variables by writing their own scripts to pre-process the data, and incorporate them into the final dataset by plugging their custom-made variables into the relevant dataset and country (see Figure 3 for an example). The only requirement for merging in new data is that the linking identifiers match. Users may refer to the variable directories to identify the variable name of the linking identifier in the raw data (Supplementary tables 1 to 5). The LSMS-ISA raw data, which is publicly available (see Table 1), is typically structured according to questionnaire modules (e.g. module 1 from household questionnaire). Users need to consult the survey questionnaires to identify which modules contain the variables of their interest and pull the variables from the corresponding raw data file. Once a user-made variable has been created from the raw LSMS-ISA data, and it is uniquely identified by the linking identifier, it can be merged in the appropriate dataset (either plot-crop, plot, household, or individual), within one of the do files prefixed with “Append_”. Users may follow the example of how other variables are merged into the HP data frames to do this. Once the new variable is successfully merged in the dataset, the remaining do files can be executed without further modification.

# _<mark>Performing analysis with the HP</mark>_

<mark>The LSMS-ISA surveys are designed to be nationally representative. To obtain nationally representative estimates, users need to make use of the sampling weights, EA identifiers, and strata identifiers. As mentioned above, these three variables are present in all four datasets of the HP. Statistical software typically provide packages that enable use of these variables to estimate nationally representative indicators, such as Stata’s</mark> _<mark>svy</mark>_ <mark>set of commands which allow the running of statistical models with complex survey data. Users must use the sample weights (</mark> _<mark>pw</mark>_ <mark>) as probability weights to obtain valid point estimates, EA identifiers (</mark> _<mark>ea_id_obs</mark>_ <mark>) and strata identifiers (</mark> _<mark>strataid</mark>_ <mark>) to obtain valid standard errors.</mark> <mark>As noted above, variables that identify panel units end with the</mark> _<mark>_obs</mark>_ <mark>suffix. Users are advised to use these variables when performing panel analysis. Panel identifiers exist for EAs (</mark> _<mark>ea_id_obs</mark>_ <mark>), parcels (</mark> _<mark>parcel_id_</mark>_ <mark>obs), households (</mark> _<mark>hh_id_obs</mark>_ <mark>)</mark> _<mark>,</mark>_ <mark>individuals (</mark> _<mark>indiv_id_obs</mark>_ <mark>), plot managers (</mark> _<mark>plot_manager_id_obs</mark>_ <mark>), and respondents (</mark> _<mark>respondent_id_obs</mark>_ <mark>). Moreover, while EA and stratum variables remain fixed, households may move during the lifetime of the panel. A variable named</mark> _<mark>geocoords_id</mark>_ <mark>is provided to identify each unique set of geocoordinates. The time dimension is identified by</mark> _<mark>country</mark>_ <mark>,</mark> _<mark>wave</mark>_ <mark>(denoting the survey round), and</mark> _<mark>season</mark>_ <mark>variables. The latter is necessary to distinguish between seasons in Uganda.</mark> <mark>Variables identifying the administrative area codes of the households’ residences were also added to the dataset (</mark> _<mark>admin_1, admin_2, admin_3</mark>_ <mark>). However, codes may have changed throughout the lifetime of the panel (for instance, when administrative boundaries were redrawn) such that we cannot guarantee persistent identifiers. When possible, administrative area names were also included (</mark> _<mark>admin_1_name, admin_2_name, admin_3_name</mark>_ <mark>).</mark> <mark>We have deliberately refrained for extensive outlier correction, as these may depend on users’ analytical preferences. Users are therefore advised to check for extreme and outlier values, and winsorize or trim variables as they see fit. Moreover, missing values were not imputed, except for GPS plot areas (see the Methods section above). Users may wish to implement imputation methods that suit their research needs.</mark> 18