Governance practices and citizen trust in selected public institutions in Kumasi, Ghana
Description
Survey data on governance practices and citizen trust in selected public institutions in Kumasi, Ghana
Files
Steps to reproduce
import pandas as pd import numpy as np from scipy import stats import statsmodels.api as sm from statsmodels.stats.outliers_influence import variance_inflation_factor pd.set_option("display.width", 120) pd.set_option("display.max_columns", 20) DATA_PATH = "CITIZEN_TRUST_IN_GHANA_S_PUBLIC_SECTOR_A_STUDY_OF_SELECTED_PUBLIC_INSTITUTIONS_IN_KUMASI_.csv" def hr(title): """Print a section header to make console output easy to scan.""" print("\n" + "=" * 78) print(title) print("=" * 78) # ============================================================================== # 1. LOAD DATA AND CONSTRUCT VARIABLES # ============================================================================== hr("1. LOAD DATA AND CONSTRUCT COMPOSITE VARIABLES") df = pd.read_csv(DATA_PATH) cols = list(df.columns) # Column layout (0-indexed), confirmed against the questionnaire structure # described in the manuscript's Methodology section: # cols[6] = institution identifier (free text, contains abbreviation # in parentheses, e.g. "... (ECG)") # cols[7:17] = Section B, Governance Practices, 10 items # [0:4] Accountability & Transparency (4 items) # [4:6] Responsiveness (2 items) # [6:8] Service Delivery (2 items) # [8:10] Citizen Participation (2 items) # cols[17:21] = Section C, Citizen Perceptions, 4 items # cols[21:29] = Section D, Citizen Trust, 8 items inst_col = cols[6] gov_items = cols[7:17] acc_trans_items = gov_items[0:4] respons_items = gov_items[4:6] serv_del_items = gov_items[6:8] cit_part_items = gov_items[8:10] perc_items = cols[17:21] trust_items = cols[21:29] df["Institution"] = df[inst_col].str.extract(r"\((\w+)\)") # Composite scores = mean of constituent items, as stated in the # Methodology ("Composite scores for each construct were computed as the # mean of constituent items within each scale"). df["AccTrans"] = df[acc_trans_items].astype(float).mean(axis=1) df["Responsiveness"] = df[respons_items].astype(float).mean(axis=1) df["ServDelivery"] = df[serv_del_items].astype(float).mean(axis=1) df["CitPartic"] = df[cit_part_items].astype(float).mean(axis=1) df["GovPractices"] = df[gov_items].astype(float).mean(axis=1) df["CitizenPerceptions"] = df[perc_items].astype(float).mean(axis=1) df["CitizenTrust"] = df[trust_items].astype(float).mean(axis=1) print(f"N = {len(df)}") print(f"Institutions: {df['Institution'].value_counts().to_dict()}")