meas.est: Measurement error variance estiamtion from repeated measures
Description
Estimates the average variance matrix of measurement error for a set of subjects with repeated measures.
Usage
meas.est(datameas, id, data=NULL )
Arguments
datameas
A data matrix containing the repeated measures of observations, with each variable in a different column and all observations on all subjects in different rows of the same column.
id
An id vector identifying the subject being measured for each observation in the data matrix.
data
A data frame containing the variables listed in data.meas and id.
Value
VA matrix containing the average variances and average convariances of the repeated measures of subjects.
dat.meanA matrix containing the values for each subject, averages across repeated measures. Subjects are in rows, variables in columns.
Details
This function allows the estimation of measurement error variance, given a set of repeated measures on different subjects. Measurement error variance is estimated separately for each subject, then averaged across subjects. This provides terms that can be used to correct for measurement error in allometric analyses.
Any number of variables can be specified in the data matrix for measurement error calculation. If more than one variable is specified, the covariance of measurement error is estimated from the repeated measures as well as the variance.
As well as the estimated measurement error variance, a data matrix is returned which contains the averages of the repeated measures for each subject.
References
Warton D. I., Wright I. J., Falster D. S. and Westoby M. (2006) A review of bivariate line-fitting methods for allometry. Biological Reviews (in press)
#load the individual level leaf example datasetdata(leafmeas)
#Estimate measurement error variance matrix, store in "meas.vr"meas.vr <- meas.est(leafmeas[,3:4], leafmeas$spp)