From a79db0d79ce56f1b3259ae46210d70f7bc63c7f5 Mon Sep 17 00:00:00 2001
From: Ben Anderson <dataknut@icloud.com>
Date: Mon, 21 Oct 2019 15:35:16 +1300
Subject: [PATCH] test n households via sum weights

---
 ipf/runIPF.R | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/ipf/runIPF.R b/ipf/runIPF.R
index 0ca9740..50adde4 100644
--- a/ipf/runIPF.R
+++ b/ipf/runIPF.R
@@ -178,3 +178,11 @@ message("N rows after removing zero weights: ", nrow(longFormDT))
 # save the results for future use since they won't change unless we change the constraints ----
 data.table::fwrite(longFormDT, paste0(p_Params$ggPath, "/safe/ipf/nonZeroWeightsAu2013.csv"))
 
+# final test
+# sum of weights:
+tidyNum(sum(longFormDT$ipfWeight))
+
+# Census 2013:
+# 1,549,890
+# http://archive.stats.govt.nz/Census/2013-census/profile-and-summary-reports/qstats-families-households/households.aspx
+
-- 
GitLab