On Sun, 2004-02-29 at 19:26, Gabor Grothendieck wrote:
> I agree its overkill but prop.table generalizes to mulitple
> dimensions, in which case it becomes comparable to CrossTable,
> so I thought it was worth mentioning.
>
> By the way, as the author of CrossTable, perhaps you
> might might cons
: Sun, 29 Feb 2004 19:19:29 -0600
From: Marc Schwartz <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>,R-Help <[EMAIL PROTECTED]>
Subject: RE: [R] Proportions again
On Sun, 2004-02-29 at 18:27, Gabor Grothendieck wrote:
> That's tru
On Sun, 2004-02-29 at 18:27, Gabor Grothendieck wrote:
> That's true; however,
>
> CrossTable(x,x)
>
> does give the desired counts and proportions in the margin
> line at the bottom. See the row labelled Column Total in
> the following example based on Carlos' vector:
>
> > sex<-c(1,2,2,1,1,2
0.375 | 0.625 | |
-|---|---|---|
---
Date: Sun, 29 Feb 2004 13:48:27 -0600
From: Marc Schwartz <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>,R-Help <[EMAIL PROTECTED]>
Subject: RE: [R] Proportions again
On Sun, 20
On Sun, 2004-02-29 at 12:40, Gabor Grothendieck wrote:
> Several people have alrady answered you by this time and
> in addition to their answers you might also be interested
> in CrossTable in package gregmisc.
Gabor,
Thanks for pointing out CrossTable().
Just as a quick heads up/clarification f
ubject: [R] Proportions again
Hello.
I asked before and it was great, cause as a beginner I learned a lot. But, if I have
this in R (1 and 2 are codes for sex):
> sex<-c(1,2,2,1,1,2,2,2)
> sex
[1] 1 2 2 1 1 2 2 2
I´d like to obtain the proportion according to sex.So I type:
t; Sent: Sunday, February 29, 2004 9:35 AM
> To: [EMAIL PROTECTED]
> Subject: [R] Proportions again
>
> Hello.
>
> I asked before and it was great, cause as a beginner I
> learned a lot. But, if I have this in R (1 and 2 are codes for sex):
>
> > sex<-c(1,2,2,1,1,2,2,2
Carlos Mauricio Cardeal Mendes wrote:
I asked before and it was great, cause as a beginner I learned a lot. But,
if I have this in R (1 and 2 are codes for sex):
sex<-c(1,2,2,1,1,2,2,2)
sex
[1] 1 2 2 1 1 2 2 2
I´d like to obtain the proportion according to sex.So I type:
prop.table(sex)
[1] 0.
Andrew Robinson <[EMAIL PROTECTED]> writes:
> table(sex)/length(sex)
or, as is the intended usage:
> prop.table(table(sex))
sex
1 2
0.375 0.625
> > I asked before and it was great, cause as a beginner I learned a lot. But,
> if I have this in R (1 and 2 are codes for sex):
> > > sex<-
table(sex)/length(sex)
Andrew
On Sunday 29 February 2004 06:35, Carlos Mauricio Cardeal Mendes wrote:
> Hello.
>
> I asked before and it was great, cause as a beginner I learned a lot. But,
if I have this in R (1 and 2 are codes for sex):
> > sex<-c(1,2,2,1,1,2,2,2)
> > sex
>
> [1] 1 2 2 1 1 2 2
Hello.
I asked before and it was great, cause as a beginner I learned a lot. But, if I have
this in R (1 and 2 are codes for sex):
> sex<-c(1,2,2,1,1,2,2,2)
> sex
[1] 1 2 2 1 1 2 2 2
I´d like to obtain the proportion according to sex.So I type:
> prop.table(sex)
[1] 0.07692308 0.15384615 0.153
11 matches
Mail list logo