mse_FHme: Mean Squared Error Estimator of the EBLUP under a Fay-Herriot...

View source: R/mse_FHme.R

mse_FHmeR Documentation

Mean Squared Error Estimator of the EBLUP under a Fay-Herriot Model with Measurement Error

Description

This function gives the mean squared error estimator of the EBLUP based on Fay-Herriot model with measurement error using jackknife method.

Usage

mse_FHme(
  formula,
  vardir,
  var.x,
  type.x = "witherror",
  MAXITER = 1000,
  PRECISION = 1e-04,
  data
)

Arguments

formula

an object of class formula (or one that can be coerced to that class): a symbolic description of the model to be fitted. The variables included formula must have a length equal to the number of domains m. This formula can provide auxiliary variable either measured with error or without error or combination between them. If the auxiliary variable are combination between noerror and witherror variable, input all witherror variable first then noerror variable.

vardir

vector containing the m sampling variances of direct estimators for each domain. The values must be sorted as the Y.

var.x

vector containing mean squared error of X . The values must be sorted as the X. if you use optional data, input this parameter use c(""), example: var.x = c("c1") or var.x = c("c1","c2").

type.x

type of auxiliary variable used in the model. Either source measured with noerror, witherror and mix. Default value is witherror.

MAXITER

maximum number of iterations allowed. Default value is 1000 iterations.

PRECISION

convergence tolerance limit. Default value is 0.0001.

data

optional data frame containing the variables named in formula, vardir, and var.x.

Details

A formula has an implied intercept term. To remove this use either y ~ x - 1 or y ~ 0 + x. See formula for more details of allowed formulae.

Value

The function returns a list with the following objects:

mse

vector with the values of the mean squared errors of the EBLUPs for each domain.

Examples

data(dataME)
data(datamix)

mse.sae.me <- mse_FHme(formula = y ~ x.hat, vardir = vardir, var.x = c("var.x"), data = dataME)
mse.sae.mix <- mse_FHme(formula = y ~ x.hat1 + x.hat2 + x3 + x4,
                vardir = vardir, var.x = c("var.x1", "var.x2"), type.x = "mix", data = datamix)


saeME documentation built on Aug. 21, 2023, 9:07 a.m.