[R] Extended summary

David Winsemius dwinsemius at comcast.net
Tue Oct 14 23:04:58 CEST 2008


My reading of the manual and my use of str(test1) on the simple  
example suggests that you try using the na.action component of the  
model object. That should return the index of elements that were  
excluded.

On Oct 14, 2008, at 7:29 AM, Kåre Edvardsen wrote:

> Is there a function providing more descriptive statistics than
> "summary()"? I'm working with a coxph analyses and would like to have
> more info on certain numbers.
>
> If my call is something like:
>
> Call:
> coxph(formula = Surv(followup, CasesCancer) ~ age + BMI + parity +  
> HRT)

Example modified from help page
 > #
 >  test1 <- list(time=  c(4, 3,1,1,2,2,3, NA,5, 3),
+                 status=c(1,1,1,0,1,1,0, 1, 0, 0),
+                 x=     c(0, 2,1,1,1,0,0, 1, 0, NA),
+                 sex=   c(0, NA,1,0,1,1,1, 1, 1, 1))
 >  c.mdl <- coxph( Surv(time, status) ~ x + strata(sex), test1)   
#stratified model
 > with(test1,Surv(time,status))[c.mdl$na.action,]
[1]  3  NA   3+


>
> I'd like to know:
>
> * How many CasesCancer was excluded (not only the total number of
> excluded due to missing)

If I understand your question, once you have the indices it should be  
fairly straightforward to display or count the cases excluded in the  
Surv object (if you meant as opposed to the censored records).

-- 
David Winsemius
>
> * Distribution of variables (where are the NA's)
>
> Cheers,
> Kare
>
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at 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.



More information about the R-help mailing list