if (FALSE) {
# load datasets carscomplete and carsmissing
data(carscomplete) # complete data
data(carsmissing) # missing values
# apply nipals
my_nipals1 = nipals(carscomplete)
my_nipals2 = nipals(carsmissing)
# plot variables (circle of correlations)
plot(my_nipals1, what="variables", main="Complete data")
plot(my_nipals2, what="variables", main="Missing data")
# plot observations with labels
plot(my_nipals1, what="observations", show.names=TRUE, main="Complete data")
plot(my_nipals2, what="observations", show.names=TRUE, main="Missing data")
# compare results between my_nipals1 and my_nipals2
plot(my_nipals1$scores[,1], my_nipals2$scores[,1], type="n")
title("Scores comparison: my_nipals1 -vs- my_nipals2", cex.main=0.9)
abline(a=0, b=1, col="gray85", lwd=2)
points(my_nipals1$scores[,1], my_nipals2$scores[,1], pch=21,
col="#5592e3", bg = "#5b9cf277", lwd=1.5)
}
Run the code above in your browser using DataLab