step {emdi} | R Documentation |
Step Function
Description
This generic function selects a model by different criteria in a stepwise algorithm.
Usage
step(object, scope, criteria, direction, trace, steps, ...)
## Default S3 method:
step(object, ...)
## S3 method for class 'fh'
step(
object,
scope = NULL,
criteria = "AIC",
direction = "both",
trace = TRUE,
steps = 1000,
...
)
Arguments
object |
an object of type "fh" that contains the chosen information criterion or of type "lm" for the default method. |
scope |
formula or a list including two formulas ( |
criteria |
a character string describing the model selection criterion.
Criteria that can be chosen are " |
direction |
a character string describing the direction of stepwise
algorithm. Directions that can be chosen are " |
trace |
if |
steps |
a number determining the maximum number of steps. Defaults to 1000. |
... |
additional arguments that are not used in this method. |
Details
The default method of the generic function step
applies the step
function for lm
models of the
stats package. Please refer to the documentation of the step
function
of the stats package for details.
The information criteria "AICc
", "AICb1
",
"AICb2
", "KIC
", "KICc
", "KICb1
" and
"KICb2
" are especially developed for Fay-Herriot 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 Fay-Herriot 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.
Value
The return of step
depends on the class of its argument.
Please refer to the documentation of the step
function
of the stats package for details of the default method.
For the fh method information about the resulting "best" model due to the chosen information criterion is provided:
call |
the function call that produced the object. |
coefficients |
data frame containing the estimated regression
coefficients, the standard errors and the |
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
Examples
# 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", B = c(0, 50)
)
# Example 1: Use default settings
step(fh_std)
# Example 2: Choose "KICb2" information criterion
step(fh_std, criteria = "KICb2")