sdcTools / sdcMicro

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

calculation of SUDA score #263

Closed orchardlucky closed 5 years ago

orchardlucky commented 6 years ago

Dear Sir,

I get a little confused by the calculation of SUDA score.

image

image

These two pictures are screenshots from the book by Matthias Templ.

Please look at the last two lines of the second picture, I do not know how he get the SUDA score of 2.25 for the observation 8. I think the result is 6/24 +2/24 which is equal to 0.33333...

Thanks.

orchardlucky commented 6 years ago

Hi,

When I run the code to calculate the SUDA score. The results of the SUDA score is different from that written in the book.

tab <- data.frame("age" = c(rep("20s", 7), "60s"), "gender" = c(rep("male", 4), rep("female", 3), "male"), "income" = c("50k+", "50k+", rep("50k-", 6)), "education" = c(rep("highschool", 4), "university", "highschool", "middleschool", "university"))

su <- suda2(tab)

su

names(su)

su$score

[1] 0 0 0 0 4 2 6 8`

Thanks.

alexkowa commented 5 years ago

if you call the suda2 function with su <- suda2(tab,original=FALSE) you get the standardized scores. As seen in the text the 8 (last entry of su$score) is 6+2 described as non-normalized suda score