similar to: Inconsistency among mean, median, max, var

Displaying 20 results from an estimated 10000 matches similar to: "Inconsistency among mean, median, max, var"

2000 Sep 23
3
bug in apply with median
I have found a problem in R version 1.1.1 when using apply with the median function. The problem can be illustrated with the following data matrix: X1 X2 X3 1 2 3 4 5 6 7 8 NA Enter this data matrix as X and then try apply(X,2,median,na.rm=T) The problem here is that the median function returns a named scalar if the number of observations is odd, but returns an
2011 Apr 27
3
median and data frames
Here are some data frames: df3.2 <- data.frame(1:3, 7:9) df4.2 <- data.frame(1:4, 7:10) df3.3 <- data.frame(1:3, 7:9, 10:12) df4.3 <- data.frame(1:4, 7:10, 10:13) df3.4 <- data.frame(1:3, 7:9, 10:12, 15:17) df4.4 <- data.frame(1:4, 7:10, 10:13, 15:18) Now here are some commands and their answers: > median(df3.2) [1] 2 8 > median(df4.2) [1] 2.5 8.5 > median(df3.3)
2014 Aug 21
1
Inconsistent handling of data frames in min(), max(), and mean()
This inconsistency recently came to my attention: > df <- data.frame(A = 1:10, B = rnorm(10)) > min(df) [1] -1.768958 > max(df) [1] 10 > mean(df) [1] NA Warning message: In mean.default(df) : argument is not numeric or logical: returning NA I recall the times where `mean(df)` would give `colMeans(df)` and this behaviour was deemed inconsistent. It seems though that the change has
2007 Aug 27
2
Max vs summary inconsistency
Hello, I'm having the following questionable behavior: > summary(m) Min. 1st Qu. Median Mean 3rd Qu. Max. 1 13000 26280 25890 38550 50910 > max(m) [1] 50912 > typeof(m) [1] "integer" > class(m) [1] "integer" ...it seems to me like max() and summary(m)[6] ought to return the same number. Am I doing something wrong? I'm
2013 Feb 18
1
lattice dotplot labelling median and mean values for each panel
By considering this reproducible example #start code library(lattice) dotplot(variety ~ yield | site, data = barley, layout = c(1,6), index.cond= function(x,y){median(x)}, panel = function(x,y,...) { panel.dotplot(x,y,...) median.values <- median(x) panel.abline(v=median.values, col.line="red")
2012 Feb 04
2
How to Compare the median to the mean?
Okay, so I have a homework projecr for R, and we had to input the following link as some sort of data: nb10 <- read.table("http://www.adjoint-functors.net/su/web/314/R/NB10"). Afterwards, we have to use fivenum(nb10) to find max, min, quantiles, and sd, but I'm okay with this. The next question is where I'm stuck. The question is as follows; Compare the median (use the
2008 Mar 09
2
transforming column of a dataframe by var- and median-functions
Hello, I try to transform a data frame like A B C 1 1 2,5 2 2 NA 3 1 1,0 4 1 56 5 2 23 6 1 NA 7 2 46 to the following dataframe, calculating the variance and median of the C-column, group by B, so the result will be: B C(median) D (var) 1 19,83
2005 Feb 19
2
Warnings by functions mean(), median()
Hello, following functions doesnt work correct with my data: median(), geo.mean(). My datafiles contain more than 10.000 lines and six columns from a flow-cytometer-measurment. I need the arithmetic and geometric mean and median. For the calculation of the geometric mean i wrote following function: fix(geo.mean) function(x) { n<-length(x)
2008 Apr 27
1
parallel max, min, and median of dataframe columns
Hello, all, I have a dataframe of three rows and umpteen columns. I want to show the maximum, minimum, and median with a vertical line and a central dot (I'd use a boxplot, but with only three data points, that's overkill; I can't just use points, because of overlap and some of the other data plotted on the graph). This works: > boxplot(data_frame,
2009 Dec 23
2
Mean, median and other moments
Hi! Suppose I have a dataset as follows pd = c(10,7,10,11,7,11,7,6,8,3,12,7,7,10,10) I wish to calculate the mean, standard deviation, median, skewness and kurtosis i.e. regular standard statistical measures. average = mean(pd) stdev    = sd(pd) median = median(pd) skew    = skewness(pd) kurt     =  kurtosis(pd) Q. No (1) How do I get these at a stretch using some R package? I came across
2012 May 09
5
Dotchart showing mean and median by group
Given this example mean.values<-colMeans(VADeaths) mean.values<-apply(VADeaths, 2, mean) median.values<-apply(VADeaths, 2, median) dotchart(VADeaths, gdata=mean.values) dotchart(VADeaths, gdata=median.values) is it possible to ?combine? a single dotchart showing both the mean and the median for each single group (with different plotting symbols)? ?is it that possible with the use of
2011 Jan 15
2
median by geometric mean
Hi All, I need to calculate the median for even number of data points.However instead of calculating the arithmetic mean of the two middle values,I need to calculate their geometric mean. Though I can code this in R, possibly in a few lines, but wondering if there is already some built in function. Can somebody give a hint? Thanks in advance [[alternative HTML version deleted]]
2011 May 26
4
Different behavior of median and mean function - Why?
Hi together, below is a small example which produces outcome I do not understand, namely that the median function works fine on a data.frame without negative numbers, but doesn't work on a data.frame with one negative number. I'm sure there is a reasonable explanation for that or better, that I'm doing something wrong and someone could guide me how to solve it. I tried googling it,
2007 Aug 30
2
Q: Mean, median and confidence intervals with functions "summary" & "boxplot.stats"
Een ingesloten tekst met niet-gespecificeerde tekenset is van het bericht gescrubt ... Naam: niet beschikbaar Url: https://stat.ethz.ch/pipermail/r-help/attachments/20070830/e557d2a7/attachment.ksh
2011 Jan 17
1
median by geometric mean -- are we missing what's important?
Folks: I know this may be overreaching, but are we missing what's important? WHY do the zeros occur? Are they values less then a known or unknown LOD? -- and/or is there positive mass on zero? In either case, using logs to calculate a geometric mean may not make sense. Paraphrasing Greg Snow, what is the scientific question? What is the model? Cheers, Bert On Mon, Jan 17, 2011 at 9:13 AM,
2005 Apr 15
2
A question about boxplot: mean and median
Dear List, I have worked through the examples given in the help on boxplot(). If I am reading it right, only the median is produced (as a default), which is represented by the horizontal line inside the box. What argument do I need to specify if I want to show the mean as well? Thanks, platform i386-pc-mingw32 arch i386 os mingw32 system i386, mingw32 status
2003 May 14
2
building mean/median over subgroups
Dear all, I'm trying to solve the following problem, and hoping to get some advise here from the group I have a dataframe in which the same sample was measured more than once on the same day. I would reorganize the dataframe to get a single value (mean /median) for one day Patient Day Sample Test A 1 A 23 A 1 A 36 A 5 B 44 A 5 B 23 B 2 C 10 B 2 C 5 mean Patient Day Sample Test.mean A
2018 May 09
1
BoxPlot Adding Mean and Median Values
Dear Team - I would like to get your help on adding the values of mean and median of RTF as mentioned in the below snapshot.? Please guide me out.?Thanks for your help in advance.
2002 Sep 16
1
Running Median and Mean
R gurus, On Aug 20, 2002, I asked in R-help about calculating a running 5-day median on a large matrix. Thanks to Martin Maechler <maechler@stat.math.ethz.ch> and Ray Brownrigg <Ray.Brownrigg@mcs.vuw.ac.nz> for responding. I ended up writing C code (and an R interface) to do it, which is about 1000x faster than the naive method! (72s became .09s on a 223 x 520 matrix). I added a
2009 May 29
1
'mean' is not reverted in median() as NEWS says (PR#13731)
Full_Name: Version: 2.9.0 OS: windows, linux Submission from: (NULL) (128.231.21.125) In NEWS, it says "median.default() was altered in 2.8.1 to use sum() rather than mean(), although it was still documented to use mean(). This caused problems for POSIXt objects, for which mean() but not sum() makes sense, so the change has been reverted." But it's not reverted yet.