diff --git a/R/smoothArea.R b/R/smoothArea.R index 7fd14f3..a3ff7c5 100644 --- a/R/smoothArea.R +++ b/R/smoothArea.R @@ -391,8 +391,8 @@ plot.svysae <- function(x, return_list = F, plot.factor = NULL, ...) { } } -#' Plot heatmap comparing pairwise posterior exceedence probabilities for all -#' areas +#' Plot heatmap comparing pairwise posterior exceedence probabilities for svysae object +#' #' #' @param x svysae object. Plots are created for all models in this object. #' @param posterior.sample Matrix of posteriors samples of area level quantities with one row for each area and one column for each sample. This argument may be specified to only provide a heatmap for the desired samples. @@ -405,6 +405,7 @@ plot.svysae <- function(x, return_list = F, plot.factor = NULL, ...) { #' \dontrun{ #' data(DemoData2) #' data(DemoMap2) +#' library(survey) #' des0 <- svydesign(ids = ~clustid+id, strata = ~strata, #' weights = ~weights, data = DemoData2, nest = T) #' Xmat <- aggregate(age~region, data = DemoData2, FUN = mean) @@ -500,7 +501,7 @@ compareEstimates <- function(x, suppressWarnings(print(g_heat)) } } -#' Title +#' Mapping estimates for svysae object #' #' #' @param x syvsae object diff --git a/R/smoothUnit.R b/R/smoothUnit.R index 5b6d244..4b27653 100644 --- a/R/smoothUnit.R +++ b/R/smoothUnit.R @@ -26,15 +26,16 @@ #' \dontrun{ #' data(DemoData2) #' data(DemoMap2) +#' library(survey) #' des0 <- svydesign(ids = ~clustid+id, strata = ~strata, #' weights = ~weights, data = DemoData2, nest = T) #' -#' EXAMPLE 1: Continuous response model +#' # EXAMPLE 1: Continuous response model #' cts.res <- smoothUnit(formula = tobacco.use ~ 1, #' domain = ~region, #' design = des0, X.pop = DemoData2) #' -#' EXAMPLE 2: Binary response model +#' # EXAMPLE 2: Binary response model #' bin.res <- smoothUnit(formula = tobacco.use ~ 1, #' family = "binomial", #' domain = ~region, diff --git a/man/compareEstimates.Rd b/man/compareEstimates.Rd index 6e22243..8cc800c 100644 --- a/man/compareEstimates.Rd +++ b/man/compareEstimates.Rd @@ -2,8 +2,7 @@ % Please edit documentation in R/smoothArea.R \name{compareEstimates} \alias{compareEstimates} -\title{Plot heatmap comparing pairwise posterior exceedence probabilities for all -areas} +\title{Plot heatmap comparing pairwise posterior exceedence probabilities for svysae object} \usage{ compareEstimates(x, posterior.sample = NULL) } @@ -16,13 +15,13 @@ compareEstimates(x, posterior.sample = NULL) ggplot containing heat map of pairwise comparisons } \description{ -Plot heatmap comparing pairwise posterior exceedence probabilities for all -areas +Plot heatmap comparing pairwise posterior exceedence probabilities for svysae object } \examples{ \dontrun{ data(DemoData2) data(DemoMap2) +library(survey) des0 <- svydesign(ids = ~clustid+id, strata = ~strata, weights = ~weights, data = DemoData2, nest = T) Xmat <- aggregate(age~region, data = DemoData2, FUN = mean) diff --git a/man/mapEstimates.Rd b/man/mapEstimates.Rd index ea75d36..77bc4f5 100644 --- a/man/mapEstimates.Rd +++ b/man/mapEstimates.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/smoothArea.R \name{mapEstimates} \alias{mapEstimates} -\title{Title} +\title{Mapping estimates for svysae object} \usage{ mapEstimates(x, geo.data, variable, viridis.option = "viridis") } @@ -19,7 +19,7 @@ mapEstimates(x, geo.data, variable, viridis.option = "viridis") ggplot containing map of small area posterior summary statistics } \description{ -Title +Mapping estimates for svysae object } \examples{ \dontrun{ diff --git a/man/smoothArea.Rd b/man/smoothArea.Rd index 6f74509..42bd35f 100644 --- a/man/smoothArea.Rd +++ b/man/smoothArea.Rd @@ -68,11 +68,12 @@ area level model \dontrun{ data(DemoData2) data(DemoMap2) +library(survey) des0 <- svydesign(ids = ~clustid+id, strata = ~strata, weights = ~weights, data = DemoData2, nest = T) Xmat <- aggregate(age~region, data = DemoData2, FUN = mean) -EXAMPLE 1: Continuous response model +# EXAMPLE 1: Continuous response model cts.res <- smoothArea(tobacco.use ~ 1, domain = ~region, design = des0, @@ -82,7 +83,7 @@ cts.res <- smoothArea(tobacco.use ~ 1, pc.u.phi = 0.5, pc.alpha.phi = 2/3) -EXAMPLE 2: Including area level covariates +# EXAMPLE 2: Including area level covariates cts.cov.res <- smoothArea(tobacco.use ~ age, domain = ~region, design = des0, @@ -93,7 +94,7 @@ cts.cov.res <- smoothArea(tobacco.use ~ age, pc.u.phi = 0.5, pc.alpha.phi = 2/3) -EXAMPLE 3: Binary response model +# EXAMPLE 3: Binary response model bin.res <- smoothArea(tobacco.use ~ 1, domain = ~region, design = des0, @@ -104,7 +105,7 @@ bin.res <- smoothArea(tobacco.use ~ 1, pc.u.phi = 0.5, pc.alpha.phi = 2/3) -EXAMPLE 4: Including area level covariates in binary response model +# EXAMPLE 4: Including area level covariates in binary response model bin.cov.res <- smoothArea(tobacco.use ~ age, domain = ~region, design = des0, diff --git a/man/smoothUnit.Rd b/man/smoothUnit.Rd index d91b72b..fa47810 100644 --- a/man/smoothUnit.Rd +++ b/man/smoothUnit.Rd @@ -61,15 +61,16 @@ unit level model \dontrun{ data(DemoData2) data(DemoMap2) +library(survey) des0 <- svydesign(ids = ~clustid+id, strata = ~strata, weights = ~weights, data = DemoData2, nest = T) -EXAMPLE 1: Continuous response model +# EXAMPLE 1: Continuous response model cts.res <- smoothUnit(formula = tobacco.use ~ 1, domain = ~region, design = des0, X.pop = DemoData2) -EXAMPLE 2: Binary response model +# EXAMPLE 2: Binary response model bin.res <- smoothUnit(formula = tobacco.use ~ 1, family = "binomial", domain = ~region,