View source: R/summarize_indicators.R
| summarize_indicators | R Documentation |
Function summarize_indicators reports point and
mean squared error (MSE) estimates as well as calculated coefficients of variation
(CV) from a fitted SAEforest object.
summarize_indicators(object, indicator = "all", MSE = FALSE, CV = FALSE)
object |
Object for which point and/or MSE estimates and/or
calculated CV's are requested. The object must be of class |
indicator |
Optional character vector specifying indicators to be mapped: (i)
all calculated indicators ("all"); (ii) each default indicators name: "Mean",
"Quant10", "Quant25", "Median", "Quant75", "Quant90", "Gini", "Hcr", "Pgap", "Qsr"
or the function name/s of "custom_indicator/s"; (iii) a vector of names of indicators.
If the |
MSE |
Logical. If |
CV |
Logical. If |
Objects of class summarize_indicators.SAEforest have methods for following generic
functions: head and tail (for default documentation, see
head), as.matrix (for default documentation, see
matrix), as.data.frame (for default documentation,
see as.data.frame), subset (for default
documentation, see subset).
The return of summarize_indicators is an object of class summarize_indicators.SAEforest
including domain-specific point and/or MSE estimates and/or calculated CV's from a SAEforest object
The returned object contains the data.frame ind and a character including the names of requested indicator(s).
SAEforestObject, SAEforest_model
# Loading data
data("eusilcA_pop")
data("eusilcA_smp")
income <- eusilcA_smp$eqIncome
X_covar <- eusilcA_smp[, -c(1, 16, 17, 18)]
# Calculating point + MSE estimates and passing arguments to the forest.
# Additionally, two additional indicators and functions as threshold are added.
# Note that B and num.trees are low to speed up estimation time and must be changed for
# practical applications.
model1 <- SAEforest_model(Y = income, X = X_covar, dName = "district",
smp_data = eusilcA_smp, pop_data = eusilcA_pop,
meanOnly = FALSE, MSE = "nonparametric", B = 5, mtry = 5,
num.trees = 50, smearing = FALSE)
# Extract indicator and show generics:
Gini1 <- summarize_indicators(model1, MSE = TRUE, CV = TRUE, indicator = "Gini")
head(Gini1)
tail(Gini1)
as.data.frame(Gini1)
as.matrix(Gini1)
subset(Gini1, district == "Wien")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.