similar to: hist clarification

Displaying 20 results from an estimated 40000 matches similar to: "hist clarification"

2009 Nov 06
2
Binning of integers with hist() function odd results (PR#14046)
Full_Name: Gerald Guglielmo Version: 2.8.1 (2008-12-22) OS: OSX Leopard Submission from: (NULL) (131.225.103.35) When I attempt to use the hist() function to bin integers the behavior seems very odd as the bin boundary seems inconsistent across the various bins. For some bins the upper boundary includes the next integer value, while in others it does not. If I add 0.1 to every value, then the
2010 Mar 30
1
hist.default()$density
Dear developers, the current implementation of hist.default() calculates 'density' (and 'intensities') as dens <- counts/(n*h) where h has been calculated before as h <- diff(fuzzybreaks) which results in 'fuzzy' values for the density, see e.g. > tmp <- hist(1:10,breaks=c(-2.5,2.5,7.5,12.5),plot=FALSE) > print(tmp$density,digits=15) [1]
2013 Jan 22
3
density of hist(freq = FALSE) inversely affected by data magnitude
Hi, I have a couple of observations, a question or two, and perhaps a suggestion related to the plotting of density on the y-axis within the hist() function when freq=FALSE. I was using the function and trying to develop an intuitive understanding of what the density is telling me. After reading through this fairly helpful post:
2001 May 07
1
unexpected breaks in hist
Hello R-list, I've been using hist to plot histograms of some data, but I get variable numbers of bins. I understood from reading the help file that breaks will set the number of bins. Please correct me if I'm wrong. I'm plotting measures from subsets of a larger data set. Depending on the data subset the number of bins varies despite having set breaks to 5 in all cases. See
2006 Aug 25
1
How to get back POSIXct format after calculating with hist() results
Hi, I have a casting/formatting question on hist.POSIXt: The histogram plot from POSIXct works perfect (with help of Prof. Ripley -thanks!). When processing the hist(plot=FALSE) output and then plotting the results over the x-axis (bins) coming from hist(), I lose the date/time labels, getting instead integers displayed. Trying to cast the $breaks with as.POSIXct gives silly results with
2009 Jun 04
3
Understanding R Hist() Results...
Think I'm missing something to understand what is going on with hist(...) http://n2.nabble.com/What-is-going-on-with-Histogram-Plots-td3022645.html For my example I count 7 unique years, however, on the histogram there only 6. It looks like the bin to the left of the tic mark on the x-axis represents the number of entries for that year, i.e. Frequency. I guess it looks like the bin for
2008 Jan 30
1
"hist" combines two lowest categories -- is there a workaround?
When preparing a series of histograms I found that hist was combining the two lowest categories or bins, 1 and 2. Specifying breaks, as illustrated below, resulted in the correct histogram: values <- sample(10,500,replace=TRUE) hist(values) hist(values,breaks = 0:10) Apparently, the number of values strictly less than 1 is shown in the first bin (and since none is less than 1,
2006 Dec 04
2
erroneous warning in hist (PR#9408)
Full_Name: Alex Deckmyn Version: 2.4.0 OS: linux Submission from: (NULL) (193.190.63.62) specifying the "right" option in hist results in a warning when plot=F. The option is taken into account correctly, but a warning is issued anyway. When plot=T there is no warning. > hist(c(1,1.5),breaks=0:4)$counts [1] 1 1 0 0 > hist(c(1,1.5),breaks=0:4,right=T)$counts [1] 1 1 0 0 >
2011 May 23
1
How is the relation between Frequency and Counts in hist/density defined?
Hi all, I'm looking to add a "density" smoother on top of a hist when Freq=T. In order to do this I can use the relation between count and density, but I would like to know if there is a way for me to predict it upfront. Here is an example: set.seed(242) z = rnorm(30) hist_z <- hist(z) hist_z$counts / hist_z$density # the relation is 15 # why is this 15 ?? # So I can now do:
2001 May 06
2
how to use by() and hist()
Hello, I'm using R 1.2.2 on Sun Solaris. I have data frame with 4 levels of factor "type". See the example data frame below. type token variance 20 ku n031ku10.10msmeanc 77199422 21 ku n031ku11.10msmeanc 55682249 22 ku n031ku12.10msmeanc 52003965 23 ti n031ti01.10msmeanc 54511040 24 ti n031ti02.10msmeanc 58940197 25 ti n031ti03.10msmeanc
2011 Dec 07
1
Rank samples by breaks in hist and assign result as factor
Hi R users, My goal is to rank my samples according to how they fall out in a histogram with 10 bins to produce a ranking for each sample according to where it falls on the histogram, with a "1" to represent one tail of the hist, a "10" to represent the other tail, and a "5" for the median/mean. I have a number of different data sets to do this with and in all cases
2006 Feb 17
1
How to change the number of bins in "hist" function?
Hi all, I am doing histogram using the "hist" function. For some reason, the histogram does not look good... is there a way I can change the number of bins, and/or change the way that data gets binned... so that I can obtain a better looking histogram? Thanks a lot! [[alternative HTML version deleted]]
2013 Apr 23
2
Strange graphical pattern when using hist() function
Running the following lines I got a strange plot from hist function: x<-0:30 hist(x,breaks=31) As you can see, the 0 value appears two times in the plot. The Y axis only presents 1 as the highest value when: hist(x,breaks=62) Nevertheless, it seems to have two bars between 0 and 1. Could someone please explain to me why it is happening? Many thanks in advance!
2003 Jan 31
3
hist (PR#2512)
The command hist(c(2,2,2,4,5,6)) returns a histogram that looks incorrect -- 3 in the bin labeled 2 on the left, but 1 each in the bins labeled 3,4,5 on the left. Thanks! Pam Surko -------------------- > version _ platform i386-pc-mingw32 arch i386 os mingw32 system i386, mingw32 status major 1 minor
2010 Sep 21
5
Combined plot: Scatter + density plot
Hi, in order to save space for a publication, it would be nice to have a combined scatter and density plot similar to what is shows on http://addictedtor.free.fr/graphiques/RGraphGallery.php?graph=78 I wonder if anybody perhaps has already developed code for this and is willing to share. This is the reproducible code for the histogram version obtained from the site: def.par <-
2003 Jan 08
4
weird breaks in hist (PR#2431)
Full_Name: Reinhold Koch Version: 1.6.1 OS: redhat 8.0 Submission from: (NULL) (131.152.84.111) I came across rather weird behavior of the breaks in hist: hist(1:3) gives the expected result, besides an unnecessary gap between 2nd and 3rd column hist(1:4) always merges up the first two columns, also if I resort to hist.default(1:4,breaks=1:4). hist.default(1:4, include.lowest=F) gives an
2009 Jun 04
1
hist returning density larger than 1
The following code is giving me problems. I want to export densities of a distribution to a csv file. At the bottom of the code I use the hist function to generate the densities. But hist is returning values greater than 1. I don't understand, why. Any help you can supply is greatly appreciated. # Set word path dir<-"~/Research/MR Distribution Analysis/" setwd(dir)
1998 Nov 16
2
hist()
Going over my old notes, I realised that hist() has changed since the earlier versions of R, in that the intervals are now left-open,right-closed rather than the opposite. This is a change in the direction of S-plus compatibility, but I wonder how sensible it really is. The main problem is with ages, where you'd naturally take age 17 as representing something between 17 and 18, but: >
2013 Jan 21
2
Why using hist when setting the parameter probability=TRUE does not create probability plot?
Hi All, When carrying out hist(samples,breaks=50,probability=TRUE), the column values are considerably greater than 1, which seams very unreasonable. The plot is attached. I think the column value of the hist plot should correspond to x$counts/sum(x$counts) (x=hist(samples,breaks=50,probability=TRUE)). The size of data is a little bit larger, causing failure of uploading. If you need the
2000 Nov 17
2
hist() and density
There were some questions about hist() a couple of days ago which triggered this post. My question/suggestion is about the y-axis in hist. There are reasons to prefer making the y-axis density=relative frequency/bin width. One reason is that the height of the plot does not depend on the bin width; another is that if your histogram is in density then you can easily superimpose a smooth theoretical