Displaying 20 results from an estimated 8000 matches similar to: "Confidence intervals of quantiles"
2010 May 16
1
problems with generation of quantiles under For ()
Dear, I want to make an application to calculate quantile within a For()
I tried the following without success:
ej.
date
p_val <- matrix(sample(10, 1000, replace=TRUE), 200,5)
test 1
rr <- paste("p_val$",names(p_val[1]), sep="")
quant <- quantile(rr, probs = c(0, 10, 20, 30, 40, 50, 60, 70, 80, 90,
100)/100, na.rm=FALSE, type=1)
test 2
rr <-
2005 Aug 05
1
contrast {Design} question
All,
I have been trying to get the following code to work:
A.quantiles <- quantile(foo.frame$A,
probs = seq(from = 0.05, to = 0.95, by = 0.05))
base.quantiles <- quantile(Efficacy205$BASELINE_RANK,
probs = seq(from = 0.05, to = 0.95, by = 0.05))
gender <- levels(Efficacy205$GENDER)
contrast.1
<- contrast(Model.1,
list(TPCODE= 'A',
AGE =
2011 Mar 13
1
replace with quantile value for a large data frame...
Dear R-Experts
I am sure this might look simple question for experts, at least is problem
for me. I have a large data frame with over 1000 variables and each have
different distribution( i.e. have different quantile). I want to create a
new grouped data frame, where the new variables where the value falling in
first (<25%), second (25% to <50%), third (50% to <75%) and fourth quantiles
2010 May 17
3
applying quantile to a list using values of another object as probs
Hi r-users,
I have a matrix B and a list of 3x3 matrices (mylist). I want to
calculate the quantiles in the list using each of the value of B as
probabilities.
The codes I wrote are:
B <- matrix (runif(12, 0, 1), 3, 4)
mylist <- lapply(mylist, function(x) {matrix (rnorm(9), 3, 3)})
for (i in 1:length(B))
{
quant <- lapply (mylist, quantile, probs=B[i])
}
But quant
2009 Aug 27
2
Winsorized mean and variance
Hello everybody,
after searching around for quite some time, I haven't been able to
find a package that provides a function to compute the Windorized mean
and variance. Also I haven't found a function that computes the
trimmed variance. Is there any such package around?
thanks,
Roberto
2012 Jun 07
1
Quantile regression: Discrepencies Between optimizer and rq()
Hello Everyone,
I'm currently learning about quantile regressions. I've been using an
optimizer to compare with the rq() command for quantile regression.
When I run the code, the results show that my coefficients are consistent
with rq(), but the intercept term can vary by a lot.
I don't think my optimizer code is wrong and suspects it has something to do
with the starting
2010 Apr 09
2
How to use tapply for quantile
I am trying to calculate quantiles of a data frame column split up by
two factors:
# Calculate the quantiles
quarts = tapply(gdf$tt, list(gdf$Runway, gdf$OnHour), FUN=quantile,
na.rm = TRUE)
This does not work:
> quarts
04L 04R 15R 22L 22R 27 32
33L 33R
0 NULL Numeric,5 NULL Numeric,5 NULL Numeric,5 NULL
Numeric,5 NULL
1 NULL
2005 Aug 26
3
Matrix oriented computing
Hi,
I want to compute the quantiles of Chi^2 distributions with different
degrees of freedom like
x<-cbind(0.005, 0.010, 0.025, 0.05, 0.1, 0.5, 0.9, 0.95, 0.975, 0.99, 0.995)
df<-rbind(1:100)
m<-qchisq(x,df)
and hoped to get back a length(df) times length(x) matrix with the
quantiles. Since this does not work, I use
x<-c(0.005, 0.010, 0.025, 0.05, 0.1, 0.5, 0.9, 0.95, 0.975,
2010 Jul 07
3
quantiles on rows of a matrix
I'm trying to obtain the mean of the middle 95% of the values from each row
of a matrix (that is, the highest and lowest 2.5% of values in each row
are removed before calculating the mean). I am having all sorts of
problems with this; for example the command:
apply(matrix1,1,function(x) quantile(c(.05,.90),na.rm=T))
returns the exact same quantile values for each row, which is clearly
2004 May 07
1
Quantile of a function
I have a simple doubt:
I have a function, say:
test <- function (theta) {
return (theta^2) }
I can use:
integrate (test,0,1)
to obtain the area under de function.
Can I do the opposite? I`d like to give the lower limit and the area I need as arguments, in order to get the upper limit. In other words, I`d like to obtain the quantile of the function (the lower limit could be 0, for example).
2009 Apr 25
3
Nomogram with stratified cph in Design package
Hello,
I am using Dr. Harrell's design package to make a nomogram. I was able to
make a beautiful one without stratifying, however, I will need to stratify
to meet PH assumptions. This is where I go wrong, but I'm not sure where.
Non-Stratified Nomogram:
2007 Jul 11
1
Drawing rectangles in multiple panels
Hi folks,
I'm having some trouble understanding the intricacies of panel
functions. I wish to create three side-by-side graphs, each with
different data-- so far, so good: I rbind() the data, add a column of
subscripts as a conditioning variable, load up the lattice package,
specify either a c(3,1) 'layout' or work through 'allow.multiple' and
'outer' and I'm
2007 Oct 03
2
Shading area under density curves
Hello,
I have a question regarding shading regions under curves to display
95% confidence intervals. I generated bootstrap results for the slope
and intercept of a simple linear regression model using the following
code (borrowed from JJ Faraway 2005):
> attach(allposs.nine.d)
> x<-model.matrix(~log(d.dist,10))[,-1]
> bcoef<-matrix(0,1000,2)
> for(i in 1:1000){
+
2003 Oct 15
3
Fw: SIMCA algorithm implementation
I have used PCA for data classification by visual examination of the 3D
scatter plot of the first 3 principal components. I now want to use the
results to predict the class for new data. I have used predict.princomp to
predict the scores and then visualise the results on a 3D scatter plot using
the rgl library. However, is there an R function that will fit the new data
to the class assignments
2008 Sep 23
1
quantile regression: plotting coefficients on only one variable (rq)
Dear all.
I have a question on plotting the coefficients from a series of mutivariate
quantile regressions. The following code plots the coefficients for each
RHS variable x1 and x2. Is there a way to plot only the coefficients on x1?
In the data I am using, I have a large number of fixed effects and do want
to plot the coefficients on these fixed effects.
quant.plot <-
2011 Feb 17
7
removing lower and upper quantiles from an arry
I'm trying to work out the simplest way to remove the upper and lower quantiles, in this case upper and lower 25% from an array. I can do it in two steps but when I try it in one, it fails. Is there something simple missing from my syntax or are there other simple elegant way to accomplish this?
Thanks
J
> i <-1:20
> i2 <- i[i<quantile(i,.75)]
> i3 <-
2013 Feb 19
3
Quantiles of a subset of data
bradleyd wrote
> Excuse the request from an R novice! I have a data frame (DATA) that has
> two numeric columns (YEAR and DAY) and 4000 rows. For each YEAR I need to
> determine the 10% and 90% quantiles of DAY. I'm sure this is easy enough,
> but I am a new to this.
>
>> quantile(DATA$DAY,c(0.1,0.9))
> 10% 90%
> 12 29
>
> But this is for the entire
2003 Sep 27
2
CI on median
Dear friends, I'm probably wrong but is there anything better than
bootstrap to get a confidence interval of the median from a population with
unspecified distribution ?
Best wishes
Troels Ring, Aalborg, Denmark
2006 Mar 03
2
Compute quantiles with values and correspondent frequencies
Dear List,
quantile(x) function allows to obtain specified quantiles of a vector of observations x.
Is there an analogous function to compute quantiles in the case one have the vector of the observations x and the correspondent vector f of relative frequencies ?
Thank you
Paolo Radaelli
[[alternative HTML version deleted]]
2011 Feb 10
1
How to determine the quantile boundary from an ECDF?
Given a dataset x, the ecdf is ecdf(x). Then I can use ecdf(x)(y) to find
the percentile of y. Given the ecdf is there a way to determine what is the
value of y that is the boundary of let's say 95 percentile? In other words,
is there a function I can call on the ecdf like:
fomeFunc( ecdf( x ), 0.95 )
Which will return the highest value of y, for which ecdf( y ) < 0.95?
The only solution