2013-10-12 59 views

回答

2

这里是潜在的数据的模拟:

Smoker <- sample(c("yes", "no"), 100, T) 
    Days <- sample(c("thu", "fri", "sat", "sun"), 100, T) 
    Time <- sample(c("day", "night"), 100, T) 
    Sex <- sample(c("m", "f"), 100, T) 
    Value <- sample(1:10, 100, T) 

    DF <- data.frame(Value, Smoker, Days, Time, Sex) 

情节使用包装vcd生产:

library(vcd) 

    cotabplot(~ Smoker + Days + Time | Sex, data = DF, panel = cotab_mosaic, direction = "v") 

编辑:上传的情节:

plot http://i41.tinypic.com/2mhg8ow.jpg

4

你只是在寻找内置到VCD面板功能::: cotabplot

library(vcd) 
data("alzheimer", package = "coin") 
alz <- xtabs(~smoking + disease + gender, data = alzheimer) 
cotabplot(~ smoking + disease | gender, data = alz, panel = cotab_coindep, n = 5000) 

example http://img844.imageshack.us/img844/8407/1l6d.jpg

+0

它也可能感兴趣你寻找到了不同的参数“面板”发生。以下是帮助文件:http://rss.acs.unt.edu/Rdoc/library/vcd/html/cotab_panel.html –