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
1
vote
2 answers

R programming: Want to generate random frequencies

I want to generate random frequencies (i.e. frequencies have to equal to 1) to simulate gene frequencies in a population using R. My solution is: freq<- function(x,y) #random frequency generator, no defined distribution {rn<-sample(1:y,x) …
1
vote
2 answers

Create better frequency tables in R

Here is some data: dta <- data.frame( id = 1:10, code1 = as.factor(sample(c("male", "female"), 10, replace = TRUE)), code2 = as.factor(sample(c("yes", "no", "maybe"), 10, replace = TRUE)), code3 = as.factor(sample(c("yes", "no"), 10,…
Rico
  • 1,998
  • 3
  • 24
  • 46
1
vote
1 answer

Plotting multiple frequency polygon lines using ggplot2

I have a dataset with records that have two variables: "time" which are id's of decades, and "latitude" which are geographic latitudes. I have 7 time periods (numbered from 26 to 32). I want to visualize a potential shift in latitude through time.…
1
vote
2 answers

How do I get the frequency totals for each bar in a barplot in R?

I have the following code to generate a dataset in R. However, I want the actual precise values for each x value in the chart and cant figure out how to generate these values. Here is the code I have: x <- c("CF", "CH", "CJ", "CE", "CN", "EC",…
amber4478
  • 6,433
  • 3
  • 20
  • 17
1
vote
5 answers

Sorting frequency of chars

I just made an algorithm that counts the frequency of chars in a String. What I am confused about is how to sort the frequency so the character with the greatest number of occurences is listed at the top, and the least at the bottom. At first I…
AOE
  • 109
  • 2
  • 7
  • 14
1
vote
2 answers

rand() returns no value in my custom function

Despite having set srand() only once as pointed by similar Q/A about rand() I think the following rand does not return a value for my customized random function. Anyway my purpose was to generate a few random numbers and right after their appearance…
solid.py
  • 2,782
  • 5
  • 23
  • 30
1
vote
2 answers

How to find all values which only appear less than X times in a vector

I have a vector, in this case a character vector. I want all the elements which only appear once in the vector, but the solution should be generalizable for limits other than 1. I can pick them manually if I use the table function. I thought that…
rumtscho
  • 2,474
  • 5
  • 28
  • 42
1
vote
1 answer

R: weird y-axis in frequency/density plot (ggplot2)

I have data from two samples and I want to plot a frequency distribution plot in R. I have the reference done in Excel: I uploaded in R the data (HistSerp). It's 136 obs. of 2 variables. summary(HistSerp) V1 V2 Min. :0.000 …
PGreen
  • 3,239
  • 3
  • 24
  • 29
1
vote
1 answer

SAS: relating variables

I'm very new to both SAS and statistical analysis in general. I have a degree in computer science and I'm taking an online course in statistics and am confused on how to achieve what I want in SAS. I have searched online to no avail but am probably…
kyro1021
  • 31
  • 2
1
vote
2 answers

R identifying type of frequency distribution

I am interested in frequency distributions that are not normally distributed. If I have a frequency distributions table which is not normally distributed. Is there a function or package that will identify the type of distribution for me?
adam.888
  • 7,686
  • 17
  • 70
  • 105
1
vote
1 answer

Draw a frequency plot in d3 with JSON data

I am doing a project in d3 and am at my wits' end on how to draw a frequency graph for graphing tweets. So, basically, I have a JSON file whose format is like this { "text": "some text here", "time": "timestamp here", "timezone":…
pratnala
  • 3,723
  • 7
  • 35
  • 58
1
vote
2 answers

Fit 1000 samples to a normal distribution using Maximum-Likelihood in C++

I have a sample of 5000 doubles like sample = {1.23, -4.67, 0.17, 1.25, 6.89, -2.03, ...} and want to fit the data to a parametric distributions like N(mu, sigma) or generalized student t(loc, scale, DoF)... I already have the PDFs of these…
0
votes
0 answers

Creating a smoothed heat map with normalized frequencies per column

I am studying the relationship between the concentration of a metabolite (hypocretin) and a continuous outcome variable (BMI). I want to create a frequency heat map in which different concentrations of the metabolite are presented on the X-axis and…
Jingru
  • 1
  • 1
0
votes
1 answer

Frequency and time-freqeuncy domain features for a sinusoidal signal in Python

I have the following sine wave signal created in Python: # Import libraries import numpy as np import matplotlib.pyplot as plt Fs = 1000 # Sampling frequency (Hz) T = 10 …
0
votes
2 answers

For a simple key-value pair list JSON, use jq to print a summary by range of values

Consider the following JSON having a list of key-value pairs { "session1": 128, "session2": 1048596, "session3": 3145728, "session4": 3145828, "session5": 11534338, "session6": 11544336, "session7": 2097252 } The key is a session…