saeFH.ns.mprop {sae.prop}R Documentation

EBLUPs based on a Multivariate Fay Herriot model with Additive Logistic Transformation for Non-Sampled Data

Description

This function gives the transformed EBLUP based on a multivariate Fay-Herriot model. Random effects for sampled domains are from the fitted model and random effects for non-sampled domains are from cluster information. This function is used for multinomial compositional data. If data has P as proportion and total of q categories (P_{1} + P_{2} + \dots + P_{q} = 1), then function should be used to estimate {P_{1}, P_{2}, \dots, P_{q-1}}.

Usage

saeFH.ns.mprop(
  formula,
  vardir,
  MAXITER = 100,
  PRECISION = 1e-04,
  cluster = "auto",
  data
)

Arguments

formula

an object of class formula that describe the fitted model.

vardir

sampling variances of direct estimations. If data is defined, it is a vector containing names of sampling variance columns. If data is not defined, it should be a data frame of sampling variances of direct estimators. The order is var1, var2, \dots, var(q-1), cov12, \dots, cov1(q-1), cov23, \dots, cov(q-2)(q-1).

MAXITER

maximum number of iterations allowed in the Fisher-scoring algorithm, Default: 100.

PRECISION

convergence tolerance limit for the Fisher-scoring algorithm, Default: 1e-4.

cluster

Default: "auto". If cluster = "auto", then the clustering will be performed by the function by finding optimal number of cluster. If cluster is a vector containing numbers of cluster for each category, then clustering will be performed based on the chosen number of cluster. If cluster is a data frame or matrix containing cluster information, then the vector will be used directly to find average of random effects. Clustering is performed with k-medoids algorithms using the function pamk. If "auto" is chosen, krange are set to 2:(nrow(data)-1).

data

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

Value

The function returns a list with the following objects:

est

a data frame containing values of the estimators for each domains.

fit

a list containing the following objects (model is fitted using REML):

components

a list containing the following objects:

Examples

## Not run: 
## Load dataset
data(datasaem.ns)

## If data is defined
Fo = list(Y1 ~ X1,
          Y2 ~ X2,
          Y3 ~ X3)
vardir = c("v1", "v2", "v3", "v12", "v13", "v23")
model.ns <- saeFH.ns.mprop(Fo, vardir, data = datasaem.ns)

## If data is undefined (and option for cluster arguments)
Fo = list(datasaem.ns$Y1 ~ datasaem.ns$X1,
          datasaem.ns$Y2 ~ datasaem.ns$X2,
          datasaem.ns$Y3 ~ datasaem.ns$X3)
vardir = datasaem.ns[, c("v1", "v2", "v3", "v12", "v13", "v23")]

### "auto"
model.ns1 <- saeFH.ns.mprop(Fo, vardir, cluster = "auto")

### number of clusters
model.ns2 <- saeFH.ns.mprop(Fo, vardir, cluster = c(3, 2, 2))

### data frame or matrix containing cluster for each domain
model.ns3 <- saeFH.ns.mprop(Fo, vardir, cluster = datasaem.ns[, c("c1", "c2", "c3")])

## See the estimators
model.ns$est

## End(Not run)


[Package sae.prop version 0.1.2 Index]