The hardware and bandwidth for this mirror is donated by METANET, the Webhosting and Full Service-Cloud Provider.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]metanet.ch.
A package for iterative proportional fitting on multiple marginal distributions in R. The goal of this package is to make survey raking, matrix balancing, and population synthesis easier.
Install the latest official version from CRAN:
install.packages("ipfr")
Install the development version of the package:
library(devtools)
install_github("dkyleward/ipfr", build_vignettes = TRUE)
(See vignettes at the bottom for advanced topics.)
A basic matrix balance task:
<- matrix(data = runif(9), nrow = 3, ncol = 3)
mtx <- c(3, 4, 5)
row_targets <- c(5, 4, 3)
column_targets <- ipu_matrix(mtx, row_targets, column_targets) result
A basic survey balance task:
<- tibble(
survey size = c(1, 2, 1, 1),
autos = c(0, 2, 2, 1),
weight = 1
)<- list()
targets $size <- tibble(
targets`1` = 75,
`2` = 25
)$autos <- tibble(
targets`0` = 25,
`1` = 50,
`2` = 25
)<- ipu(survey, targets) result
Creating synthetic households from the ipu()
result:
synthesize(result$weight_tbl)
Using ipfr:
https://cran.r-project.org/web/packages/ipfr/vignettes/using_ipfr.html
Common ipf problems:
https://cran.r-project.org/web/packages/ipfr/vignettes/common_ipf_problems.html
These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.