emmreml {EMMREML} | R Documentation |
Solver for Gaussian mixed model with known covariance structure.
Description
This function estimates the parameters of the model
where is the
vector of response variable,
is a
known design matrix of fixed effects,
is a
known design matrix of random effects,
is
vector of fixed effects coefficients and
and
are independent variables with
and
correspondingly. It also produces the BLUPs and some other useful statistics like large sample estimates of variances and PEV.
Usage
emmreml(y, X, Z, K,varbetahat=FALSE,varuhat=FALSE, PEVuhat=FALSE, test=FALSE)
Arguments
y |
|
X |
|
Z |
|
K |
|
varbetahat |
TRUE or FALSE |
varuhat |
TRUE or FALSE |
PEVuhat |
TRUE or FALSE |
test |
TRUE or FALSE |
Value
Vu |
Estimate of |
Ve |
Estimate of |
betahat |
BLUEs for |
uhat |
BLUPs for |
Xsqtestbeta |
|
pvalbeta |
pvalues obtained from large sample theory for the fixed effects. We report the pvalues adjusted by the "padjust" function for all fixed effect coefficients. |
Xsqtestu |
|
pvalu |
pvalues obtained from large sample theory for the BLUPs. We report the pvalues adjusted by the "padjust" function. |
varuhat |
Large sample variance for the BLUPs. |
varbetahat |
Large sample variance for the |
PEVuhat |
Prediction error variance estimates for the BLUPs. |
loglik |
loglikelihood for the model. |
Examples
n=200
M1<-matrix(rnorm(n*300), nrow=n)
K1<-cov(t(M1))
K1=K1/mean(diag(K1))
covY<-2*K1+1*diag(n)
Y<-10+crossprod(chol(covY),rnorm(n))
#training set
Trainset<-sample(1:n, 150)
funout<-emmreml(y=Y[Trainset], X=matrix(rep(1, n)[Trainset], ncol=1),
Z=diag(n)[Trainset,], K=K1)
cor(Y[-Trainset], funout$uhat[-Trainset])