
296 Statistics and Data Analysis for Microarrays Using R and Bioconductor
ge data frame us ing the definition rather than the build in R function
median.
SOLUTION Since this sample has an even number of values, the
median value is not one of the values from the set of measurements but
rather some in-between value. Let us calc ulate the median step by step,
rather than rely on the built-in function:
> ogene1 = sort(gene1)
> ogene1
[1] -1.269 -0.902 -0.894 -0.580 -0.394
[6] -0.138 -0.133 0.193 0.903 1.966
> my_median = (ogene1[5]+ogene1[6])/2
> my_median
[1] -0.266
> median(gene1)
[1] -0.266
>
The median is defined as the value in the middle of the ordered list ...