※上記の広告は60日以上更新のないWIKIに表示されています。更新することで広告が下部へ移動します。

# 各変数の分布の検討

.gcm <- gcmstr[gcmstr$use,
	c("AGE","AGEG","SEX","FOL_MON","FOL_DAY","FOL_DAY2","OPEY","EVENT",
	  "HEIGHTS","WEIGHT","BMI",
	  "ALIVE5")]

# 患者背景
lapply(.gcm[,c("AGE","AGEG","SEX","HEIGHTS","WEIGHT","BMI","OPEY")], summary)
lapply(.gcm[,c("AGE","HEIGHTS","WEIGHT","BMI")], sd, na.rm=T)

par(mfrow=c(2,2))
lapply(.gcm[,c("AGE","HEIGHTS","WEIGHT","BMI")], hist)

splom(~ .gcm[c("AGE","HEIGHTS","WEIGHT","BMI")])

# 患者背景(年代ごと)
.res <-by(.gcm, .gcm$OPEY, FUN=function(data1) {
	list(
	lapply(data1[,c("AGE","AGEG","SEX","HEIGHTS","WEIGHT","BMI")], summary),
	lapply(data1[,c("AGE","HEIGHTS","WEIGHT","BMI")], sd, na.rm=T)
	)
})
print(.res)

require(lattice)

histogram(~AGE | OPEY, .gcm)
histogram(~HEIGHTS | OPEY, .gcm)
histogram(~WEIGHT | OPEY, .gcm)
histogram(~BMI | OPEY, .gcm)

splom(~ .gcm[c("AGE","HEIGHTS","WEIGHT","BMI")] | OPEY, data=.gcm)

# 生存時間
lapply(.gcm[,c("FOL_MON","FOL_DAY","FOL_DAY2")], summary)
lapply(.gcm[,c("FOL_MON","FOL_DAY","FOL_DAY2")], hist)
hist(log(.gcm$FOL_DAY))
hist(log(.gcm$FOL_DAY2))

# 生存時間(年代ごと)
histogram(~log(FOL_DAY) | OPEY, data=.gcm)
histogram(~log(FOL_DAY2) | OPEY, data=.gcm)