Closed bwcastillo closed 1 year ago
The only variables that StatCan releases without statistical rounding are Population, Dwellings, and Household counts, and they are automatically attached to the result of any get_census()
call. All variables that are part of the "100% data" or "25% data" undergo statistical rounding and are not available as raw counts.
@mountainMath
Thank you so much for the early/fast response, I really appreciate that.
Effectively, it happens I did some test with the API and is what you said. But, still curious I evaluated each variable that says 100%, and Apartment in a building that has five or more storeys and Neither English nor French returned just multiples by 5, maybe the question in the census form is like that, or is just coincidence.
#Values in the census 2021 file 98-401-X2021006_English_meta.txt
var2021<-paste0(c("4","8","47","229","346","373"),collapse ="+")
#DA's of interests
da2021<-paste0(area_da_geometry$DGUID[1:200], collapse="+") #Just 200
#Query to the API
rsdmx2021da<-as.data.frame(readSDMX(paste0("https://api.statcan.gc.ca/census-recensement/profile/sdmx/rest/data/STC_CP,DF_DA/A5.",da2021,"..",var2021,".1")))
rsdmx2021da$CHARACTERISTIC<-as.numeric(rsdmx2021da$CHARACTERISTIC)
class(rsdmx2021da$CHARACTERISTIC) #characters
View(rsdmx) #Doing filters in the data frame GUI
#Still multiples of 5 even in API response:
#47 (Apartment in a building that has five or more storeys: v_CA21_440)
#373 (Neither English nor French: v_CA21_1156)
Thank you again. This library is brilliant.
Hello,
I am trying to get data from cancensus (Census 2021) either, spatial or tabular format through
get_cesus()
function, and the data recovered is just multiples of 5. I could verify this inconsistency through Total Population variable (attached), only Total Dwellings variable looks consistent.Both images are a screenshot from the same dataframe:
1)Information obtained by default (Population)
2)Information in the query (_vCA21_8: Total-Age_)
I hope to know how is possible to resolve it.
Thanks in advance for you work.
PS: I love this library. Thank you again.