Code S1 - Supplementary Materials, manuscript forests-4559165
R code implementing the fuzzy rule-based system and the reported analyses

CONTENTS
  00_settings.R                     paths used by all scripts
  01_build_analysis_data.R          composite indices, fuzzy rule-based system,
                                    both rule bases, primary sample (N = 465)
                                    and available-item sample (N = 477)
  02_alternative_classifications.R  crisp application of the rules, k-means
                                    clustering, latent class model
  03_results.R                      Table A1, Tables 2-8, Tables S1a-S8b, measurement
                                    summaries, check of all 80 possible input
                                    profiles, comparison with reported values
  04_figures.R                      Figures 3, 4 and 5
  05_round2_sensitivity.R           added in the second round of revision:
                                    clustering within municipalities
                                    (Section 3.4), households with no recorded
                                    service selections (Section 3.7),
                                    Table S9

RULE BASES
  The complete 27-rule base (reference specification, Table A1) and the
  initial 12-rule base (sensitivity analysis, Table S3) are defined in
  01_build_analysis_data.R (objects rules27 and rules12; 1 = Low,
  2 = Medium, 3 = High; columns: administrative support, information and
  education support, market and infrastructure support, output level).
  Membership functions: Low (0, 0, 0.4), Medium (0.2, 0.5, 0.8),
  High (0.6, 1, 1). Singleton output values: 0.20, 0.50, 0.80.
  Classification thresholds: 0.35 and 0.65; a score on a threshold is
  assigned to the higher group.

HOW TO RUN
  1. Set the R working directory to the folder that contains the scripts.
  2. Place the survey data file at data/household_survey.csv, or choose
     the file when asked.
  3. Run the scripts in the order 01, 02, 03, 04, 05.
  All results are written to the folder "output". Script 03 ends with a
  table that compares key results with the values reported in the article.

DATA
  The household survey data are not included. Restrictions apply to their
  availability (see the Data Availability Statement of the article). The
  file output/analysis_data.rds created by script 01 contains household-level
  data and must not be redistributed.

SOFTWARE
  R 4.4.2. Package poLCA 1.6.0.2 is required for the latent class model
  (script 02). Packages survey and lme4 are required for the clustering
  analysis (script 05). All other computations use base R. Random seeds are set in
  the scripts (bootstrap: 2,000 household-level resamples).
