mspeFHjack: Compute MSPE through Jackknife-based MSPE estimation method...

View source: R/RcppExports.R

mspeFHjackR Documentation

Compute MSPE through Jackknife-based MSPE estimation method for Fay Herriot model

Description

This function returns MSPE estimator with jackknife method for Fay Herriot model.

Usage

mspeFHjack(formula, data, D, method = 1, na_rm, na_omit)

Arguments

formula

(formula). Stands for the model formula that specifies the auxiliary variables to be used in the regression model. This should follow the R model formula syntax.

data

(data frame). It represents the data containing the response values and auxiliary variables for the Nested Error Regression Model.

D

(vector). Stands for the known sampling variances of each small area levels.

method

The variance component estimation method to be used. See "Details".

na_rm

A logical value indicating whether to remove missing values (NaN) from the input matrices and vectors. If TRUE, missing values in the input data (X, Y, and D) are automatically cleaned using internal functions. If FALSE, missing values are not removed. Defaults to FALSE.

na_omit

A logical value indicating whether to stop the execution if missing values (NaN) are present in the input data. If TRUE, the function will check for missing values in X, Y, and D. If any missing values are found, an error message will be raised, prompting the user to handle the missing data before proceeding. Defaults to FALSE.

Details

This bias-corrected jackknife MSPE estimator was proposed by J. Jiang and L. S. M. Wan, it covers a fairly general class of mixed models which includes gLMM, mixed logistic model and some of the widely used mixed linear models as special cases.

Default value for method is 1, method = 1 represents the MOM method, method = 2 and method = 3 represents ML and REML method, respectively.

Value

This function returns a list with components:

MSPE

(vector) MSPE estimates for Fay Herriot model.

bhat

(vector) Estimates of the unknown regression coefficients.

Ahat

(numeric) Estimates of the variance component.

Author(s)

Peiwen Xiao, Xiaohui Liu, Yu Zhang, Yuzi Liu, Jiming Jiang

References

M. H. Quenouille. Approximate tests of correlation in time series. Journal of the Royal Statistical Society. Series B (Methodological), 11(1):68-84, 1949.

J. W. Tukey. Bias and confidence in not quite large samples. Annals of Mathematical Statistics, 29(2):614, 1958.

J. Jiang and L. S. M. Wan. A unified jackknife theory for empirical best prediction with m estimation. Annals of Statistics, 30(6):1782-1810, 2002.

Examples

X <- matrix(runif(10 * 3), 10, 3)
X[,1] <- rep(1, 10) 
D <- (1:10) / 10 + 0.5
Y <- X %*% c(0.5, 1, 1.5) + rnorm(10, 0, sqrt(2)) + rnorm(10, 0, sqrt(D))
data <- data.frame(Y = Y, X1 = X[,2], X2 = X[,3])
formula <- Y ~ X1 + X2
result <- mspeFHjack(formula, data, D, method = 1)

saeMSPE documentation built on April 4, 2025, 5:18 a.m.