Description Usage Arguments Author(s) References Examples
Returns estimates of variance components for the within and between center variability based on a MR fit.
1 | varcomp.mrfit(fit)
|
fit |
fit from mrfit |
John Kloke kloke@biostat.wisc.edu
Rashid, M.M., McKean, J.W., Kloke, J.D. (2011). R Estimates and Associated Inferences for Mixed Models with Covariates in a Multi-Center Clinical Trial. Statistics in Biopharmaceutical Research.
1 2 3 4 5 6 7 8 9 10 11 12 13 | m<-40; n<-4; N<-m*n ; p<-2
block<-rep(1:m,each=n)
Z<-model.matrix(~as.factor(block))
b<-rnorm(m,sd=3)
e<-rnorm(N,sd=1)
y<-Z
x<-matrix(rnorm(p*N),ncol=p)
#### for some reason the following code does not run with R CMD check
#### but runs otherwise ##
# fit<-mrfit(x,y,block,beta0=rep(0,2))
# vc<-varcomp.mrfit(fit)
### interclass correlation coefficient should be close to 9/10 ###
# with(vc, sigmab^2/(sigmab^2+sigmae^2))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.