Type: | Package |
Title: | Data Estimation using Weighted Averages of Multiple Regressions |
Version: | 1.0 |
Date: | 2015-09-22 |
Author: | Olivia Cheronet, John A. Finarelli |
Maintainer: | Olivia Cheronet <cheronetolivia@gmail.com> |
Description: | For multivariate datasets, this function enables the estimation of missing data using the Weighted AVERage of all possible Regressions using the data available. |
License: | GPL-2 |
Depends: | MASS (≥ 7.3-33), kimisc (≥ 0.2-1) |
NeedsCompilation: | no |
Packaged: | 2016-02-12 10:14:25 UTC; cheronetolivia |
Repository: | CRAN |
Date/Publication: | 2016-02-12 14:41:07 |
Data Estimation using Weighted Averages of Multiple Regressions
Description
For multivariate datasets, this function enables the estimation of missing data using the Weighted AVERage of all possible Regressions using the data available as performed by Sears et al (2008).
Details
The waverr function will estimate all missing values of a dataset by, initially performing linear regressions of all possible combinations of variables using the data available, and subsequently using the average of all available values for each variable to estimate, weighting each estimation based on their log likelihood (see Sears et al 2008). Estimations of the error associated with each estimation are also provided.
Author(s)
Olivia Cheronet, John A. Finarelli
References
Sears, K.E., Finarelli, J.A., Flynn, J.J., & Wyss, A.R. (2008). Estimating body mass in New World "monkeys" (Platyrrhini, Primates), with a consideration of the Miocene platyrrhine, Chilecebus carrascoensis. American Museum Novitates, 3617, 1-29.
Examples
AllIrisMeasurements<-iris[,1:4]
Xremove<-sample(1:150, 20,replace=TRUE)
Yremove<-sample(1:4, 20,replace=TRUE)
AllIrisMeasurementsWithNA<-AllIrisMeasurements
for (i in 1:20){AllIrisMeasurementsWithNA[Xremove[i],Yremove[i]]<-NA}
waverr(RawData=AllIrisMeasurementsWithNA,Nrepeats=100)
Data Estimation using Weighted Averages of Multiple Regressions
Description
For multivariate datasets, this function enables the estimation of missing data using the Weighted AVERage of all possible Regressions using the data available as performed by Sears et al (2008).
Usage
waverr(RawData, Nrepeats)
Arguments
RawData |
A dataframe with each individual represented by a separate row and each variable by a column. Missing data coded as NA. |
Nrepeats |
The number of repeats performed for the estimation of the error associated with reconstructed data. |
Value
ReconstructedData |
A matrix of the original data with the missing data replaced by estimated values. It is also saved as a text file in the working directory as "ReconsructedData.txt". |
ReconstructedDataStDev |
A matrix of the standard deviation associated with each estimated value. It is also saved as a text file in the working directory as "ReconsructedDataStDev.txt". |
ResampledData |
A three-dimensional array in which each estimated value is resampled (number of repeats determined by Nrepeats) according to a normal distribution. It is also saved as a text file in the working directory as "ResampledReconstructions.txt". |
VariableStDev |
A matrix of the error associated with each estimated data point as a function of the standard deviation of Nrepeat resampled estimations. It is also saved as a text file in the working directory as "ResampledReconstructionsStandardDeviation.txt". |
Author(s)
Olivia Cheronet, John A. Finarelli
References
Sears, K.E., Finarelli, J.A., Flynn, J.J., & Wyss, A.R. (2008). Estimating body mass in New World "monkeys" (Platyrrhini, Primates), with a consideration of the Miocene platyrrhine, Chilecebus carrascoensis. American Museum Novitates, 3617, 1-29.
Examples
AllIrisMeasurements<-iris[,1:4]
Xremove<-sample(1:150, 20,replace=TRUE)
Yremove<-sample(1:4, 20,replace=TRUE)
AllIrisMeasurementsWithNA<-AllIrisMeasurements
for (i in 1:20){AllIrisMeasurementsWithNA[Xremove[i],Yremove[i]]<-NA}
waverr(RawData=AllIrisMeasurementsWithNA,Nrepeats=100)