I'm trying to do a couple of composite indexes for my thesis. I followed this video indication (https://www.youtube.com/watch?v=vdmYv0YnWEE&ab_channel=DavidCaughlin)
My composite index works
ECEMD$indice3 <- rowMeans(ECEMD[, c("PROFSKILL_WRITESTD2", "PROFSKILL_WRITEGRANT", "PROFSKILL_PUBLISH", "PROFSKILL_HUMANETHIC", "PROFSKILL_ANIMETHIC", "PROFSKILL_IP", "PROFSKILL_PROFETHIC", "RESEXP_WRITEGRANT", "PRESPUBNUM_FUNDMEET", "PRESPUBNUM_NATLMEET", "PRESPUBNUM_PRESMEET", "PRESPUB_SEMINAR", "PRESPUBNUM_COAUTH", "PRESPUBNUM_AUTHOR", "PROFSKILL_CAREERACAD", "PROFSKILL_RESPOS")], na.rm = TRUE)
But as soon as I try to figure out the mean of this composite index for the total of my database or by year, it says NaN (not a number). I am 100% certain that my database contains only numbers.
indice3_mean <- mean(ECEMD$indice3)
There is alot of NA's although. What should I do?