Learn R Programming

yaImpute (version 1.0-32)

compare.yai: 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)

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).

Arguments

...

a list of objects created by yai or impute.yai that you wish to compare.

ancillaryData

a data frame that defines new variables, passed to impute.yai.

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
when cor is specified, the comparison is based on correlations between observed and imputed.

scale

passed to rmsd.yai

Author

Nicholas L. Crookston ncrookston.fs@gmail.com
Andrew O. Finley finleya@msu.edu

See Also

yai, plot.compare.yai, impute.yai, rmsd.yai

Examples

Run this code
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

Run the code above in your browser using DataLab