Skip to content
Prev 24643 / 398502 Next

Still missing something on missing values...

Matej Cepl <matej at ceplovi.cz> writes:
The length(data$CP1[data$CP1=="Rf"]) construction is unsound (what
happens if there are NA in the indexing variable?) and you'd be better
off with sum(data$CP1 %in% "Rf") or simply table(data$CP1), but that
seems unrelated here.

As you say, your cp1.pdf is perfectly in accordance with the R output,
whereas cp1-whole_data.pdf differs. It also includes the rather
extraordinary claim that 979+27=1005 !! Is there any chance you may
have accidentally modified it?

[If your instructor still insists that SPSS must be right, and this
really is what it gives as output, I'd point out the obvious
discrepancies with itself and with the data set with just the CP1
variable in it, leaving R out of the discussion...]

What is ICPSR, btw?