sdcTools / sdcMicro

sdcMicro
http://sdctools.github.io/sdcMicro/
79 stars 23 forks source link

SUDA attribute level contributions when variable has NA as a level #296

Closed undestu closed 4 years ago

undestu commented 4 years ago

The suda2 function's output attribute_level_contribution does not seem to properly report a variable's attribute level risk when said variable has NA as a level. For eg:

df <- mtcars[, c("cyl", "am", "gear", "carb")]
df[1, "cyl"] <- NA
df_suda <- suda2(df, missing = NA)

df_suda$attribute_level_contributions

gives the result...

Untitled

... where all the level risks for variable cyl are unexpectedly NA.

Can this be fixed in future updates to sdcMicro please?

bernhard-da commented 4 years ago

hi @undestu thx for reporting. i pushed an update that should address the issue.