Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Observation deleted due to missingness in R

Tags:

r

regression

I am busy with a regression model in R and i have about 16 000 observations. One of these observations causes me to get the following error message,

(1 observation deleted due to missingness)

Is there a way in R so that i can identify this one observation?

like image 824
Jason Samuels Avatar asked Feb 10 '15 10:02

Jason Samuels


1 Answers

If your data is in a data.frame x, and each row corresponds to an observation, then the way to go about this is to identify complete cases via complete.cases(x). Conversely, to find missing values in an observation, do ! complete.cases(x). To find out which observation contains missing values, do

which(! complete.cases(x))
like image 165
Konrad Rudolph Avatar answered Sep 20 '22 21:09

Konrad Rudolph