FHme_nonsamples: Fay-Herriot Model with Measurement Error of Nonsampled Area

Description Usage Arguments Details Value Examples

View source: R/FHme_nonsamples.R

Description

This function gives the EBLUP estimator of nonsampled area using cluster information.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
FHme_nonsamples(
  formula,
  var.x,
  vardir,
  type.x = "witherror",
  MAXITER = 100,
  PRECISION = 1e-04,
  cluster.method = "kmeans",
  n.cluster,
  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.

var.x

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

vardir

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

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.

cluster.method

the cluster method used. Default value is kmeans and the other available method is kmedoids.

n.cluster

either the number of clusters, say k, or a set of initial (distinct) cluster centers.

data

a 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:

nonsampled_data

a data frame of nonsampled areas containing data, the cluster information (cluster) and mean of random effect for each cluster (refmean).

sampled_data

a data frame of sampled areas containing data, the cluster information (cluster) and mean of random effect for each cluster (refmean).

result_sampled

a list containing following objects:

result_nonsampled

a list containing following objects:

mse_sample

a list containing the values of mse a vector with the estimated mean squared errors of the EBLUPs for the sampled areas.

mse_nonsample

a list containing the values of mse a vector with the estimated mean squared errors of the EBLUPs for the nonsampled areas.

cluster

a data frame with the cluster information (cluster) in the first column and mean of random effects for each cluster (refmean) in the second column.

Examples

1
2
3
data(nonsample)
test <- FHme_nonsamples(formula = y ~ x.hat, var.x = c("var.x"),
                        vardir = vardir, n.cluster = 3, data = nonsample)

saeME documentation built on Jan. 13, 2021, 11:03 a.m.