--- license: cc-by-4.0 pretty_name: "Pakistan crop statistics: area, production and yield of 79 crops, 1961-2024 (FAOSTAT)" language: - en task_categories: - tabular-regression tags: - pakistan - pakdata - tabular - agriculture - crops - faostat - food-security size_categories: - 1K= 1700, e.g. "Cereals, primary") and livestock. The wide year columns are reshaped to one row per (crop, year). 438 crop-years for which FAO publishes no yield were dropped: in all of them FAO reports a zero harvested area (408, mostly 1961-1981 for vegetables and minor fruits that were not reported separately then) or no area at all (30, "Other oil seeds" 1961-1990). No value was filled, interpolated or recomputed. Rows are sorted by ``crop``, ``year``. **Caveats and known biases:** - National totals only; reporting conventions changed over time (e.g. many vegetables start in 1980, newly reported fruits such as olives, persimmons, strawberries and grapefruit appear only after 2016). ``Oranges`` has a gap 1991-2015. A crop's first year in the file is where FAO starts reporting it, not when it was first grown. - Kinnow, Pakistan's main citrus, is recorded by FAO under ``Tangerines, mandarins, clementines``; ``Mangoes, guavas and mangosteens`` mixes three fruits; ``... n.e.c.`` items are residual groups of many minor crops. - FAO yields are computed from production and area; for a few small crops with rounded areas, ``production_tonnes / area_harvested_ha * 1000`` differs from ``yield_kg_per_ha`` by up to ~11%. - FAO figures can differ from Pakistan Bureau of Statistics / Ministry of National Food Security figures (e.g. fiscal-year vs calendar-year attribution); FAO revises past values between releases. - Yields span 219 to 74,252 kg/ha across crops (cereals vs. sugar cane/vegetables), so crop identity alone explains most of the variance: a per-crop mean of log-yield already gives R^2 ~0.94 under random 5-fold CV. Model ``log(yield)`` and evaluate with a time-based split (train on earlier years, test on later ones) or within crops. A random row split lets the model interpolate between neighbouring years of the same crop, which flatters the score. - No weather, irrigation, fertiliser or price variables are included. **Suggested tasks:** 1. Regression (beginner): predict ``log(yield_kg_per_ha)`` from ``crop``, ``year`` and ``area_harvested_ha``; train on years <= 2014, test on 2015-2024. A one-hot + RandomForest baseline gives R^2 ~0.92 on the log scale. 2. Time series (intermediate): forecast wheat, rice or seed-cotton yield one year ahead from lagged yields; compare against a naive "last year" forecast. 3. Clustering: build a crop x year matrix of standardised yield trends and cluster crops by growth pattern (e.g. Green Revolution cereals vs. stagnant pulses). 4. Classification / data quality: predict whether a value is official (``yield_flag == "A"``) from crop group, year and area, and discuss why missing-data mechanisms matter. **Citation / attribution:** FAO. 2025. FAOSTAT: Production: Crops and livestock products. Accessed on 29 November 2026. https://www.fao.org/faostat/en/#data/QCL. Licence: CC-BY-4.0. Use of this data does not imply any endorsement by FAO of pakdata or of any analysis made with it. ``` ## Citation and attribution FAO. 2025. FAOSTAT: Production: Crops and livestock products. Accessed on 29 November 2026. https://www.fao.org/faostat/en/#data/QCL. Licence: CC-BY-4.0. Packaged by pakdata (https://github.com/junaidaslam2006/pakData). Build script: [`scripts/build_pak_crops.py`](https://github.com/junaidaslam2006/pakData/blob/main/scripts/build_pak_crops.py).