Package 'gazahomes'

Title: Explore Published Household Indicators from a Gaza Housing Study
Description: Read nine published aggregate household indicators and their bilingual question dictionary from a Gaza housing study. Reconcile denominators with recorded exclusions and check reported percentages against the released counts. The included records are aggregate data; the package does not contain individual participant records.
Authors: Sulaiman M. S. Allouh [aut, cre]
Maintainer: Sulaiman M. S. Allouh <[email protected]>
License: MIT + file LICENSE
Version: 0.0.1
Built: 2026-11-12 13:39:00 UTC
Source: https://github.com/SulaimanAllouh/gaza-resilient-homes-research

Help Index


Check Reported Percentages and Reconcile Survey Denominators

Description

Check whether the reported percentages agree with the published counts to one decimal place and each denominator plus exclusions sums to the 302 households in the original study. This checks internal arithmetic only; it does not validate the original field records or data collection.

Usage

check_indicators(indicators = home_indicators(),
                 dictionary = home_dictionary())

Arguments

indicators

Data frame with character key indicator_id and numeric columns numerator, denominator, reported_pct. Defaults to the released table. May be a subset with a matching dictionary.

dictionary

Data frame with the same set of unique keys and numeric columns excluded_unknown and excluded_structural. Rows may be in a different order.

Details

A difference of up to 0.05 percentage points is allowed, with a small floating-point tolerance. At an exact rounding midpoint either adjacent one-decimal value is accepted, as in the upstream release. Invalid input such as duplicate or unmatched IDs, missing numeric inputs, non-integral counts, or a numerator greater than its denominator raises an error. Arithmetically inconsistent but otherwise valid rows return FALSE. The function does not test whether edited data are identical to the release.

Value

A data frame in the order of indicators. Each row contains the ID, counts and exclusions, the reported and unrounded calculated percentages (reported_pct, calculated_pct), and three logical columns: rounding_ok, denominator_ok, and ok (both).

See Also

home_indicators, home_dictionary

Examples

checked <- check_indicators()
all(checked$ok)
checked[checked$excluded_unknown > 0, c("indicator_id", "excluded_unknown")]

Read Published Household Indicators and Their Bilingual Dictionary

Description

Read the two unchanged CSV tables from the Gaza Resilient Homes Research companion, version 0.1.0. Each table has nine rows, one per indicator.

Usage

home_indicators()

home_dictionary()

Details

The non-probability household survey included 302 participating households. These marginal counts describe the participating households, not population prevalence. They cannot be joined into household records, combined into a general resilience score, or used to estimate the causal effect of an intervention. Unknown answers and structurally inapplicable answers have different meanings. A single household can contribute to multiple indicators. Use the dictionary before interpreting a denominator.

Value

home_indicators() returns a data frame with indicator_id, English domain and bilingual labels (domain, label_en, label_ar), counts (numerator, denominator), the reported percentage (reported_pct), and the thesis reference (source_table, printed_page, pdf_page).

home_dictionary() returns a data frame with indicator_id, question_id, domain_ar, response_category, counts of excluded answers (excluded_unknown, excluded_structural), English and Arabic denominator rules and interpretation notes (denominator_rule_en, denominator_rule_ar, interpretation_en, interpretation_ar), and questionnaire page references (instrument_printed_page, instrument_pdf_page). Use indicator_id to join them.

Source

Sulaiman M. S. Allouh, Gaza Resilient Homes Research: selected household indicators, version 0.1.0. https://github.com/SulaimanAllouh/gaza-resilient-homes-research/releases/tag/v0.1.0

See Also

check_indicators

Examples

a <- home_indicators()
d <- home_dictionary()
q37 <- d[d$question_id == "Q37", ]
a[a$indicator_id == q37$indicator_id,
  c("label_en", "numerator", "denominator", "reported_pct")]
q37[, c("excluded_unknown", "denominator_rule_en")]