similar to: quantile and IQR do not check for numeric input (PR#13631)

Displaying 20 results from an estimated 1000 matches similar to: "quantile and IQR do not check for numeric input (PR#13631)"

2009 Mar 05
1
quantile(), IQR() and median() for factors
Dear all, from the help page of quantile: "x ??? numeric vectors whose sample quantiles are wanted. Missing values are ignored." from the help page of IQR: "x ??? a numeric vector." as a matter of facts it seems that both quantile() and IQR() do not check for the presence of a numeric input. See the following: set.seed(11) x <- rbinom(n=11,size=2,prob=.5) x <-
2009 Sep 08
2
strange results in summary and IQR functions
Dear R users, Something is strange in summary and IQR. Suppose, I have a data set and I would like to find the Q1, Q2, Q3 and IQR. x<-c(2,4,11,12,13,15,31,31,37,47) > summary(x) Min. 1st Qu. Median Mean 3rd Qu. Max. 2.00 11.25 14.00 20.30 31.00 47.00 > IQR(x) [1] 19.75 However, I test the same data set in SAS "proc univariate", and SAS shows that
2010 Dec 12
1
95% CI of a IQR and more
Hi guys! I have to calculate the 95% CI for the IQR. I have 100samples with continuous numbers using a compute-intensive method. 1)I can calculate the 95%CI and the IQR, but I don't know how to calculate the CI of the IQR, does anybody have any idea, which method will be appropriate? 2)I have a 2x2 table with gender vs blue eyes or not. How do I calculate the expected two-by-two contingency
2011 Apr 17
3
Box plot with 5th and 95th percentiles instead of 1.5 * IQR: problems implementing an existing solution...
Hi all, I'm just getting started with R and I would appreciate some help. I'm having trouble creating a boxplot with whiskers at the 95th and 5th percentiles instead of at 1.5 * IQR. I have read the relevant documentation, and checked existing mails on this topic. I found a small modification that should work : https://stat.ethz.ch/pipermail/r-help/2001-November/016817.html and tried to
2010 May 07
1
How to pass value to an argument in a function which is an argument to the main function
Dear all, I constructed this function called my.boxplot.stats by replacing fivnum() with quantile() in function boxplot.stats(). So I can try different quantile methods in bwplot(). The problem is I couldn't pass different values to the "type" argument to my.boxplot.stats, which in turn is an argument in bwplot(). Now I just have to manually change the "type" value in
2016 Apr 19
0
Interquartile Range
Are you aware that there *already is* a function that does this? ?IQR (also your "function" iqr" is just a character string and would have to be parsed and evaluated to become a function. But this is a TERRIBLE way to do things in R as it completely circumvents R's central functional programming paradigm). Cheers, Bert Bert Gunter "The trouble with having an open mind
2007 Nov 23
1
Bug in pacf -- Proposed patch (PR#10455)
Dear all, following the thread http://tolstoy.newcastle.edu.au/R/e2/devel/07/09/4338.html regarding the bug in the partial autocorrelation function for multivariate time series. I have prepared a web page with patches and relevant information. http://www2.stat.unibo.it/giannerini/R/pacf.htm Please do not hesitate to contact me for further clarifications regards Simone --
2020 May 18
1
parRapply and parCapply return a list in corner cases
According to ?parCapply: parRapply and parCapply always return a vector. This appears not to be the case in the following minimal reproducible example: > library(parallel) > nslaves <- 2 > cl <- makeCluster(nslaves) > X <- matrix(2,nrow=3,ncol=4) > X <- rbind(c(1,1,0,1),X) > tv <- parCapply(cl,X,FUN=function(x){ +
2010 May 12
8
function
Dear list, I'm trying to implement the following function, but what I get is an error message and I don't understand where is the error: #outliers'identification: iqr=lapply(bb,function(){ inner_fencesl=quantile(x,0.25)-1.5*IQR(x) inner_fencesh=quantile(x,0.75)+1.5*IQR(x) outer_fencesl=quantile(x,0.25)-3*IQR(x) outer_fencesh=quantile(x,0.75)+3*IQR(x)}) where bb is a dataframe
2006 Mar 06
2
Running R on dual/quad Opteron machines
Dear all, I am managing a departmental purchase of an Opteron based workstation/server for scientific computing on which we will be running R. The environment will probably be either Unix/Linux or Solaris and the amount of RAM will be 8-16Gb, depending on the number of processors. My main concerns are the following: 1. How much does R benefit from passing from one processor to two/four
2016 Apr 20
0
Interquartile Range
??? IQR returns a single number. > IQR(rnorm(10)) [1] 1.090168 To your 2nd response: "I could have used average, min, max, they all would have returned the same thing., " I can only respond: huh?? Are all your values identical? You really need to provide a small reproducible example as requested by the posting guide -- I certainly don't get it, and I'm done guessing.
2009 Mar 04
3
problems with exporting a chart
Dear R helpers, I have a problem with exporting a chart (to any format). The graphic device becomes inactive and I get the 'Error: invalid graphics state' error message. I searched the help, web and FAQ but couldn't find the solution. This is my code: I chart a histogram for differences in R2 by sample size (an extract from the data is below). Altogether I have n=2500 observations
2003 Mar 01
2
density(), with argument of length 1 (PR#2593)
The following is from version 1.6.2 of R under Windows, or 1.6.1 under Mac OSX/X11 > density(1) Error in if (!(lo <- min(hi, IQR(x)/1.34))) (lo <- hi) || (lo <- abs(x[1])) || : missing value where logical needed I am not sure how this should be handled. I encountered it in connection with densityplot(). In that connection, it might be enough to modify density() so that it
2011 Feb 24
1
Boxplot not doing what I think it should
My box plot below is drawing its upper whisker all the way to the last point, instead of showing the point as an outlier. Am I misunderstanding, or is it a bug? Help(boxplot) states for the parameter ?range? that ?this determines how far the plot whiskers extend out from the box. If range is positive, the whiskers extend to the most extreme data point which is no more than range times the
2016 Apr 20
2
Interquartile Range
Again, IQR returns two both a .25 and a .75 value and it failed, which is why I didn't use it before. Also, the first function just returns tha same value repeating. Since they are the same, before the second call, using the mode function is just a way to grab one value. I could have used average, min, max, they all would have returned the same thing. Mike On Tue, Apr 19, 2016 at 7:24 PM,
2007 Feb 22
1
Diagnostic Tests: Jarque-Bera Test / RAMSEY
Hello R-Users, The following questions are not R-technical, but more of general statistical nature. 1. NORMALITY I built a normal linear regression model and now I want to check for the residual normality assumption. If I check the distribution graphically and look at the descriptive characteristics (skewness and kurtosis are below 1), I would confirm that the residuals are normally
2016 Apr 19
0
Interquartile Range
> That didn't work Jim! It always helps to say how the suggestion did not work. Jim's function had a typo in it - was that the problem? Or did you not change the call to ddply to use that function. Here is something that might "work" for you: library(plyr) data <- data.frame(groupColumn=rep(1:5,1:5), col1=2^(0:14)) myIqr <- function(x) {
2008 Jun 05
2
qf with infinite df
Dear all, I found the following behaviour > rf(5,Inf,Inf) [1] 1 1 1 1 1 but > qf(0.1,Inf,Inf) [1] NaN Warning messages: 1: In qf(0.1, Inf, Inf) : value out of range in 'lgamma' 2: In qf(p, df1, df2, lower.tail, log.p) : NaNs produced incidentally, > pf(1.00000000000001,Inf,Inf) [1] 1 > pf(1.0000000000000001,Inf,Inf) [1] 0.5 Is this the expected behaviour? Thanks
2009 Dec 10
1
switch() called with just the EXPR argument causes R to hang (PR#14124)
Dear all, switch() called with just the EXPR argument causes R to hang so that the only way to stop it is to kill R. Reproducible example: > switch(EXPR="a") the internal C subroutine behind switch is do_switch located in R/src/main/builtin.c For convenience I reproduce it below. ***************************************************************************** SEXP attribute_hidden
2016 Apr 19
5
Interquartile Range
That didn't work Jim! Thanks anyway On Mon, Apr 18, 2016 at 9:02 PM, Jim Lemon <drjimlemon at gmail.com> wrote: > Hi Michael, > At a guess, try this: > > iqr<-function(x) { > return(paste(round(quantile(x,0.25),0),round(quantile(x,0.75),0),sep="-") > } > > .col3_Range=iqr(datat$tenure) > > Jim > > > > On Tue, Apr 19, 2016 at