Skip to content

Proportions again

5 messages · Carlos Mauricio Cardeal Mendes, Andrew Robinson, Chuck Cleland +2 more

#
table(sex)/length(sex)

Andrew
On Sunday 29 February 2004 06:35, Carlos Mauricio Cardeal Mendes wrote:
if I have this in R (1 and 2 are codes for sex):

  
    
#
prop.table(table(sex))
#
Dear Carlos,

prop.table() takes a table as its argument, so you could specify
prop.table(table(sex)). See ?prop.table for more details.

John
#
Andrew Robinson <andrewr at uidaho.edu> writes:
or, as is the intended usage:
sex
    1     2
0.375 0.625