[R] The Censummary Function...

Jeffrey Robert Spies jspies at nd.edu
Mon Oct 23 23:56:42 CEST 2006


Try:

censummary(AsExample$AsLow, AsExample$AsHigh, AsExample$AsCen)

 From the Introduction to R (http://cran.r-project.org/doc/manuals/R- 
intro.html#Lists-and-data-frames):
"Components of lists may also be named, and in this case the  
component may be referred to either by giving the component name as a  
character string in place of the number in double square brackets,  
or, more conveniently, by giving an expression of the form

  > name$component_name"

The same goes for data.frames.

Jeff.

On Oct 23, 2006, at 5:38 PM, nand kumar wrote:

> Hi Forum,
>
> I am new and learning this research tool.
> was trying to run some tests on a censored dataset using the NADA  
> library. Everything is hunky dory except 'censummary' throws an  
> error and I am trying to figure out a reason for this.
> Please help!
> below you will see the error statement...
> thnx
> --nk
>
>
>> library(NADA)
> Loading required package: survival
> Loading required package: splines
>
>> "AsExample" <-structure(list(AsLow = as.integer(c(0, 0, 0, 0, 0,  
>> 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1)), AsHigh  
>> = as.integer(c(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 3,  
>> 3, 3, 3, 3, 3, 3, 3)), AsCen = as.integer(c(1, 1, 1, 1, 1, 1, 1,  
>> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1))), .Names = c 
>> ("AsLow", "AsHigh", "AsCen"), class = "data.frame", row.names = c 
>> ("1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12",  
>> "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23",  
>> "24"))
>> AsExample
>    AsLow AsHigh AsCen
> 1      0      1     1
> 2      0      1     1
> 3      0      1     1
> 4      0      1     1
> 5      0      1     1
> 6      0      1     1
> 7      0      1     1
> 8      0      1     1
> 9      0      1     1
> 10     0      1     1
> 11     0      1     1
> 12     1      3     1
> 13     1      3     1
> 14     1      3     1
> 15     1      3     1
> 16     1      3     1
> 17     1      3     1
> 18     1      3     1
> 19     1      3     1
> 20     1      3     1
> 21     1      3     1
> 22     1      3     1
> 23     1      3     1
> 24     1      3     1
>> names(AsExample)
> [1] "AsLow"  "AsHigh" "AsCen"
>> censummary(AsLow, AsHigh, AsCen)
> Error: object "AsLow" not found
> Error in censummary(AsLow, AsHigh, AsCen) :
>         unable to find the argument 'obs' in selecting a method for  
> function 'censummary'
>
>
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at stat.math.ethz.ch 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