/** * Returns the cumulative percentage of values less than or equal to v * (as a proportion between 0 and 1). * <p> * Returns 0 if v is not comparable to the values set.</p> * * @param v the value to lookup * @return the proportion of values less than or equal to v */ public double getCumPct(int v) { return getCumPct(Long.valueOf(v)); }
/** * Returns the cumulative percentage of values less than or equal to v * (as a proportion between 0 and 1). * <p> * Returns 0 if v is not comparable to the values set.</p> * * @param v the value to lookup * @return the proportion of values less than or equal to v */ public double getCumPct(long v) { return getCumPct(Long.valueOf(v)); }
/** * Returns the cumulative percentage of values less than or equal to v * (as a proportion between 0 and 1). * <p> * Returns 0 if v is not comparable to the values set.</p> * * @param v the value to lookup * @return the proportion of values less than or equal to v */ public double getCumPct(char v) { return getCumPct(Character.valueOf(v)); }
/** * Return a string representation of this frequency distribution. * * @return a string representation. */ @Override public String toString() { NumberFormat nf = NumberFormat.getPercentInstance(); StringBuilder outBuffer = new StringBuilder(); outBuffer.append("Value \t Freq. \t Pct. \t Cum Pct. \n"); Iterator<Comparable<?>> iter = freqTable.keySet().iterator(); while (iter.hasNext()) { Comparable<?> value = iter.next(); outBuffer.append(value); outBuffer.append('\t'); outBuffer.append(getCount(value)); outBuffer.append('\t'); outBuffer.append(nf.format(getPct(value))); outBuffer.append('\t'); outBuffer.append(nf.format(getCumPct(value))); outBuffer.append('\n'); } return outBuffer.toString(); }
/** * Returns the cumulative percentage of values less than or equal to v * (as a proportion between 0 and 1). * <p> * Returns 0 if v is not comparable to the values set.</p> * * @param v the value to lookup * @return the proportion of values less than or equal to v */ public double getCumPct(long v) { return getCumPct(Long.valueOf(v)); }
/** * Returns the cumulative percentage of values less than or equal to v * (as a proportion between 0 and 1). * <p> * Returns 0 if v is not comparable to the values set.</p> * * @param v the value to lookup * @return the proportion of values less than or equal to v */ public double getCumPct(char v) { return getCumPct(Character.valueOf(v)); }
/** * Returns the cumulative percentage of values less than or equal to v * (as a proportion between 0 and 1). * <p> * Returns 0 if v is not comparable to the values set.</p> * * @param v the value to lookup * @return the proportion of values less than or equal to v */ public double getCumPct(int v) { return getCumPct(Long.valueOf(v)); }
/** * Returns the cumulative percentage of values less than or equal to v * (as a proportion between 0 and 1). * <p> * Returns 0 if v is not comparable to the values set.</p> * * @param v the value to lookup * @return the proportion of values less than or equal to v */ public double getCumPct(long v) { return getCumPct(Long.valueOf(v)); }
/** * Returns the cumulative percentage of values less than or equal to v * (as a proportion between 0 and 1). * <p> * Returns 0 if v is not comparable to the values set.</p> * * @param v the value to lookup * @return the proportion of values less than or equal to v */ public double getCumPct(char v) { return getCumPct(Character.valueOf(v)); }
/** * Returns the cumulative percentage of values less than or equal to v * (as a proportion between 0 and 1). * <p> * Returns 0 if v is not comparable to the values set.</p> * * @param v the value to lookup * @return the proportion of values less than or equal to v */ public double getCumPct(int v) { return getCumPct(Long.valueOf(v)); }
private double percentileRank(int x, int xstar){ double Fxstar = Math.max(0.0, Math.min(freqTable.getCumPct(xstar), 1.0)); double Fxstarm1 = Math.max(0.0, Math.min(freqTable.getCumPct(xstar-1), 1.0)); double px = Math.max(0.0, Math.min(100, 100*(Fxstarm1+(x-(xstar-0.5))*(Fxstar-Fxstarm1)))); return px; }
/** * Return a string representation of this frequency distribution. * * @return a string representation. */ @Override public String toString() { NumberFormat nf = NumberFormat.getPercentInstance(); StringBuilder outBuffer = new StringBuilder(); outBuffer.append("Value \t Freq. \t Pct. \t Cum Pct. \n"); Iterator<Comparable<?>> iter = freqTable.keySet().iterator(); while (iter.hasNext()) { Comparable<?> value = iter.next(); outBuffer.append(value); outBuffer.append('\t'); outBuffer.append(getCount(value)); outBuffer.append('\t'); outBuffer.append(nf.format(getPct(value))); outBuffer.append('\t'); outBuffer.append(nf.format(getCumPct(value))); outBuffer.append('\n'); } return outBuffer.toString(); }
/** * Return a string representation of this frequency distribution. * * @return a string representation. */ @Override public String toString() { NumberFormat nf = NumberFormat.getPercentInstance(); StringBuilder outBuffer = new StringBuilder(); outBuffer.append("Value \t Freq. \t Pct. \t Cum Pct. \n"); Iterator<Comparable<?>> iter = freqTable.keySet().iterator(); while (iter.hasNext()) { Comparable<?> value = iter.next(); outBuffer.append(value); outBuffer.append('\t'); outBuffer.append(getCount(value)); outBuffer.append('\t'); outBuffer.append(nf.format(getPct(value))); outBuffer.append('\t'); outBuffer.append(nf.format(getCumPct(value))); outBuffer.append('\n'); } return outBuffer.toString(); }
public double[] getThresholds(){ double[] alpha = new double[freqY.getUniqueCount()-1]; Iterator<Comparable<?>> iter = freqY.valuesIterator(); Comparable<?> v = null; int index = 0; while(iter.hasNext()){ v = iter.next(); if(iter.hasNext()){ alpha[index] = norm.inverseCumulativeProbability(freqY.getCumPct(v)); index++; } } return alpha; }
public ReflexValue frequency_cum_pct(List<ReflexValue> params) { if (params.size() != 2) { throw new ReflexException(-1, "frequency_count needs one frequency parameter and one value parameter"); } Frequency f = params.get(0).asObjectOfType(Frequency.class); double value = params.get(1).asDouble(); return new ReflexValue(f.getCumPct(value)); } }
map.put("count", frequency.getCount(value)); map.put("cumFreq", frequency.getCumFreq(value)); map.put("cumPct", frequency.getCumPct(value)); map.put("pct", frequency.getPct(value)); histogramBins.add(new Tuple(map));