# Q10#1_6_1_TEXT + # bathrooms - excluded from census http://archive.stats.govt.nz/Census/2013-census/info-about-2013-census-data/2013-census-definitions-forms/definitions/dwelling.aspx
# Q10#1_7_1_TEXT + # toilets - excluded from census
# Q10#1_8_1_TEXT + # laundries - excluded from census
]
message("Testing original n rooms (Q10)")
table(ggHhDT$nRooms,useNA="always")
message("We're quite short of responses to nRooms - we will try to impute them from the number of adults and children using a regression model...")
message("Test the model")
r<-lm(ggHhDT$nRooms~ggHhDT$nAdults+ggHhDT$nKids)
summary(r)
# >> impute where missing ----
message("that looks reasonable...impute where missing")
ggHhDT<-ggHhDT[,nRoomsImputed:=predict(r,ggHhDT)]# this forces predict to update the NAs with an estimate