Displaying 1 result from an estimated 1 matches for "ave_exposur".
Did you mean:
ave_exposure
2007 Jul 16
0
FW: summary statistics for groups
...quot;dis3",3))
n <- length(icd9)
exposure <- rnorm(n)
working <- data.frame(icd9, exposure)
# get some useful things together
numDis <- length(levels(working$icd9))
diseaseCodes <- levels(working$icd9)
# capture results in here
results <- data.frame(ICD9code=diseaseCodes, ave_exposure=rep(NA,
numDis), ICD9count=rep(NA, numDis), other_ave=rep(NA, numDis),
other_Ct=rep(NA, numDis))
for(k in 1:numDis){
working$indicator <- ifelse(working$icd9==diseaseCodes[k], "Yes",
"No")
xbars <- with(working, tapply(exposure, list(indicator), mean))
# Summar...