2

利用可能な R パッケージのいずれかで、4 つの変数を使用してデータを視覚化する最良の方法をお勧めしてください。

つまり、2 つのカテゴリ変数 (母集団 (12) と文字 (50)) と 2 つの連続変数 (100 人の各文字の長さの測定値の平均と変動係数 (行列の行)) があります。つまり、基本的には 12x50x100x100 次元のグラフです。

助言がありますか?

4

2 に答える 2

2

最初に変数を1つずつプロットし、次に一緒にプロットします。母集団全体から始めて、データをさまざまなグループに段階的にスライスします。

# Sample data
n1 <- 6   # Was: 12
n2 <- 5   # Was: 50
n3 <- 10  # Was: 100
d1 <- data.frame(
  population = rep(LETTERS[1:n1], each=n2*n3),
  character = rep(1:n2, each=n3, times=12),
  id = 1:(n1*n2*n3),
  mean = rnorm(n1*n2*n3),
  var  = rchisq(n1*n2*n3, df=5)
)
# Not used, but often useful with ggplot2
library(reshape2)
d2 <- melt(d1, id.vars=c("population","character","id"))

# Look at the first variable
library(lattice)
densityplot( ~ mean, data=d1 )
densityplot( ~ mean, groups=population, data=d1 )
densityplot( ~ mean | population, groups=character, data=d1 )

# Look at the second variable
densityplot( ~ var, data=d1 )
densityplot( ~ var, groups=population, data=d1 )
densityplot( ~ var | population, groups=character, data=d1 )

# Look at both variables
xyplot( mean ~ var, data=d1 )
xyplot( mean ~ var, groups=population, data=d1 )
xyplot( mean ~ var | population, groups=character, data=d1 )

# The plots may be more readable with lines rather than points
xyplot( 
  mean ~ var | population, groups = character, 
  data = d1, 
  panel = panel.superpose, panel.groups = panel.loess
)
于 2012-02-22T13:35:41.687 に答える
0

latticeデータのいずれかの次元に沿って一連の「スライス」をプロットするかどうかを検討してください。http://addictedtor.free.fr/graphiques/にアクセス して、必要な種類のグラフを作成するコードを誰かが書いているかどうかを確認してみてはいかがでしょうか?

于 2012-02-22T12:32:50.283 に答える