ebpNP {NSAE} | R Documentation |
Nonparametric ebp using spatial spline for proportion under generalized linear mixed model
Description
This function gives the nonparametric ebp and the estimate of mean squared error (mse) for proportion based on a nonstationary generalized linear mixed model.
Usage
ebpNP(
formula,
vardir,
n.knot,
Ni,
ni,
lat,
lon,
method = "REML",
maxit = 100,
precision = 1e-04,
data
)
Arguments
formula |
an object of class list of formula, describe the model to be fitted |
vardir |
a vector of sampling variances of direct estimators for each small area |
n.knot |
number of knot in spatial splines. Default is 25 knot |
Ni |
a vector of population size for each small area |
ni |
a vector of sample size for each small area |
lat |
a vector of latitude for each small area |
lon |
a vector of longitude for each small area |
method |
type of fitting method, default is "REML" method |
maxit |
number of iterations allowed in the algorithm. Default is 100 iterations |
precision |
convergence tolerance limit for the Fisher-scoring algorithm. Default value is 1e-04 |
data |
a data frame comprising the variables named in formula and vardir |
Value
The function returns a list with the following objects:
- ebp
a vector with the values of the estimators for each small area
- mse
a vector of the mean squared error estimates for each small area
- sample
a matrix consist of area code, ebp, mse, standard error (SE) and coefficient of variation (CV)
- fit
a list containing the following objects:
estcoef : a data frame with the estimated model coefficients in the first column (beta), their asymptotic standard errors in the second column (std.error), the t statistics in the third column (tvalue) and the p-values of the significance of each coefficient in last column (pvalue)
refvar : estimated random effects variance
lambda : estimated spatial intensity paprameter
randomeffect : a data frame with the values of the area specific random effect
gamma : a data frame with the values of the spatially correlated random effect
variance : a covariance matrix of estimated variance components
Examples
# Load data set
data(headcount)
# Fit a nonparametric generalized linear mixed model using headcount data
result <- ebpNP(y~x1, var,25, N, n, lat, long, "REML", 100, 1e-04,headcount)
result