visualize associations between two groups of data

前端 未结 4 965
清酒与你
清酒与你 2021-01-06 20:11

Where each datapoint has a pairing of A and B and there multiple entries in A and multiple entires in B. IE multiple syndromes and multiple diagnoses, although for each data

4条回答
  •  轮回少年
    2021-01-06 20:43

    Thanks! I think that the connectivity between elements in each class is best visualized by the link graph examples given by both Jonathon and Thierry. Thierry's 2nd which shows the magnitude is definitely where i will start.

    update thanks everyone for you ideas and tips!

    I came acrossthe bipartite package that has functions to visualize this kind of data. I think its a clean visualization of the relationships I am trying to show.

    did:

        library(bipartite)
        dataset <- data.frame(
             A = sample(letters[1:5], 200, prob = runif(5), replace = TRUE), 
             B = sample(LETTERS[20:26], 200, prob = runif(7), replace = TRUE)
         )
        datamat <- as.matrix(table(dataset$A, dataset$B))
        visweb(datamat, text = "interaction", textsize = .8)
    

    giving: visweb result

    couldnt put image in as a new user :(

提交回复
热议问题