Questions tagged [quantile]

Quantiles are points taken at regular intervals from the cumulative distribution function (CDF) of a random variable.

In scientific software for statistical computing and graphics, the quantile of a numeric vector can be found by function quantile.

755 questions
0
votes
2 answers

d3 quantile scale force first quantile

I'm building a heat map with a color gradient from green to red. I want cells with value 0 to be green, and values greater or equal than 1 to take the other colors. I'm building the scale this way : var colors = [ '#27C24C', '#7DB22E', …
Scentle5S
  • 760
  • 1
  • 6
  • 13
0
votes
1 answer

Quantile of a vector in stan

I would like to use the quantile of a vector in stan but the function quantile doesn't seem to work. See the ** ** in the following example. data{ vector[10] y; vector[10] x; } parameters{ real a; real b; } model{ vector[10]…
PerrySun
  • 187
  • 1
  • 1
  • 8
0
votes
0 answers

Find out which percentile a number has

Say I have the following vector: m<-c(11, 14, 11, 12, 11, 12, 9, 12, 12, 9, 12, 8, 11, 12, 10) From this, it is easy to determine which number corresponds to a certain percentile, which has been demonstrated before (see: Link 1 or Link 2). For…
Tiberius
  • 331
  • 1
  • 9
0
votes
1 answer

How to do operations based on a group in R

I have a data frame that I created as a sample v<-data.frame( g= c(sample(1:10, 8))) g<-data.frame( v= c(1,1,1,1,2,2,2,2)) df<-cbind(g,v) df_s <-df[order(df$g,df$v,decreasing=TRUE),] The g column is a group of common values, lets say dates. I…
jazz_learn
  • 113
  • 2
  • 6
0
votes
1 answer

NTILE function not working in Spark SQL 1.5

I'm testing the NTILE function on a simple dataset like this: (id: string, value: double) A 10 B 3 C 4 D 4 E 4 F 30 C 30 D 10 A 4 H 4 Running the following query against HIVE (on MapReduce) SELECT tmp.id, tmp.sum_val, NTILE(4) OVER (ORDER…
steccami
  • 21
  • 1
  • 4
0
votes
1 answer

Hypothesis test on quantile slope against OLS slope

Using the excellent quantreg package and testing hypothesis of equal slopes between quantile 0.1 and 0.9 using standard anova function. model <- food ~ income anova(rq(model,tau=0.1), rq(model,tau=0.9)) A zero p-val leads us to reject the null…
rrg
  • 655
  • 2
  • 6
  • 24
0
votes
0 answers

Change line style in stat_quantiles if they are significative or not gplot2 R

I am making an analysis of covariance using quantiles and I would like to plot using ggplot2 quantile lines by group but changing the style if they are significant at some level e.g. p<0.1 …
Leosar
  • 2,010
  • 4
  • 21
  • 32
0
votes
1 answer

Python: quantile for list of sublists

I want to find quantiles of element n in sublists. Let's say I have (in reality it's much bigger): List=[[[1,3,0,1],[1,2,0,1],[1,3,0,1]],[[2,2,1,0],[2,2,1,0],[2,2,1,0]]] I want a way to find quantiles (like numpy.percentile) for the 2:nd elements in…
0
votes
1 answer

Extracting coefficients from sqreg in Stata

I am trying to run quantile regressions across deciles, and so I use the sqreg command to get bootstrap standard errors for every decile. However, after I run the regression (so Stata runs 9 different regressions - one for each decile except the…
akeenlogician
  • 179
  • 1
  • 8
0
votes
1 answer

How to ggplot with pre calculated quantiles?

I am using a model to predict some numbers. My prediction also includes a confidence interval for each number. I need to plot the actual numbers + predicted numbers and their quantile values on the same plot. Here is a simple example: actualVals =…
Mohammad
  • 1,078
  • 2
  • 18
  • 39
0
votes
1 answer

Table of average score of peer per percentile

I'm quite a newbie in R so I was interested in the optimality of my solution. Even if it works it could be (a bit) long and I wanted your advice to see if the "way I solved it" is "the best" and it could help me to learn new techniques and functions…
Yurienu
  • 95
  • 7
0
votes
1 answer

Wald Testing Bootstrapped Estimates in R

I've performed multiple regression (specifically quantile regression with multiple predictors using quantreg in R). I have estimated the standard error and confidence intervals based on bootstrapping the estimates. Now i want to test whether the…
0
votes
1 answer

Matlab Calculating mean of distribution quantile in a for-loop

I am trying to calculate portfolio cVaR (conditional value at risk) levels from my simulated data for various portfolios. I am able to do that for one single portfolio using the following code: % Without a for-loop for series 1 test2 =…
Carolin
  • 539
  • 2
  • 7
  • 15
0
votes
0 answers

Marking special values when grouping into R

I am currently grouping my variables in R: character variables manually, numeric (continuous) by equal percentage of population. For equal % of population I use cut2(var, number_of_bins). I have continuous variables like var=TotalPaid/TotalDue which…
Bullzeye
  • 153
  • 1
  • 11
0
votes
0 answers

Subsetting a dataframe by a vector: Removing quantiles

This is a more complicated iteration of previous questions about subsetting a dataframe by a vector. So in this case I have a very large dataframe with numerous columns of crop data in it. Within that dataframe is a column entitled "STshort" which…