ebpSP | R Documentation |
This function gives the spatial ebp and the estimate of mean squared error (mse) for proportion based on a generalized linear mixed model.
ebpSP( formula, vardir, Ni, ni, proxmat, method = "REML", maxit = 100, precision = 1e-04, data )
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 |
Ni |
a vector of population size for each small area |
ni |
a vector of sample size for each small area |
proxmat |
a D*D proximity matrix of D small areas. The matrix must be row-standardized. |
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 |
The function returns a list with the following objects:
a vector with the values of the estimators for each small area
a vector of the mean squared error estimates for each small area
a matrix consist of area code, ebp, mse, standard error (SE) and coefficient of variation (CV)
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
rho : estimated spatial correlation
randomeffect : a data frame with the values of the area specific random effect
variance : a covariance matrix of estimated variance components
loglike : value of the loglikelihood
deviance : value of the deviance
# Load data set data(headcount) # Fit a generalized linear mixed model with SAR spcification using headcount data result <- ebpSP(ps~x1, var, N, n, Wmatrix, "REML", 100, 1e-04, headcount) result
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.