Description Usage Arguments Value Author(s) See Also Examples
Imputes the observation for variables from a reference observation to a
target observation. Also, imputes a value for a reference from other
references. This practice is useful for validation (see yai). Variables
not available in the original data may be imputed using argument ancillaryData.
1 2 3 4  | 
object | 
 an object of class   | 
ancillaryData | 
 a data frame of variables that may not have been used in
the original call to   | 
method | 
 the method used to compute the imputed values for continuous variables,
as follows:   | 
method.factor | 
 the method used to compute the imputed values for factors, as follows:   | 
k | 
 the number neighbors to use in averages, when NULL all present are used.  | 
vars | 
 a character vector of variables to impute, when NULL, the behaviour depends
on the value of   | 
observed | 
 when TRUE, columns are created for observed values (those from the target observations) as well as imputed values (those from the reference observations.  | 
... | 
 passed to other methods, currently not used.  | 
An object of class c("impute.yai","data.frame"), with rownames
identifying observations and column names identifying variables. When
observed=TRUE additional columns are created with a suffix of
.o. 
 NA's fill columns of observed values when no
corresponding value is known, as in the case for Y-variables from
target observations.
 Scale factors for each variable are
returned as an attribute (see attributes).
Nicholas L. Crookston ncrookston.fs@gmail.com 
Andrew O. Finley finleya@msu.edu 
Emilie Henderson emilie.henderson@oregonstate.edu
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18  | require(yaImpute)
data(iris)
# form some test data
refs=sample(rownames(iris),50)
x <- iris[,1:3]      # Sepal.Length Sepal.Width Petal.Length
y <- iris[refs,4:5]  # Petal.Width Species
# build a yai object using mahalanobis
mal <- yai(x=x,y=y,method="mahalanobis")
# output a data frame of observed and imputed values
# of all variables and observations.
impute(mal)
malImp=impute(mal,ancillaryData=iris)
plot(malImp)
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.