0

I am able to use to generate basic and attribute upset plots using the UpsetR package. But, I am not able to generate plots using survey data. Has anyone tried making upset plots in survey data? Thanks.

My error is:

"cannot coerce class ‘c("survey.design2", "survey.design")’ to a data.frame".

avocadoLambda
  • 1,332
  • 7
  • 16
  • 33
Laxmi
  • 21
  • 4
  • survey data are weighted so might not play nicely with some graphical functions. maybe use the `library(survey)` functions like `svymean` and `svyquantile` to calculate the statistics that you want, then visualize the results? – Anthony Damico Jun 16 '20 at 14:59
  • Thanks for the input. I wanted to use UpsetR as I have 9 sets/groups with multiple interactions. It would have been nice to show the interaction of sets, but looks like it is not possible. I wrote to Nils Gehlenborg, the developer and he mentioned that if I have the data, it is doable. I dont know if he understood my question. – Laxmi Jun 17 '20 at 18:07

1 Answers1

1

It is possible but you have to work around a little bit. I have done this with a survey with binary responses. First you consider all the possible response arrays and multiply each response array by the weighted frequency. After that you can use UpsetR on the resulting data matrix. You can find our paper detailing the method here:

'Constructing UpSet plot for survey data with weights using SAS and R software' https://www.tandfonline.com/doi/abs/10.1080/03610918.2021.1904142?journalCode=lssp20

Although the method uses SAS to calculate the weighted frequencies you can do that step with R as well.

Dharman
  • 30,962
  • 25
  • 85
  • 135