ScotGovAnalysis/opendatascot

ods_dataset doesn't work for population-estimates-2011-datazone-linked-dataset

Opened this issue · 7 comments

ods_dataset doesn't seem to work for population-estimates-2011-datazone-linked-dataset

When running ods_structure('population-estimates-2011-datazone-linked-dataset') it appears there are several categories: refArea, refPeriod, measureType, age, sex. However, various queries don't work. For example:

ods_dataset('population-estimates-2011-datazone-linked-dataset',
refArea = 'Summerston Central and West - 06',
measureType = 'Count',
refPeriod = '2021')

returns a tibble with 0 rows and 6 columns. However the example from the README for "homelessness-applications" does work fine:

ods_dataset("homelessness-applications",
applicationType = "all-applications",
refPeriod = c("2015/2016", "2016/2017"))

You will need to use the datazone code to filter on refArea. The guidance should make this clearer but I'm afraid I haven't had time to update this. Please use the datazone code S01010345 it will filter for Summerston Central and West - 06.

Thanks for responding so quickly. I tried codes too:

ods_dataset('population-estimates-2011-datazone-linked-dataset',
refArea = 'S01010345',
measureType = 'Count',
refPeriod = '2021')

gives the same output.

Ok, that definitely isn't right. I'll look into it.

I believe this dataset, despite it's name, does not actually have datazones as a reference area. It has Countries, Council Areas, and Health Board Areas. Although these are based on data aggregated up from datazones, the datazone level data itself is not present so filtering for a datazone will correctly return an empty dataframe.

Thanks very much for investigating. Is there a way to request new datasets are added? For context, I'm in Glasgow City Council and it would be very handy to be able to query for data zones and by multi member ward for the city. Would save manually downloading spreadsheets and mean we could automate collating population estimates for various uses. An example would be in our child poverty work where we estimate poverty and benefit uptake rates by data zone and multi member ward to target our resources.

The publication which contains data zones is here for context:

https://www.nrscotland.gov.uk/statistics-and-data/statistics/statistics-by-theme/population/population-estimates/small-area-population-estimates-2011-data-zone-based/mid-2022

I'll need to correct myself - datazones are available in this dataset, just not for the 2022 time period which has confused me. I can find the data you want in the csv of the datacube, so there's no reason I can find why the filters aren't working. I'll need to investigate. I'm afraid it may take a while as I can only work on this in my free time.

No problem at all, it isn't a priority for us so no rush to get it up and running. I already have the recently released 2022 data downloaded and formatted so a nice to have for the future. Thanks for your help.