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
4
votes
3 answers

Cryptography. English "normal text"?

I was asked to make a software that will encrypt and decrypt a "normal English" text based on letter frequencies. The question is where do I find some text samples where the official frequencies will match? So far, I have tried "War and Peace" by…
4
votes
5 answers

Frequency Distribution Table

I am relatively new to [R] and am looking for the best way to calculate a frequency distribution from a vector (most likely numeric but not always) complete with the Frequency, Relative Frequency, Cumulative Frequency, Cumulative Relative Frequency…
user3513178
  • 73
  • 1
  • 1
  • 5
3
votes
1 answer

How to add (or annotate) value labels (or frequencies) on a matplotlib "histogram" chart

I want to add frequency labels to the histogram generated using plt.hist. Here is the data : np.random.seed(30) d = np.random.randint(1, 101, size = 25) print(sorted(d)) I looked up other questions on stackoverflow like : Adding value labels on a…
user9329768
3
votes
2 answers

FreqDist using NLTK

I'm trying to get a frequency distribution of a set of documents using Python. My code isn't working for some reason and is producing this error: Traceback (most recent call last): File "C:\Documents and Settings\aschein\Desktop\freqdist", line…
AJS
  • 31
  • 1
  • 1
  • 2
3
votes
5 answers

What is the command for Zipf (frequency against rank) plot in R

I have from a network traffic data, data volume (# of bytes) and # of flows over a week period for origin and destination IP pair. I want to plot distribution, i.e. frequency against rank. I believe that there is a function already provided by R…
user744121
  • 467
  • 2
  • 7
  • 17
3
votes
2 answers

How to group skewed data in pandas with adaptive intervals

Let's say a column in my dataframe contains data in this frequency: >>> vals = list(range(11000,12000)) + list(range(5600,6120)) + list(range(0,40,4)) + \ list(range(0,10000,300)) + list(range(1200,1400,3)) + list(range(0,10000,1100)) >>> df…
Sayandip Dutta
  • 15,602
  • 4
  • 23
  • 52
3
votes
1 answer

How to get table in R, including count, relative frequencies, and cumulative frequencies?

I have used R Studio now for years and more often so than any other software, but now that I'm gioing to teach statistics with R, I realize that some tasks are just simpler using other software such as STATA. Is there a simple way of getting a…
Dr. Fabian Habersack
  • 1,111
  • 12
  • 30
3
votes
1 answer

How to conduct PCA on a table with abundance data BUT overlay it with vectors of environmental parameters of the sites in R?

[Fig 4 below is what I would need as outcome, the other 2 figures show what I get from my data: PCA on environmental data or on the abundance data No duplication ofR - how to make PCA biplot more readable or Plotting pca biplot with ggplot2 It is…
Ta Ani
  • 73
  • 7
3
votes
1 answer

How can I optimize a two variable function

I have been trying to optimize the following function, but without success: parametros <- data.frame(ap=c(11.1, 7.07, 6.3, 4.75, 4, 3.35), fx=c(41.2012, 39.3732, 25.2912, 10.3455, 1.2253, 0.4017)) xm <- 11.2 fxcalc <-…
3
votes
6 answers

How do I randomly sample from a list in python while maintaining the distribution of data

Essentially what I'm trying to do is randomly select items from a list while maintaining the internal distribution. See the following example. a = 17% b = 12% c = 4% etc. "a" has 1700 items in the list. "b" has 1200 items in the list. "c" has 400…
Stats_kid
  • 63
  • 1
  • 6
3
votes
2 answers

create a tuple of tokens and texts for a conditional frequency distribution

I'd like to create a table that shows the frequencies of certain words in 3 texts, whereas the texts are the columns and the words are the lines. In the table I'd like to see which word appears how often in which text. These are my texts and…
Fadinha
  • 59
  • 3
3
votes
4 answers

How to convert frequency distribution to probability distribution in R

I have a matrix with n rows of observations. Observations are frequency distributions of the features. I would like to transform the frequency distributions to probability distributions where the sum of each row is 1. Therefore each element in the…
Andres Kull
  • 4,756
  • 2
  • 15
  • 13
3
votes
2 answers

MATLAB : frequency distribution

I have raw observations of 500 numeric values (ranging from 1 to 25000) in a text file, I wish to make a frequency distribution in MATLAB. I did try the histogram (hist), however I would prefer a frequency distribution curve than blocks and…
Arkapravo
  • 4,084
  • 9
  • 37
  • 46
3
votes
4 answers

How to compute letter frequency in a string using pythons built-in map and reduce functions

I would like to compute the frequency of letters in a string using pythons map and reduce built-in functions. Could anyone offer some insight into how I might do this? What I've got so far: s = "the quick brown fox jumped over the lazy dog" # Map…
Sakara
  • 31
  • 1
  • 2
3
votes
1 answer

Frequency of elements in matrix - Matlab

From a function that i run in matlab i get a 225x400 matrix. I want to count the frequency of each element in this matrix, meaning that i need to calculate how many times each elements appears on the the matrix. My matrix name is "Idiff" I am…
astralreb
  • 37
  • 1
  • 3
  • 7
1
2
3
14 15