Hi all! I am trying to extract output information from the survfit function in order to generate a matrix of select output for multiple factors. Specifically, I am interested in extracting the number of events (in the output below: 106, 2, 3). The variable names represented in my function (ee) are shown below, but none of those variables correspond to the column of events as shown in the output.
What should I be using to call the number of events? ******************* *Format of the Matrix:* [,1] [,2] [,3] [,4] [,5] [6] [7] [8] [1,] "rs12082473_T" "2288" "2211" "21" "56" (Number of Events) ******************* *CODE & Output:* ee=survfit(Surv(dta$dmi,dta$mi==1)~dta[,i],data=dta) records n.max n.start *events* median 0.95LCL 0.95UCL dta[, i]=0 2211 2211 2211 *106 * NA NA NA dta[, i]=1 21 21 21 *2 * NA NA NA dta[, i]=2 56 56 56 * 3* NA NA NA ******************* *Variable Names*: names(ee) [1] "n" "time" "n.risk" "n.event" "n.censor" "surv" [7] "type" "strata" "std.err" "upper" "lower" "conf.type" [13] "conf.int" "na.action" "call" **************** Thanks! CC [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.