Dear all, I would like to ask for help.
I wanted to create subscales by taking various variables together and get the mean value like this:
#> Scale for external problems with subscales RV and AV
YSR_num$mean_S_RV <- rowMeans(subset(YSR_num, select = c("YSR_s_2", "YSR_s_26", "YSR_s_28", "YSR_s_39", "YSR_s_43", "YSR_s_63", "YSR_s_67", "YSR_s_72", "YSR_s_81", "YSR_s_82", "YSR_s_90", "YSR_s_96", "YSR_s_99", "YSR_s_101", "YSR_s_105"), na.rm=T)) # regelverletzendes Verhalten
YSR_num$mean_S_AV <- rowMeans(subset(YSR_num, select = c("YSR_s_3", "YSR_s_16", "YSR_s_19", "YSR_s_20", "YSR_s_21", "YSR_s_22", "YSR_s_23", "YSR_s_37", "YSR_s_57", "YSR_s_68", "YSR_s_86", "YSR_s_87", "YSR_s_89", "YSR_s_94", "YSR_s_95", "YSR_s_97", "YSR_s_104"), na.rm=T)) # aggressives Verhalten
Now there are many NAs in these new Coulums YSR_num$mean_S_RV and YSR_num$mean_S_AV, what doesn't really makes sense, since the variebles we selected ( c("YSR_s_2", "YSR_s_26", etc. ...)) contain only a few missings and it just seems unrealistic for having created so many now.
thats a small output:
Just for checking we tried the same in SPSS and there were no such missings, so we must have done something wrong in R but we just can't find the mistake.