Displaying 1 result from an estimated 1 matches for "other_ct".
2007 Jul 16
0
FW: summary statistics for groups
...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))
# Summary Statistics for Groups in Dataframes
counts <- table(working$indicator)...