Displaying 20 results from an estimated 117 matches for "iqr".
Did you mean:
ifr
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 &quo...
2012 Nov 23
6
Summary statistics for matrix columns
...n but I need the output to be in matrix with
rownames and all the columns beside it
this how I want it
Col76 Col77
Min. : 7 39
1st Qu. : 1846 1630
Median : 3631 3376
Mean : 3804 3617
Sd :
3rd Qu.: 5772 5544
IQR :
Max. : 7952 7779
Is there an easy way?
Thanks
--
View this message in context: http://r.789695.n4.nabble.com/Summary-statistics-for-matrix-columns-tp4650489.html
Sent from the R help mailing list archive at Nabble.com.
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 implement it.
Basically, it says to replace boxplot.stats with:
myboxplot.stats <- fu...
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...
2009 Mar 30
1
quantile and IQR do not check for numeric input (PR#13631)
This report follows the post
http://tolstoy.newcastle.edu.au/R/e6/devel/09/03/0760.html
where it is shown that quantile() and IQR() do not work as documented.
In fact they do not check for numeric input even if the documentation says =
:
?quantile
x numeric vectors whose sample quantiles are wanted. Missing
values are ignored.
?IQR
x a numeric vector.
> quantile(factor(1:9))
0% 25% 50% 75% 100%
1 3...
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 <- factor(x,ordered=TRUE)
x
?[1] 1 0 1 0 0 2 0 1 2 0 0
Levels: 0 < 1 <...
2010 May 07
1
How to pass value to an argument in a function which is an argument to the main function
...===================
my.boxplot.stats<-function (x, coef = 1.5, *type=6*, do.conf = TRUE, do.out
= TRUE)
{
if (coef < 0)
stop("'coef' must not be negative")
nna <- !is.na(x)
n <- sum(nna)
stats <- stats::quantile(x, type=type,na.rm = TRUE)
iqr <- diff(stats[c(2, 4)])
if (coef == 0)
do.out <- FALSE
else {
out <- if (!is.na(iqr)) {
x < (stats[2L] - coef * iqr) | x > (stats[4L] + coef *
iqr)
}
else !is.finite(x)
if (any(out[nna], na.rm = TRUE))...
2009 Mar 04
3
problems with exporting a chart
...the legends for each chart
leg_loc=matrix(c( -0.1, 0.26, 0.62, -0.1, 0.26, 0.4, 0.4, 0.4, 1, 1),ncol=2, nrow=5, byrow=FALSE)
*Calculate the statistics for each sample size to display on the legends
for (i in 1:5) {
nR=(i-1)*500+1
nR2=nR+499
z=data[nR:nR2,13]
m<-mean(z)
std<-sqrt(var(z))
iqr=IQR(z)
median=median(z)
*Adding to the chart
legend(leg_loc[i,1],leg_loc[i,2], legend= paste(
"Mean=",round(m,3),'\n',
"SD=",round(std,3),'\n',
"Median =",round(median,3),'\n',
"IQR=", round(iqr,3)),bty="n")
}
Do you know w...
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 11:15 AM, Michael Artz <michaeleartz at gmail.com>
> wrote:
> > Hi,
>...
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 tr...
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 returns NA
is these circumstances...
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 containing all the variables over wich the function must be applied.
thanks of your att...
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, m...
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 req...
2011 Feb 24
1
Boxplot not doing what I think it should
...the right edge of the box does not show the same 3rd Quartile as does ?summary.? Explain, please.
> sort(t5g24times)
[1] 111 135 201 234 283 283 284 285 300 370 387 496
> summary(t5g24times)
Min. 1st Qu. Median Mean 3rd Qu. Max.
111.0 225.8 283.5 280.8 317.5 496.0
> iqr <- 317.5 - 225.8
> iqr
[1] 91.7
> 317.5 + 1.5 * iqr
[1] 455.05
> pdf()
> boxplot(c(t5g24times), horizontal=1, range=1.5)
R version info:
platform x86_64-apple-darwin9.8.0
arch x86_64
os darwin9.8.0
system...
2016 Apr 19
0
Interquartile Range
...ay 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) {
paste(round(quantile(x,0.25),0),round(quantile(x,0.75),0),sep="-")
}
ddply(data, ~groupColumn, summarise, col1_myIqr=myIqr(col1),
col1_IQR=stats::IQR(col1))
# groupColumn col1_myIqr col1_IQR
#1 1 1-1 0
#2 2 2-4...
2010 Jun 04
1
Boxplot: what is shown by default?
hi,
i'm using /"boxplot()"/ to show some data:
x <- c(0.99, 0.97, 0.91, 0.72, 1.00, 0.99, 1.02, 0.90, 0.91, 0.90, 1.02,
0.90, 1.35, 1.01, 0.92)
boxplot(x)
is it correct when i say: /"Boxes represent interquartile ranges (IQRs);
bold horizontal lines, medians; whiskers, lowest and highest values
still within 1.5 x IQR; open circles, outliers."?
/thanks in advance for any help!
cheers, tom
human genetics, bern/
/
[[alternative HTML version deleted]]
2007 Feb 22
1
Diagnostic Tests: Jarque-Bera Test / RAMSEY
...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 distributed.
> basicStats(IQR.in.mi02.nw.tdv.mix$residuals)
round.ans..digits...6.
nobs 19316.000000
NAs 0.000000
Minimum -0.639527
Maximum 0.693383
1. Quartile -0.083753
3. Quartile 0.088886
Mean...
2011 Feb 23
5
mgcv: beta coefficient and 95%CI
Hi i am doing an environmental research
The equation is as follow:
gam(y1 ~ x1 + s(x2) + s(x3) + s(x4), family = gaussian, fit = true)
I would like to obtain the beta coefficient and 95CI of x4 (or s(x4)), what
should I do?
Thanks,
Lung
--
View this message in context: http://r.789695.n4.nabble.com/mgcv-beta-coefficient-and-95-CI-tp3320491p3320491.html
Sent from the R help mailing list
2016 Apr 20
2
Interquartile Range
Well, instead of your functions try:
Mode <- function(x) {
tabx <- table(x)
tabx[which.max(tabx)]
}
and use R's IQR function instead of yours.
... so I still don't get why you want to return a character string
instead of a value for the IQR;
and the mode of a sample defined as above is generally a bad estimator
of the mode of the distribution. To say more than that would take me
too far afield. Post on stat...