Questions tagged [frequency-distribution]

A frequency distribution is an arrangement of the values that one or more variables take in a sample

A frequency distribution is an arrangement of the values that one or more variables take in a sample. Each entry in the table contains the frequency or count of the occurrences of values within a particular group or interval, and in this way, the table summarizes the distribution of values in the sample.

220 questions
48
votes
8 answers

How to generate distributions given, mean, SD, skew and kurtosis in R?

Is it possible to generate distributions in R for which the Mean, SD, skew and kurtosis are known? So far it appears the best route would be to create random numbers and transform them accordingly. If there is a package tailored to generating…
Aaron B
  • 583
  • 1
  • 5
  • 5
37
votes
8 answers

Efficiently count word frequencies in python

I'd like to count frequencies of all words in a text file. >>> countInFile('test.txt') should return {'aaa':1, 'bbb': 2, 'ccc':1} if the target text file is like: # test.txt aaa bbb ccc bbb I've implemented it with pure python following some…
Light Yagmi
  • 5,085
  • 12
  • 43
  • 64
22
votes
6 answers

Frequency tables with weighted data in R

I need to calculate the frequency of individuals by age and marital status so normally I'd use: table(age, marital_status) However each individual has a different weight after the sampling of the data. How do I incorporate this into my…
user2568648
  • 3,001
  • 8
  • 35
  • 52
20
votes
1 answer

Get a histogram plot of factor frequencies (summary)

I've got a factor with many different values. If you execute summary(factor) the output is a list of the different values and their frequency. Like so: A B C D 3 3 1 5 I'd like to make a histogram of the frequency values, i.e. X-axis contains the…
wds
  • 31,873
  • 11
  • 59
  • 84
13
votes
2 answers

Determine "wiggliness" of set of data - Python

I'm working on a piece of software which needs to implement the wiggliness of a set of data. Here's a sample of the input I would receive, merged with the lightness plot of each vertical pixel strip: It is easy to see that the left margin is really…
Blender
  • 289,723
  • 53
  • 439
  • 496
13
votes
2 answers

Scaled/weighted density plot

I want to generate a density plot of observed temperatures that is scaled by the number of events observed for each temperature data point. My data contains two columns: Temperature and Number [of observations]. Right now, I have a density plot that…
struggleBus
  • 365
  • 2
  • 5
  • 20
12
votes
2 answers

What is the fastest way to calculate frequency distribution for array in C#?

I am just wondering what is the best approach for that calculation. Let's assume I have an input array of values and array of boundaries - I wanted to calculate/bucketize frequency distribution for each segment in boundaries array. Is it good idea…
9
votes
1 answer

Interpret numpy.fft.fft2 output

My goal is to obtain a plot with the spatial frequencies of an image - kind of like doing a fourier transformation on it. I don't care about the position on the image of features with the frequency f (for instance); I'd just like to have a graphic…
TheChymera
  • 17,004
  • 14
  • 56
  • 86
8
votes
2 answers

Frequency table including zeros for unused values, on a data.table

I have a data set that is as follows: library(data.table) test <- data.table(structure(list(Issue.Date = structure(c(16041, 16056, 16042,15990, 15996, 16001, 15995, 15981, 15986, 15996, 15996, 16002,16015, 16020, 16025, 16032, 16023, 16084, 16077,…
black_sheep07
  • 2,308
  • 3
  • 26
  • 40
7
votes
4 answers

Optimal way to create a histogram/frequency distribution in Oracle?

I have an events table with two columns eventkey (unique, primary-key) and createtime, which stores the creation time of the event as the number of milliseconds since Jan 1 1970 in a NUMBER column. I would like to create a "histogram" or frequency…
matt b
  • 138,234
  • 66
  • 282
  • 345
6
votes
3 answers

Plotting frequency spectrum with c++

Please see the Edits in the answer below this question. I have written a script to plot the frequency spectrum of a sinusoidal signal with c++. Here are the steps Applying Hanning window Apply FFT using fftw3 library I have three graphs: Signal,…
Jack
  • 725
  • 1
  • 10
  • 27
5
votes
2 answers

Finding frequency distribution of a list of numbers in python

I have a Long list of numbers like the following. I would like to find frequency distribution of each number, but I could not use Counter function to get frequency of each item, as they are integers and I get the error that it is not iterable , and…
mk_sch
  • 1,060
  • 4
  • 16
  • 31
5
votes
2 answers

Is there a way to make the density() function in R use counts vs. probability?

Is there a way to make the density() function in R use counts vs. probability? For example, I have two options when examining density distributions using the histogram function hist: hist(x,freq=F) #"graphic is a representation of frequencies, the…
4
votes
2 answers

Selecting a sample to match the distribution of variables in another dataset

Let x be a dataset with 5 variables and 15 observations: age gender height weight fitness 17 M 5.34 68 medium 23 F 5.58 55 medium 25 M 5.96 64 high 25 M 5.25 60 medium 18 M 5.57 60 low 17 F 5.74 61 …
Outlier
  • 417
  • 2
  • 10
4
votes
1 answer

Use R to calculate median without replicating elements

I have a frequency distribution with huge numbers. I want to calculate median and quartiles but R complains. Here is what is working for small numbers: > TABLE <- data.frame(DATA = c(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19), F =…
meolic
  • 1,177
  • 2
  • 15
  • 41
1
2 3
14 15