Questions tagged [cumulative-frequency]

90 questions
43
votes
2 answers

Plot with fewer markers than data points (or a better way to plot CDFs?) [matplotlib, or general plotting help]

I am plotting Cumulative Distribution Functions, with a large number of data points. I am plotting a few lines on the same plot, which are identified with markers as it will be printed in black and white. What I would like are markers evenly spaced…
James Broadhead
  • 1,878
  • 1
  • 16
  • 19
34
votes
5 answers

How to generate a frequency table in R with with cumulative frequency and relative frequency

I'm new with R. I need to generate a simple Frequency Table (as in books) with cumulative frequency and relative frequency. So I want to generate from some simple data like > x [1] 17 17 17 17 17 17 17 17 16 16 16 16 16 18 18 18 10 12 17 17 17 17…
eloyesp
  • 3,135
  • 1
  • 32
  • 47
12
votes
1 answer

Tricks to get reverse-order cumulative histogram in matplotlib

I am wondering if there is a (better) trick to reverse a cumulative histogram in matplotlib. Let's say I have some scores in the range of 0.0 to 1.0 where 1.0 is the best score. Now, I am interested to plot how many samples are above a certain score…
user2489252
7
votes
2 answers

Fast counts of elements of numpy array by value thresholds in another array

Given a numpy array of threshold values, what is the most efficient way to produce an array of the counts of another array meeting these values? Assume the threshold value array is small and sorted, and the array of values to be counted is…
C8H10N4O2
  • 18,312
  • 8
  • 98
  • 134
6
votes
1 answer

How to implement a cumulative product table?

Given the following problem: There is a sequence of k integers, named s for which there can be 2 operations, 1) Sum[i,j] - What is the value of s[i]+s[i+1]+...+s[j]? 2) Update[i,val] - Change the value of s[i] to val. I am sure most people here…
Donald
  • 1,300
  • 2
  • 13
  • 29
6
votes
3 answers

Mysql calculation in select statement

I have been doing my office work in Excel.and my records have become too much and want to use mysql.i have a view from db it has the columns "date,stockdelivered,sales" i want to add another calculated field know as "stock balance". i know this is…
Law
  • 129
  • 1
  • 3
  • 10
5
votes
2 answers

efficiently replacing data frame with cumulative frequency

I'm trying to write a program that takes a large data frame and replaces each column of values by the cumulative frequency of those values (sorted ascending). For instance, if the column of values are: 5, 8, 3, 5, 4, 3, 8, 5, 5, 1. Then the relative…
user1769120
  • 107
  • 1
  • 7
4
votes
1 answer

Cumulative count of unique values per group

I have a df with names and some dates of eligibility status. I would like to create an indicator of how many unique elig_end_dates a person has, according to time. here is my df: names date_of_claim elig_end_date 1 tom 2010-01-01 …
user2363642
  • 727
  • 9
  • 26
4
votes
6 answers

SQL query for cumulative frequency of list of datetimes

I have a list of times in a database column (representing visits to a website). I need to group them in intervals and then get a 'cumulative frequency' table of those dates. For instance I might have: 9:01 9:04 9:11 9:13 9:22 9:24 9:28 and i want…
Simon
  • 525
  • 1
  • 14
  • 21
3
votes
2 answers

SQL query - find row which exceeds cumulative proportion

Say I have a table of data that looks like: ItemNo | ItemCount | Proportion ------------------------------------------ 1 3 0.15 2 2 0.10 3 3 0.15 4 …
Widor
  • 13,003
  • 7
  • 42
  • 64
3
votes
1 answer

Draw nearest value from sorted data frame into unsorted data frame

I have two data frames in R. The first data frame is a cumulative frequency distribution (cumFreqDist) with associated periods. The first rows of the data frame look like this: Time cumfreq 0 0.0000000 4 0.9009009 6 …
Michelle
  • 1,281
  • 2
  • 16
  • 31
2
votes
1 answer

How to plot a cumulative frequency line graph using ggplot2?

Forgive me if this question is self explanatory, but I am still trying to get to grips with some more of R's features. I am currently trying to use R to replot a cumulative frequency with lines I plotted in excel. I think a lot of my problems are…
Tom Wright
  • 29
  • 2
2
votes
1 answer

Calculating cumulative distribution of two samples

I was going through the a scipy code for ks test (2 sample) which calculates the maximum distance between CDF's of any two given samples. code for calculating the cumulative Distribution Function(CDF). I fail to understand the logic in the lines for…
RTM
  • 759
  • 2
  • 9
  • 22
2
votes
1 answer

Changing the relative height of the bins of a histogram interactively

In subjective probability assessments one needs to elicit the distribution of subjects believes. It can be achieved by letting the subject manipulate the relative height of each frequency bin of a histogram. I.e. the distribution of probability, the…
Roland Kofler
  • 1,332
  • 1
  • 16
  • 33
2
votes
2 answers

Cumulative Sum using 2 columns

I am trying to create a column that does a cumulative sum using 2 columns , please see example of what I am trying to do :@Faith Akici index lodgement_year words sum cum_sum 0 2000 the 14 14 1 2000 …
Ian_De_Oliveira
  • 291
  • 5
  • 16
1
2 3 4 5 6