Type: | Package |
Title: | Mean Square Prediction Error Estimation in Small Area Estimation |
Version: | 0.1.0 |
Maintainer: | Mahmoud Torabi <mahmoud.torabi@umanitoba.ca> |
Description: | Estimation of mean squared prediction error of a small area predictor is provided. In particular, the recent method of Simple, Unified, Monte-Carlo Assisted approach for the mean squared prediction error estimation of small area predictor is provided. We also provide other existing methods of mean squared prediction error estimation such as jackknife method for the mixed logistic model. |
License: | MIT + file LICENSE |
Encoding: | UTF-8 |
RoxygenNote: | 7.3.1 |
Imports: | lme4, psych, stats |
NeedsCompilation: | no |
Packaged: | 2024-07-18 14:04:05 UTC; ruwan |
Author: | Mahmoud Torabi [aut, cre], Jiming Jiang [ctb] |
Repository: | CRAN |
Date/Publication: | 2024-07-21 10:00:02 UTC |
MSPE estimation in FH model using double-phase bootstrap method.Calculate the mspe of Fay-Herriot model in SAE using double-phase bootstrap method.
Description
MSPE estimation in FH model using double-phase bootstrap method.Calculate the mspe of Fay-Herriot model in SAE using double-phase bootstrap method.
Usage
mspe_FH_Boot(m, p, X, beta, A, D, B1, B2, R)
Arguments
m |
number of small areas |
p |
number of fixed model parameters |
X |
covariates |
beta |
regression coefficients |
A |
variance of area-specific random effects |
D |
sampling variance |
B1 |
number of first-phase bootstrap method |
B2 |
number of second-phase bootstrap method |
R |
number of simulation runs |
Value
Par: return estimation of model parameters
MSPE.TRUE.Final: return empirical MSPE of small area predictor
mspe.Boot1.Final: return mspe of small area predictor using the bootstrap method 1
mspe.Boot2.Final: return mspe of small area predictor using the bootstrap method 2
RB.Boot1: return relative bias (RB) of mspe of small area predictor using the bootstrap method 1
RB.Boot2: return relative bias (RB) of mspe of small area predictor using the bootstrap method 2
Examples
mspe_FH_Boot(20,3,matrix(runif(60,0,1),nrow=20,byrow=TRUE),c(1,1,1),10,2.5,20,20,10)
MSPE estimation in FH model using Prasad-Rao method. Calculate the mspe of Fay-Herriot model in SAE using Prasad-Rao method.
Description
MSPE estimation in FH model using Prasad-Rao method. Calculate the mspe of Fay-Herriot model in SAE using Prasad-Rao method.
Usage
mspe_FH_PR(m, p, X, beta, A, D, R)
Arguments
m |
number of small areas |
p |
number of fixed model parameters |
X |
Covariates |
beta |
regression coefficients |
A |
variance of area-specific random effects |
D |
sampling variance |
R |
number of simulation runs |
Value
Par: return estimation of model parameters
MSPE.TRUE.Final: return empirical MSPE of small area predictor
mspe.PR.Final: return mspe of small area predictor using the Prasad-Rao method
RB.PR: return relative bias (RB) of mspe of small area predictor using the Prasad-Rao method
Examples
mspe_FH_PR(20,3,matrix(runif(60,0,1),nrow=20,byrow=TRUE),c(1,1,1),10,2.5,10)
MSPE estimation in FH model using SUMCA method. Calculate the mspe of Fay-Herriot model in SAE using Sumca method.
Description
MSPE estimation in FH model using SUMCA method. Calculate the mspe of Fay-Herriot model in SAE using Sumca method.
Usage
mspe_FH_Sumca(m, p, X, beta, A, D, K, R)
Arguments
m |
number of small areas |
p |
number of fixed model parameters |
X |
covariates |
beta |
regression coefficients |
A |
variance of area-specific random effects |
D |
sampling variance |
K |
number of Monte Carlo for the SUMCA method |
R |
number of simulation runs |
Value
Par: return estimation of model parameters
MSPE.TRUE.Final: return empirical MSPE of small area predictor
mspe.Sumca.Final: return mspe of small area predictor using the SUMCA method
RB.SUMCA: return relative bias (RB) of mspe of small area predictor using the SUMCA method
Examples
mspe_FH_Sumca(20,3,matrix(runif(60,0,1),nrow=20,byrow=TRUE),c(1,1,1),10,2.5,10,10)
MSPE estimation in mixed logistic model (Health Insurance data) using bootstrap method. Calculate the mspe of mixed logistic model (Health Insurance data) using bootstrap method.
Description
MSPE estimation in mixed logistic model (Health Insurance data) using bootstrap method. Calculate the mspe of mixed logistic model (Health Insurance data) using bootstrap method.
Usage
mspe_LOGISTIC_HealthData_BOOT(
m,
p,
n.new,
y.new,
cum.n.new,
Xi,
yi.tem,
X.tem,
county.tem,
B
)
Arguments
m |
number of domains |
p |
number of complete model parameters |
n.new |
sample size of each domain |
y.new |
response variable |
cum.n.new |
Cummulaticve sum of n |
Xi |
covariates |
yi.tem |
response variable for each individual |
X.tem |
Individual level covariates |
county.tem |
county |
B |
number of bootstrap iterations |
Value
Par: return estimation of model parameters
Mu.hat: return prediction of domain parameters
mspe.boot: return mspe of small area (domain) predictor using the bootstrap method
sq.mspe.boot: return square root of mspe of small area predictor for non-zero domains using the bootstrap method
Examples
mspe_LOGISTIC_HealthData_BOOT(20,3,c(2,1,2,2,1,2,3,1,1,3,1,3,2,3,3,
1,2,1,3,3),c(3,4,2,2,3,3,4,3,4,1,4,1,3,5,4,7,1,3,1,2),c(2,3,5,7,8,10,13,14,15
,18,19,22,24,27,30,31,33,34,37,40),
matrix(runif(60,0,1),nrow=20,byrow=TRUE),sample(c(0,1),replace=TRUE,40),
matrix(c(runif(40,7,10),runif(40,14,22),runif(40,2,4)),nrow=40,byrow=FALSE),
rep(1:20,each=2),10)
MSPE estimation in mixed logistic model (Health Insurance data) using jackknife method.Calculate the mspe of mixed logistic model (Health Insurance data) using jackknife method.
Description
MSPE estimation in mixed logistic model (Health Insurance data) using jackknife method.Calculate the mspe of mixed logistic model (Health Insurance data) using jackknife method.
Usage
mspe_LOGISTIC_HealthData_JLW(
m,
p,
n.new,
y.new,
Xi,
yi.tem,
cum.n.new,
county.tem,
X.tem
)
Arguments
m |
number of domains |
p |
number of complete model parameters |
n.new |
sample size of each domain |
y.new |
response variable |
Xi |
covariates for each domain |
yi.tem |
response variable for each individual |
cum.n.new |
Cummulative sum of n |
county.tem |
county |
X.tem |
Individual level covariates |
Value
Par: return estimation of model parameters
Mu.hat: return prediction of domain parameters
mspe.JLW: return mspe of small area (domain) predictor using the jackknife method
sq.mspe.JLW: return square root of mspe of small area predictor for non-zero domains using the jackknife method
Examples
mspe_LOGISTIC_HealthData_JLW(20,3,c(2,1,2,2,1,2,3,1,1,3,1,3,2,3,3,
1,2,1,3,3),c(3,4,2,2,3,3,4,3,4,1,4,1,3,5,4,7,1,3,1,2),
matrix(runif(60,0,1),nrow=20,byrow=TRUE),sample(c(0,1),replace=TRUE,40),
c(2,3,5,7,8,10,13,14,15,18,19,22,24,27,30,31,33,34,37,40),rep(1:20,each=2),
matrix(c(runif(40,7,10),runif(40,14,22),runif(40,2,4)),nrow=40,byrow=FALSE))
MSPE estimation in mixed logistic model (Health Insurance data) using SUMCA method.Calculate the mspe of mixed logistic model (Health Insurance data) using SUMCA method.
Description
MSPE estimation in mixed logistic model (Health Insurance data) using SUMCA method.Calculate the mspe of mixed logistic model (Health Insurance data) using SUMCA method.
Usage
mspe_LOGISTIC_HealthData_SUMCA(
m,
p,
n.new,
y.new,
Xi,
cum.n.new,
yi.tem,
X.tem,
county.tem,
K
)
Arguments
m |
number of domains |
p |
number of complete model parameters |
n.new |
sample size of each domain |
y.new |
response variable |
Xi |
covariates |
cum.n.new |
Cummulative sum of n |
yi.tem |
response variable for each individual |
X.tem |
Individual level covariates |
county.tem |
county |
K |
number of Monte Carlo for the SUMCA method |
Value
Par: return estimation of model parameters
Mu.hat: return prediction of domain parameters
mspe.Sumca: return mspe of small area (domain) predictor using the SUMCA method
sq.mspe.Sumca: return square root of mspe of small area predictor for non-zero domains using the SUMCA method
Examples
mspe_LOGISTIC_HealthData_SUMCA(20,3,c(2,1,2,2,1,2,3,1,1,3,1,3,2,3,
3,1,2,1,3,3),c(3,4,2,2,3,3,4,3,4,1,4,1,3,5,4,7,1,3,1,2),
matrix(runif(60,0,1),nrow=20,byrow=TRUE),c(2,3,5,7,8,10,13,14,15
,18,19,22,24,27,30,31,33,34,37,40),sample(c(0,1),replace=TRUE,40),
matrix(c(runif(40,7,10),runif(40,14,22),runif(40,2,4)),nrow=40,byrow=FALSE),
rep(1:20,each=2),10)
Model selection MSPE estimation in mixed logistic model using jackknife method.Calculate the model selection mspe of mixed logistic model using jackknife method.
Description
Model selection MSPE estimation in mixed logistic model using jackknife method.Calculate the model selection mspe of mixed logistic model using jackknife method.
Usage
mspe_MS_LOGISTIC_JLW(m, p, ni, X, beta, A, R)
Arguments
m |
number of small areas |
p |
number of complete model parameters |
ni |
sample size of each small area |
X |
covariates for the complete model |
beta |
regression coefficients of the complete model |
A |
variance of area-specific random effects |
R |
number of simulation runs |
Value
Par1: return estimation of model parameters of the complete model
Par2: return estimation of model parameters of the reduced model
MSPE: return empirical MSPE of small area predictor
mspe.JLW: return mspe of small area predictor using the jackknife method
RB.JLW: return relative bias (RB) of mspe of small area predictor using the jackknife method
BIC: return BIC of the complete and reduced models
Examples
mspe_MS_LOGISTIC_JLW(20,3,2,
matrix(runif(60,0,1),nrow=20,byrow=TRUE),c(1,1,1),10,2)
Model selection MSPE estimation in mixed logistic model using SUMCA method. Calculate the model selection mspe of mixed logistic model using SUMCA method.
Description
Model selection MSPE estimation in mixed logistic model using SUMCA method. Calculate the model selection mspe of mixed logistic model using SUMCA method.
Usage
mspe_MS_LOGISTIC_SUMCA(m, p, ni, X, beta, A, K, R)
Arguments
m |
number of small areas |
p |
number of complete model parameters |
ni |
sample size of each small area |
X |
covariates for the complete model |
beta |
regression coefficients of the complete model |
A |
variance of area-specific random effects |
K |
number of Monte Carlo for the SUMCA method |
R |
number of simulation runs |
Value
Par1: return estimation of model parameters of the complete model
Par2: return estimation of model parameters of the reduced model
MSPE: return empirical MSPE of small area predictor
mspe.Sumca: return mspe of small area predictor using the SUMCA method
RB.SUMCA: return relative bias (RB) of mspe of small area predictor using the SUMCA method
BIC: return BIC of the complete and reduced models
Examples
mspe_MS_LOGISTIC_SUMCA(20,3,2,matrix(runif(60,0,1),nrow=20,byrow=TRUE),c(1,1,1),10,5,5)
Post model selection MSPE estimation in FH model using Datta-Hall-Mandal method. Calculate the post-model selection mspe of Fay-Herriot model using Datta-Hall-Mandal method.
Description
Post model selection MSPE estimation in FH model using Datta-Hall-Mandal method. Calculate the post-model selection mspe of Fay-Herriot model using Datta-Hall-Mandal method.
Usage
mspe_PMS_FH_DHM(m, p, X, beta, A, D, R)
Arguments
m |
number of small areas |
p |
number of fixed model parameters |
X |
covariates |
beta |
regression coefficients |
A |
variance of area-specific random effects |
D |
sampling variance |
R |
number of simulation runs |
Value
Par: return estimation of model parameters
MSPE.TRUE.Final: return empirical MSPE of small area predictor
mspe.DHM.Final: return mspe of small area predictor using the Datta-Hall-Mandal method
RB.DHM: return relative bias (RB) of mspe of small area predictor using the Datta-Hall-Mandal method
Rate: return the probability of rejection (nominal level= 0.2)
Examples
mspe_PMS_FH_DHM(20,3,matrix(runif(60,0,1),nrow=20,byrow=TRUE),
c(1,1,1),10,2.5,10)
Post model selection MSPE estimation in FH model using SUMCA method. Calculate the post-model selection mspe of Fay-Herriot model using SUMCA method.
Description
Post model selection MSPE estimation in FH model using SUMCA method. Calculate the post-model selection mspe of Fay-Herriot model using SUMCA method.
Usage
mspe_PMS_FH_SUMCA(m, p, X, beta, A, D, K, R)
Arguments
m |
number of small areas |
p |
number of fixed model parameters |
X |
covariates |
beta |
regression coefficients |
A |
variance of area-specific random effects |
D |
sampling variance |
K |
number of Monte Carlo for the SUMCA method |
R |
number of simulation runs |
Value
Par: return estimation of model parameters
MSPE.TRUE.Final: return empirical MSPE of small area predictor
mspe.Sumca.Final: return mspe of small area predictor using the SUMCA method
RB.SUMCA: return relative bias (RB) of mspe of small area predictor using the SUMCA method
Examples
mspe_PMS_FH_SUMCA(20,3,matrix(runif(60,0,1),nrow=20,byrow=TRUE),
c(1,1,1),10,2.5,10,10)
Post model selection MSPE estimation in FH model with mean mis-specification using Datta-Hall-Mandal method. Calculate the post-model selection mspe of Fay-Herriot model with mean mis-specification using Datta-Hall-Mandal method.
Description
Post model selection MSPE estimation in FH model with mean mis-specification using Datta-Hall-Mandal method. Calculate the post-model selection mspe of Fay-Herriot model with mean mis-specification using Datta-Hall-Mandal method.
Usage
mspe_PMS_Mis_FH_DHM(m, p, X, beta1, beta2, A, D, R)
Arguments
m |
number of small areas |
p |
number of fixed model parameters |
X |
covariates |
beta1 |
regression coefficients |
beta2 |
regression coefficients |
A |
variance of area-specific random effects |
D |
sampling variance |
R |
number of simulation runs |
Value
Par: return estimation of model parameters
MSPE.TRUE.Final: return empirical MSPE of small area predictor
mspe.DHM.Final: return mspe of small area predictor using the Datta-Hall-Mandal method
RB.DHM: return relative bias (RB) of mspe of small area predictor using the Datta-Hall-Mandal method
Rate: return the probability of rejection (nominal level= 0.2)
Examples
mspe_PMS_Mis_FH_DHM(20,3,matrix(runif(60,0,1),nrow=20,byrow=TRUE),
c(1,1,1),c(1,1,1),10,2.5,10)
Post model selection MSPE estimation in FH model with mean mis-specification using SUMCA method. Calculate the post-model selection mspe of Fay-Herriot model with mean mis-specification using SUMCA method.
Description
Post model selection MSPE estimation in FH model with mean mis-specification using SUMCA method. Calculate the post-model selection mspe of Fay-Herriot model with mean mis-specification using SUMCA method.
Usage
mspe_PMS_Mis_FH_SUMCA(m, p, X, beta1, beta2, A, D, K, R)
Arguments
m |
number of small areas |
p |
number of fixed model parameters |
X |
covariates |
beta1 |
regression coefficient |
beta2 |
regression coefficient |
A |
variance of area-specific random effects |
D |
sampling variance |
K |
number of Monte Carlo for the SUMCA method |
R |
number of simulation runs |
Value
Par: return estimation of model parameters
MSPE.TRUE.Final: return empirical MSPE of small area predictor
mspe.Sumca.Final: return mspe of small area predictor using the SUMCA method
RB.SUMCA: return relative bias (RB) of mspe of small area predictor using the SUMCA method
Examples
mspe_PMS_Mis_FH_SUMCA(20,3,matrix(runif(60,0,1),nrow=20,byrow=TRUE)
,c(1,1,1),c(1,1,1),10,2.5,10,10)