Description Usage Arguments Value Examples
This function produces EBLUPs, MSE of Univariate SAE
1 |
formula |
List of formula that describe the fitted model |
vardir |
Sampling variances of direct estimations,if it is included in data frame so it is the vector with the name of sampling variances.if it is not, it is a data frame of sampling variance in order : |
samevar |
Whether the variances of the data are same or not. Logical input with default |
MAXITER |
Maximum number of iteration in Fisher-scoring algorithm with default |
PRECISION |
Limit of Fisher-scoring convergence tolerance with default |
data |
The data frame |
This function returns a list of the following objects:
SAE_Eblup |
A dataframe with the values of the EBLUPs estimators |
MSE_Eblup |
A dataframe with the values of estimated mean square errors of EBLUPs estimators |
randomEffect |
A dataframe with the values of the random effect estimators |
Rmatrix |
A block diagonal matrix composed of sampling errors |
fit |
A list containing the following objects: |
method : The fitting method (this function is using "REML")
convergence : The convergence result of Fisher-scoring algorithm (Logical Value)
iterations : The number of Fisher-Scoring algorithm iterations
estcoef : A dataframe with the estimated model coefficient, standard error,t statistics, p-values of the significance of each coefficient
refvar : A dataframe with estimated random effect variances
informationFisher : A matrix of information fisher from Fisher-scoring algorithm
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | ##load dataset
data(datamsaeDB)
#Compute Fitted model for Y1, Y2, and Y3
#Y1 ~ X1 + X2
#Y2 ~ X2
#Y3 ~ X1
##Using parameter 'data'
formula = list(f1 = Y1~X1+X2,
f2 = Y2~X2,
f3 = Y3~X1)
vardir = c("v1","v12","v13","v2","v23","v3")
#Note : in real data for univariate SAE, if you does not have the values of covariances,
# set covariancse as zero in the dataframe
saeFH <- saefh(formula, vardir, data=datamsaeDB)
#to calculate only one response variable
saeFH1 <- saefh(formula=list(f1=Y1~X1+X2),vardir ="v1",data=datamsaeDB )
##Do not use parameter 'data'
formula = list(f1 = datamsaeDB$Y1~datamsaeDB$X1+datamsaeDB$X2,
f2 = datamsaeDB$Y2~datamsaeDB$X2,
f3 = datamsaeDB$Y3~datamsaeDB$X1)
vardir = datamsaeDB[,c("v1","v12","v13","v2","v23","v3")]
#Note : in real data for univariate SAE, if you does not have the values of covariances,
# set covariancse as zero in the dataframe
saeFH_d <- saefh(formula, vardir)
saeFH$SAE_Eblup #to see EBLUP Estimators
saeFH$MSE_Eblup #to see estimated MSE of EBLUP estimators
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.