Description Usage Arguments Examples
Plot results of calc.stError()
1 2 3 4 5 6 7 8 9 |
x |
object of class 'surveysd' output of function calc.stError |
variable |
Name of the variable for which standard errors have been
calcualated in |
type |
can bei either |
groups |
If |
sd.type |
can bei either |
... |
additional arguments supplied to plot. |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | library(surveysd)
library(laeken)
library(data.table)
eusilc <- demo.eusilc(n = 4, prettyNames = TRUE)
dat_boot <- draw.bootstrap(eusilc, REP = 3, hid = "hid", weights = "pWeight",
strata = "region", period = "year")
# calibrate weight for bootstrap replicates
dat_boot_calib <- recalib(dat_boot, conP.var = "gender", conH.var = "region")
# estimate weightedRatio for povmd60 per period
group <- list("gender", "region", c("gender", "region"))
err.est <- calc.stError(dat_boot_calib, var = "povertyRisk",
fun = weightedRatio,
group = group , period.mean = NULL)
plot(err.est)
# plot results for gender
# dotted line is the result on the national level
plot(err.est, type = "grouping", groups = "gender")
# plot results for gender
# with standard errors as ribbons
plot(err.est, type = "grouping", groups = "gender", sd.type = "ribbon")
# plot results for rb090 in each db040
plot(err.est, type = "grouping", groups = c("gender", "region"))
# plot results for db040 in each rb090 with standard errors as ribbons
plot(err.est,type = "grouping", groups = c("gender", "region"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.