I have a dataset I am working with that has multiple variables. Some of these variables have observations that are NA. After running the regression there are some observations deleted because of the NA. I subset my data with the following code:
jsubset= jtrain %>% select(2,11,23,24,28)
Which returned the following output: jsubset
A tibble: 471 x 5
fcode d89 cgrant clemploy cgrant_1
<dbl> <dbl> <dbl> <dbl> <dbl>
1 410032 0 0 NA NA
2 410032 0 0 0.270 0
3 410032 1 0 -0.0630 0
4 410440 0 0 NA NA
5 410440 0 0 0.0800 0
6 410440 1 0 0.0741 0
7 410495 0 0 NA NA
8 410495 0 0 0.223 0
9 410495 1 0 -0.0408 0
10 410500 0 0 NA NA
... with 461 more rows
How would I separate FCODES that have values for the remaining columns and FCODES that while they have values for some columns there are NA? Or is it easier to count observations used and deleted from the regression? I know the command in STATA is e(sample) that does this easier but trying to replicate in R.