plotStrata2d {SamplingStrata} | R Documentation |
Plot bivariate distibutions in strata
Description
Plots a 2d graph showing obtained strata
Usage
plotStrata2d (x,outstrata,domain,vars,labels)
Arguments
x |
the sampling frame |
outstrata |
the optimized strata |
domain |
a domain in the frame |
vars |
vars to appear in x and y axis |
labels |
labels to appear in x and y axis |
Value
A formatted output containing information on the strata in the given domain
Examples
## Not run:
library(SamplingStrata)
data("swissmunicipalities")
swissmunicipalities = swissmunicipalities[swissmunicipalities$REG==1,]
data("errors")
swissmunicipalities$id <- c(1:nrow(swissmunicipalities))
swissmunicipalities$domain = 1
frame <- buildFrameDF(swissmunicipalities,
id = "id",
domainvalue = "REG",
X = c("Surfacesbois","Surfacescult"),
Y = c("Pop020", "Pop2040")
)
solution <- optimStrata (method = "continuous",
errors = errors,,
framesamp = frame,
nStrata = 8,
iter = 25,
pops = 10)
p <- plotStrata2d(solution$framenew,
solution$aggr_strata,
domain = 1,
vars = c("X1","X2"),
labels = c("Surfacesbois","Surfacescult"))
p
## End(Not run)
[Package SamplingStrata version 1.5-4 Index]