Skip to content

median Q?

7 messages · Joshua Wiley, Vlatka Matkovic Puljic, Mohamed Lajnef

#
Hello,

summary() removes NAs by default.  You can get the same results using

median(year, na.rm=TRUE)

see ?median

HTH,

Josh

On Wed, Apr 21, 2010 at 6:40 AM, Vlatka Matkovic Puljic
<v.matkovic.puljic at gmail.com> wrote:

  
    
#
Hi,

Try this median(v2[v1==1])

Mohamed
Regards

Vlatka Matkovic Puljic a ?crit :

  
    
#
Look at ?by

for example

by(data=v2, INDICES=v1, FUN=median, na.rm=TRUE)

This will calculate the median of v2 (age) for each level of the
indices v1 (in your case M and F).


If you are only interested the median for a single level, Mohamed's
solution is simpler.

Josh


On Wed, Apr 21, 2010 at 8:10 AM, Vlatka Matkovic Puljic
<v.matkovic.puljic at gmail.com> wrote: