| compare.yai {yaImpute} | R Documentation |
Compares different k-NN solutions
Description
Provides a convenient display of the root mean square differences
(see rmsd.yai) or correlations (see cor.yai) between observed and
imputed values for each of several imputations. Each column of the returned
data frame corresponds to an imputation result and each row corresponds to a
variable.
Usage
compare.yai(...,ancillaryData=NULL,vars=NULL,method="rmsd",scale=TRUE)
Arguments
... |
a list of objects created by |
ancillaryData |
a data frame that defines new variables, passed to |
vars |
a list of variable names you want to include; if NULL all available variables are included. |
method |
when rmsd is specified, the comparison is based on root mean
square differences between observed an imputed, and |
scale |
passed to |
Value
A data.frame of class c("compare.yai","data.frame"), where the columns
are the names of the ...-arguments and the rows are a union of
variable names. NA's are returned when the variables are factors. The scale values (if used)
are returned as an attribute (all if some are different than others, a warning is issued).
Author(s)
Nicholas L. Crookston ncrookston.fs@gmail.com
Andrew O. Finley finleya@msu.edu
See Also
yai, plot.compare.yai,
impute.yai, rmsd.yai
Examples
require(yaImpute)
data(iris)
# form some test data
refs=sample(rownames(iris),50)
x <- iris[,1:2] # Sepal.Length Sepal.Width
y <- iris[refs,3:4] # Petal.Length Petal.Width
# build yai objects using 2 methods
msn <- yai(x=x,y=y)
mal <- yai(x=x,y=y,method="mahalanobis")
# compare the y variables
compare.yai(msn,mal)
# compare the all variables in iris
compare.yai(msn,mal,ancillaryData=iris) # Species is a factor, no comparison is made