compare_pred: Compare Predictions of Model Objects

View source: R/compare.R

compare_predR Documentation

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 class 'emdi'
compare_pred(object1, object2, MSE = FALSE, ...)

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.

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.

See Also

direct, ebp, fh

Examples


# 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)


emdi documentation built on Nov. 5, 2023, 5:07 p.m.