#-------------------------------------------------------------------------------------------------------------------. # REGISTER CENSUS 2011 # Dataset DWELLING # # This R! routine adds variable and value labels. # It works with Register Census 2011 microdata, prepared by SORS in April 2014. # Your dataset might have a smaller set of variables. # # Version 1, December 2014 # R 3.1.2 # # Social Science Data Archives, University of Ljubljana # Sebastian Kocar # http://www.adp.fdv.uni-lj.si/ # Contact: arhiv.podatkov@fdv.uni-lj.si # # This R code is protected under the Creative Commons licence. #-------------------------------------------------------------------------------------------------------------------. #--- CONFIGURATION SECTION --- START --- # The following commands should contain the complete path and # name of the .txt file to be read (e.g. 'C:/Census2011_v1.txt') # and the .txt file to be saved with labels (e.g. 'C:/Census2011_labels.txt') # Change TXT_DATA_PATH to your filename. # Change TXT_DATA_PATH_SAVE to your filename. #--- CONFIGURATION SECTION --- END --- #-------------------------------------------------------------------------------------------------------------------. #----------------------------------------------Start data processing------------------------------------------------. #--- importing data data<-read.delim("TXT_DATA_PATH", header = TRUE, sep = "\t", dec=",") #--- adding labels for variables and variable values require(Hmisc) label(data$DST_SID) <- "Building part ID (RER)" label(data$ID_LEGA) <- "Position of dwelling in multi-dwelling building; 1 - Cellar, 2 - Groud floor, 3 - Floor, 4 - Attic, 5 - Other" label(data$ID_DUPLEX) <- "Duplex; 1 - Yes, 2 - No" label(data$ID_KUHINJA) <- "Kitchen in the dwelling; 1 - Kitchen, 2 - No kitchen" label(data$ID_KOPALNICA) <- "Bathroom in the dwelling; 1 - Fixed bath or shower in the housing unit, 2 - No fixed bath or shower in the housing unit, 3 - Not stated" label(data$ID_STRANISCE) <- "Toilet in the dwelling; 1 - Flush toilet in the housing unit, 2 - No flush toilet in the housing unit, 3 - Not stated" label(data$ST_SOB) <- "Number of rooms excluding kitchen" label(data$UPOR_POV_STAN) <- "Useful floor space" label(data$NETO_TLORIS_POV_DST) <- "Net ground plan of building part" label(data$ID_POCIT_RABA) <- "Seasonal or secondary use; 1 - Seasonal or secondary use of dwelling, 2 - No seasonal or secondary use of dwelling, 3 - Vacant dwelling" label(data$ID_PRIJAVA_DEJAV) <- "Business use of building part; 1 - Yes, 2 - No" label(data$ST_SOB_DEJAVNOST) <- "Number of rooms for business use" label(data$POVR_SOB_DEJAVNOST) <- "Useful floor space for business use" label(data$ID_VR_NAJEMA) <- "Type of rent; 1 - Not rented dwelling, 2 - Non-profit rented dwelling, 3 - Market rented dwelling, 4 - Company rented dwelling, 5 - Dedicated rented dwelling (for older people, pensioners or s" label(data$DEJANSKA_RABA_CCSI) <- "Actual use of part of the building - LOOK UP CC_SI_REN CODEBOOK" label(data$STAT_SAMO_ZA_DEJAVNOST) <- "Business use of dwelling only; 0 - No, 1 - Yes" label(data$SKUPIN_ENOTA) <- "Collective living quarter indicator; 0 - Not a collective living quarter, 1 - Collective living quarter" label(data$OBC) <- "Location of dwelling - municipality - LOOK UP RPE_POPIS_2011 CODEBOOK" label(data$NAS) <- "Location of dwelling - settlement - LOOK UP RPE_POPIS_2011 CODEBOOK" label(data$REG) <- "Location of dwelling - statistical region - LOOK UP RPE_POPIS_2011 CODEBOOK" label(data$TIP_NASELJA) <- "Type of settlement / area (dwelling); DN - Non-urban settlement, M - Urban settlement, NMO - Settlement within urban area" label(data$ST_PREB_POPIS) <- "Number of population in the dwelling" label(data$ST_GOSP_POPIS) <- "Number of households in the dwelling" label(data$HS_MID_NAST) <- "Type of accommodation; 1 - Social work center without conventional dwellings, 2 - Residence for pupils and students, 3 - Postgraduate´s house, 4 - Special social care institute, 5 - Community, 6 - Prison, 7 - Religious institution, 8 - Elderly home, 9 - Elderly home with private households, 10 - Residence for students and religious institution, 11 - Elderly home, religious institution and private households, 12 - Elderly home and private households, 13 - Residence for students, religious institution and private ho, 14 - Worker dormitory in non-residential building, 15 - Worker dormitory with short-term settlement, 16 - Worker dormitory for communities, 17 - Worker dormitory in one-dwelling building, 18 - Worker dormitory in multi-dwelling building, 19 - Residence for students, worker dormitory and conventional dw, 20 - Religious institution, residence for students and private ho, 21 - Special social care institute with private households, 22 - Roma settlement, 23 - Social work center with conventional dwellings, 24 - Special accommodation center, 25 - Residence for students in building with conventional dwellin, 26 - Residence for pupils and students without institutional hous, 27 - Religious institution without institutional household, 28 - Special social care institute without institutional househol, 29 - Hotel and other tourist accommodation, 30 - Collective living quarter as a part of the building, 31 - Collective living quarter with 7 or less residents" label(data$TIP_STAN_ENOTE) <- "Type of living quarters; 1 - Conventional dwelling, 2 - Collective living quarter, 3 - Other housing unit, 4 - Different intitutions dealling also with homless people like, 5 - Unknown, 6 - Other parts of buildings" label(data$NASEL_OBIC_STAN) <- "Occupancy of conventional dwelling; 0 - Not a conventional dwelling, 1 - Occupied convential dwelling, 2 - Dwelling for seasonal or secondary use, 3 - Vacant dewlling" label(data$TIP_LASTNISTVA) <- "Dwelling ownership; 1 - Owner-occupied dwellings, 2 - Dwellings in cooperative ownership, 3 - Rented dwellings, 4 - Dwellings in other types of ownership, 5 - Not stated, 6 - Not applicable" label(data$UPOR_POVR_OSEBA) <- "Useful floor space per person" label(data$ST_STANOVALCEV_RAZ) <- "Number of occupants - range; 1 - 1 person, 2 - 2 persons, 3 - 3 persons, 4 - 4 persons, 5 - 5 persons, 6 - 6 persons, 7 - 7 persons, 8 - 8 persons, 9 - 9 persons, 10 - 10 persons, 11 - 11 or more persons, Sysmiss - " label(data$UPOR_POVR_RAZ) <- "Useful floor space - range; 1 - Under 30 square metres, 2 - 30 — less than 40 square metres, 3 - 40 — less than 50 square metres, 4 - 50 — less than 60 square metres, 5 - 60 — less than 80 square metres, 6 - 80 — less than 100 square metres, 7 - 100 — less than 120 square metres, 8 - 120 — less than 150 square metres, 9 - 150 square metres and over, 10 - Not stated" label(data$GOSTOTA_RAZ) <- "Density standard; 1 - less than 10 m2, 2 - 10 - less than 15 m2, 3 - 15 - less than 20 m2, 4 - 20 - less than 30 m2, 5 - 30 - less than 40 m2, 6 - 40 - less than 60 m2, 7 - 60 - less than 80 m2, 8 - 80 m2 and more, 9 - Not stated" label(data$LETO_ZGR_EU) <- "Period of construction; 1 - Before 1919, 2 - 1919 – 1945, 3 - 1946 – 1960, 4 - 1961 – 1970, 5 - 1971 – 1980, 6 - 1981 – 1990, 7 - 1991 – 2000, 8 - 2001 – 2005, 9 - 2006 and later, 10 - Not stated" label(data$ST_SOB_RAZ_EU) <- "Number of rooms including kitchen; 1 - 1 room, 2 - 2 rooms, 3 - 3 rooms, 4 - 4 rooms, 5 - 5 rooms, 6 - 6 rooms, 7 - 7 rooms, 8 - 8 rooms, 9 - 9 rooms and more, 10 - Not stated" label(data$ST_SOB_RAZ_SLO) <- "Number of rooms excluding kitchen - range; 1 - 1 room, 2 - 2 rooms, 3 - 3 rooms, 4 - 4 rooms, 5 - 5 rooms, 6 - 6 rooms, 7 - 7 rooms, 8 - 8 rooms, 9 - 9 rooms and more, 10 - Not stated" label(data$ST_SOB_BREZDEJ_EU) <- "Number of rooms including kitchen and excluding rooms for business use" label(data$ST_SOB_BREZDEJ_EU_OSEBA) <- "Number of rooms per person including kitchen and excluding rooms for business use" label(data$GOSTOTA_RAZ_SOB_EU) <- "Density standard including kitchen and excluding rooms for business use - range; 1 - Less than 0.5 rooms per occupant, 2 - 0.5 — less than 1.0 rooms per occupant, 3 - 1.0 — less than 1.25 rooms per occupant, 4 - 1.25 — less than 1.5 rooms per occupant, 5 - 1.5 — less than 2.0 rooms per occupant, 6 - 2.0 — less than 2.5 rooms per occupant, 7 - 2.5 — less than 3.0 rooms per occupant, 8 - 3.0 and more rooms per occupant, 9 - Not stated, Sysmiss - " label(data$VODA_VSTAN) <- "Piped water in the dwelling; 1 - Piped water in the housing unit, 2 - No piped water in the housing unit, 3 - Not stated" label(data$LAST1) <- "Ownership by type of owner; 1 - Owned by physical persons, 2 - Owned by public sector, 3 - Other, 4 - Unknown" label(data$LAST2) <- "Ownership by type of sector; 1 - Owned by private sector, 2 - Owned by public sector, 3 - Other, 4 - Unknown" label(data$ST_GOSP_LAST) <- "Number of households of which a member is the owner of the dwelling" label(data$UPOR_POV_STAN_BREZDEJ) <- "Useful floor space without space for business use" label(data$UPOR_POV_STAN_BREZDEJ_RAZ) <- "Useful floor space without space for business use - range; 1 - Under 30 square metres, 2 - 30 — less than 40 square metres, 3 - 40 — less than 50 square metres, 4 - 50 — less than 60 square metres, 5 - 60 — less than 80 square metres, 6 - 80 — less than 100 square metres, 7 - 100 — less than 120 square metres, 8 - 120 — less than 150 square metres, 9 - 150 square metres and over, 10 - Not stated" label(data$ST_SOB_BREZDEJ_SLO) <- "Number of rooms without rooms for business use" label(data$ST_SOB_BREZDEJ_SLO_RAZ) <- "Number of rooms without rooms for business use - range; 1 - 1 room, 2 - 2 rooms, 3 - 3 rooms, 4 - 4 rooms, 5 - 5 rooms, 6 - 6 rooms, 7 - 7 rooms, 8 - 8 rooms, 9 - 9 rooms and more, 10 - Not stated" label(data$VEL_NASELJA) <- "Size of locality of dwelling; 1 - 1,000,000 inhabitants or more, 2 - From 500,000 to 999,999 inhabitants, 3 - From 200,000 to 499,999 inhabitants, 4 - From 100,000 to 199,999 inhabitants, 5 - From 50,000 to 99,999 inhabitants, 6 - From 20,000 to 49,999 inhabitants, 7 - From 10,000 to 19,999 inhabitants, 8 - From 5,000 to 9,999 inhabitants, 9 - From 2,000 to 4,999 inhabitants, 10 - From 1,000 to 1,999 inhabitants, 11 - From 500 to 999 inhabitants, 12 - From 200 to 499 inhabitants, 13 - From 100 to 199 inhabitants, 14 - From 50 to 99 inhabitants, 15 - From 25 to 49 inhabitants, 16 - From 1 to 24 inhabitants, 17 - No inhabitants" label(data$LETO_IZG_STA) <- "Year of construction" label(data$ID_KONSTRUKCIJE) <- "Main structural material; 1 - bricks, 2 - concrete, ironed concrete, 3 - rock, 4 - wood, 5 - combination of different materials, 6 - metal construction, 7 - montage building, 8 - other material" label(data$ID_DVIGALO) <- "Lift; 1 - Lift, 2 - No lift" label(data$ID_OGREVANJE) <- "Type of heating; 1 - Heating by community heating centre, 2 - Central heating, 3 - Other type of heating, 4 - No heating" label(data$ID_VODOVOD) <- "Water supply system in the dwelling; 1 - Yes, 2 - No" label(data$ID_ELEKTRIKA) <- "Electricity in the dwelling; 1 - Electricity grid, 2 - No electricity grid" label(data$ID_TELEFON) <- "Telephone in the dwelling; 1 - Availabitiy of telephone connection, 2 - No availabitiy of telephone connection" label(data$ID_KANALIZACIJA) <- "Sewage disposal system in the dwelling; 1 - Sewage disposal system, 2 - No sewage disposal system" label(data$ID_PLIN) <- "Piped gas in the dwelling; 1 - Piped gas available, 2 - No piped gas available" label(data$ID_TIP_STAVBE) <- "Type of building; 1 - Detached house, 2 - Semidetached house, 3 - End-row house, 4 - Middle row house" label(data$DEJANSKA_RABA_STAVBE) <- "Actual use of the building - LOOK UP CC_SI_REN CODEBOOK" label(data$ID_KABELSKA_TV) <- "Cable TV; 1 - Yes, 2 - No" label(data$RABA_STAV) <- "Use of building; 1 - Residential building, 2 - Non-residential building" label(data$VRSTA_STAV_EU) <- "Type of building; 1 - One dwelling building, 2 - Two dwelling building, 3 - Two or more dwelling building, 4 - Non dwelling building, 5 - Not specified" label(data$CENTR_OGR) <- "Central heating; 1 - Central heating, 2 - No central heating, 3 - Not stated" #----------------------------------------------End data processing------------------------------------------------. #--- displaying all labels attach(data) describe(data) #--- saving txt dataset with labels write.table(data, "TXT_DATA_PATH_SAVE", quote = FALSE, sep = "\t", dec=",", na = "NA")