[R] silly, extracting the value of "C" from the results of somers2

P Ehlers ehlers at math.ucalgary.ca
Wed Jan 4 07:30:17 CET 2006



ahimsa campos arceiz wrote:
> Sorry I have a very simple question:
> 
> I used somers2 function from Design package:
> 
> 
>>z<- somers2(x,y, weights=w)
> 
> 
> results are:
> 
> 
>>z
> 
>  C    Dxy    n    Missing
>  0.88  0.76  500    0.00
> 
> Now I want to call only the value of C to be used in further analyses, but I 
> fail to do it. I have tried:
> 
> 
>>z$C
> 
> NULL
> 
>>z[,C]
> 
> Error in z[,C]: incorrect number of dimensions
> 
> and some other silly things. If I do 
> 
>>list(z)
> 
> [[1]]
>   C    Dxy    n    Missing
>  0.88  0.76  500    0.00
> 
> Can somebody tell me how can I obtain just the value of c?

(I think that somers2() is in package:Hmisc.)
The help page clearly says that somers2 returns a vector and
there's an example on the help page that does _exactly_ what you ask!

z["C"]  or  z[1]

Peter Ehlers

> 
> Thank you useRs,
> 
> very gratefull
> 
> Ahimsa
>




More information about the R-help mailing list