Learn R Programming

emdi (version 2.0.1)

step.fh: Method step.fh selects a Fay-Herriot model by different information criteria in a stepwise algorithm.

Description

Method step.fh selects a Fay-Herriot model by different information criteria in a stepwise algorithm.

Usage

# S3 method for fh
step(
  object,
  scope = NULL,
  criteria = "AIC",
  direction = "both",
  trace = TRUE,
  steps = 1000,
  ...
)

Arguments

object

an object of type "emdi","model","fh" that contains the chosen information criteria.

scope

formula or a list including two formulas (lower and upper) specifying the models considered in the step function. Defaults to NULL.

criteria

a character string describing the model selection criterion. Criteria that can be chosen are "AIC", "AICc", "AICb1", "AICb2", "BIC", "KIC", "KICc", "KICb1", or "KICb2". Defaults to "AIC".

direction

a character string describing the direction of stepwise algorithm. Directions that can be chosen are "both", "backward" or "forward". Defaults to "both". If no scope argument is provided, the default is "backward".

trace

if TRUE, information about the single steps is provided during the stepwise procedure. Defaults to TRUE.

steps

a number determining the maximum number of steps. Defaults to 1000.

...

additional arguments that are not used in this method.

Value

Information about the resulting "best" model due to the chosen information criterion:

call

the function call that produced the object.

coefficients

data frame containing the estimated regression coefficients, the standard errors and the t- and p-values of the explanatory variables.

Details

The information criteria "AICc", "AICb1", "AICb2", "KIC", "KICc", "KICb1" and "KICb2" are especially developed for FH models by Marhuenda et al. (2014). They are based on a bootstrap algorithm. If one of the criteria is chosen, make sure that the bootstrap iterations (B) of the fh object are set to a positive number. For some model extensions of the fh model only the "AIC" and the "BIC" information criteria are provided and for some none of the information criteria are defined. Check the model_select component of the fh object (objectname$model$model_select). If no criteria are provided, it is not possible to apply the stepwise variable selection algorithm.

References

Marhuenda, Y., Morales, D. and Pardo, M.C. (2014). Information criteria for Fay-Herriot model selection. Computational Statistics and Data Analysis 70, 268-280.

See Also

emdiObject, fh

Examples

Run this code
# NOT RUN {
# Loading data - population and sample data
data("eusilcA_popAgg")
data("eusilcA_smpAgg")

# Combine sample and population data
combined_data <- combine_data(pop_data = eusilcA_popAgg, pop_domains = "Domain",
                             smp_data = eusilcA_smpAgg, smp_domains = "Domain")

# Estimate FH model that contains all variables that should be considered
fh_std <- fh(fixed = Mean ~ cash + self_empl + unempl_ben, vardir = "Var_Mean",
combined_data = combined_data, domains = "Domain", method = "ml", 
MSE = TRUE)

# Example 1: Use default settings
step(fh_std)

# Example 2: Choose "KICb2" information criterion
step(fh_std, criteria = "KICb2")
# }

Run the code above in your browser using DataLab