Description Usage Arguments Value Examples
This function estimates the parameters of the model
y=Xβ+Z u+ e
where y is the n vector of response variable, X is a n x q known design matrix of fixed effects, Z is a n x l known design matrix of random effects, β is q x 1 vector of fixed effects coefficients and u and e are independent variables with N_l(0, σ^2_u K) and N_n(0, σ^2_e I_n) correspondingly. It also produces the BLUPs and some other useful statistics like large sample estimates of variances and PEV.
1 |
y |
n x 1 numeric vector |
X |
n x q matrix |
Z |
n x l matrix |
K |
l x l matrix of known relationships |
varbetahat |
TRUE or FALSE |
varuhat |
TRUE or FALSE |
PEVuhat |
TRUE or FALSE |
test |
TRUE or FALSE |
Vu |
Estimate of σ^2_u |
Ve |
Estimate of σ^2_e |
betahat |
BLUEs for β |
uhat |
BLUPs for u |
Xsqtestbeta |
χ^2 test statistics for testing whether the fixed effect coefficients are equal to zero. |
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 |
χ^2 test statistic values for testing whether the BLUPs are equal to zero. |
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 β's. |
PEVuhat |
Prediction error variance estimates for the BLUPs. |
loglik |
loglikelihood for the model. |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | 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])
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.