missing data NA output

27 views
Skip to first unread message

mtsc...@gmail.com

unread,
Aug 23, 2020, 5:17:21 PM8/23/20
to compareGroups Forum
Dear folks,

I have a dataframe containing numeric and categorical data. One variable contains missing values (original denomination #Null!). After transformation into NA (df[df == "#NULL!"] <- NA) I run descrTable(dataframe) and get the following answer:

Warning messages:
1: In compare.i(X[, i], y = y, selec.i = selec[i], method.i = method[i],  :
  Some levels of 'BMI' are removed since no observation in that/those levels
2: In compareGroups.fit(X = X, y = y, include.label = include.label,  :
  Variables 'BMI' have been removed since some errors occurred

I do not get the  error when using the example dataframe "regicor" also containing missing values denominated as NA and using the same code.

you find the link to my dataframe attached: 


my used code:

df <- read.csv("acei_error.csv")

library(compareGroups)

df$gender <- factor(df$gender, labels = c("Female patients", "Male patients"))
df$acei <- factor(df$acei, labels = c("no", "yes"))

df[df == "#NULL!"] <- NA

descrTable(df)


many thanks in advance and thank you for your amazing work!
Reply all
Reply to author
Forward
0 new messages