Learn R Programming

emdi (version 2.2.1)

compare_pred: Compare Predictions of Model Objects

Description

Function compare_pred is a generic function used to compare predictions of two model objects.

Method compare_pred.emdi compares predictions of two emdi objects.

Usage

compare_pred(object1, object2, MSE = FALSE, ...)

# S3 method for emdi compare_pred(object1, object2, MSE = FALSE, ...)

Value

Data frame containing the point estimates of both emdi objects. If column names are duplicated, the suffixes "_1" and "_2" are added to their names. "_1" and "_2" standing for object1 and object2, respectively. If MSE is set to TRUE, the data frame also contains the MSE estimates of the emdi objects.

Arguments

object1

an object of type "emdi".

object2

an object of type "emdi".

MSE

if TRUE, MSE estimates are also returned. Defaults to FALSE.

...

further arguments passed to or from other methods.

See Also

direct, ebp, fh

Examples

Run this code
# \donttest{
# Example for class ebp
emdi_model_1 <- ebp(
  fixed = eqIncome ~ gender + eqsize + cash + self_empl +
    unempl_ben + age_ben + surv_ben + sick_ben + dis_ben + rent + fam_allow +
    house_allow + cap_inv + tax_adj, pop_data = eusilcA_pop,
  pop_domains = "district", smp_data = eusilcA_smp, smp_domains = "district",
  na.rm = TRUE
)

emdi_model_2 <- ebp(
  fixed = eqIncome ~ gender + eqsize + cash + self_empl +
    unempl_ben + age_ben + surv_ben, pop_data = eusilcA_pop,
  pop_domains = "district", smp_data = eusilcA_smp, smp_domains = "district",
  na.rm = TRUE
)

compare_pred(emdi_model_1, emdi_model_2)
# }

Run the code above in your browser using DataLab