data(xs.nz)
xs.nz[, 12]
are dangerous.Although some data cleaning was performed and logic checks conducted, anomalies remain. Some variables, of course, are subject to a lot of measurement error and bias. It is conceivable that some participants had poor reading skills!
chest.nz
.data(xs.nz)
summary(xs.nz)
# Handling of factors requires care
is.factor(xs.nz$babies) # TRUE
summary(xs.nz$babies) # Note the "-"s
charbabies <- as.character(xs.nz$babies)
summary(as.numeric(charbabies)) # "-"s converted to NAs + warning
table(as.numeric(charbabies)) # Ditto
Run the code above in your browser using DataLab