Displaying 20 results from an estimated 20000 matches similar to: "How to scale a histogram"
2005 Sep 20
5
Add function to histogram?
Is there any neat way to add a curve (frequency function or the like) to a
histogram or other plots? I haven't found one yet...
Robert
2017 Sep 24
3
Shift the normal curve to the top or near to the top of the histogram
Dear All:
One more thing.
I want to add the normal curve to the histogram. Is there away to stretch
the peak of the curve to the top of the histogram or at least near to the
top of the histogram.
Please see the code below.
Lizard.tail.lengths <- c(6.2, 6.6, 7.1, 7.4, 7.6, 7.9, 8, 8.3, 8.4, 8.5,
8.6,8.8, 8.8, 9.1, 9.2, 9.4, 9.4, 9.7, 9.9, 10.2, 10.4, 10.8,11.3, 11.9)
x<-seq(5,12, 0.001)
2010 Sep 23
2
dnorm
Dear R-users
Idea:
Plot a dnorm line using specific mean/sd to complete a histogram (skewed). xs:range of y-values, ys: dnorm function
Problem:
I expected to multiply the ys function with the sample size (n=250-300). I was wondering about a factor between 12'000 and 30'000 to match the size of the dnorm line with the specific histogram.
Thanks
Sibylle
hist(Biotree[Ld,]$Height2008,
2011 Apr 22
1
histogram of dates
I can't seem to get a histogram of dates:
tmt910% R --vanilla
R version 2.13.0 (2011-04-13)
Copyright (C) 2011 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
...
> temp <- as.Date(1:200, origin="1970/01/01")
> range(temp)
[1] "1970-01-02" "1970-07-20"
> hist(temp)
Error in .Internal(inherits(x, what, which)) : 'x' is missing
2009 Dec 09
3
Plotting frequency curve over histogram
Hello,
This is a problem for which there seem to be several solutions online, but
not really. My question was about plotting a curve over the histogram. All
the previous posts and messages talk about generating a *density
histogram*using (freq=F) and then plotting the density curve. However,
I find that
that seriously distorts my data and the plot becomes confounding to the
viewer.
I was
2017 Sep 25
0
Shift the normal curve to the top or near to the top of the histogram
Hi Abou,
Try this:
library(plotrix)
curve(rescale(dnorm(x
,mean=mean(Lizard.tail.lengths),sd=sd(Lizard.tail.lengths)),
c(0,6)),add=TRUE, col=2, lwd = 2)
Jim
On Mon, Sep 25, 2017 at 9:35 AM, AbouEl-Makarim Aboueissa
<abouelmakarim1962 at gmail.com> wrote:
> Dear All:
>
> One more thing.
>
> I want to add the normal curve to the histogram. Is there away to stretch
> the
2008 Jun 23
5
Need ideas on how to show spikes in my data and how to code it in R
Hi
I have recently been analyzing birthweight data from a clinic. The
data has obvious defects in that there is digit preference on certain
weights making them overrepresented. This shows as spikes in the
histogram on certain well rounded weights like 2, 2.5, 3, etc. I
would like to show this to government officials but can't figure out
how I should present the finding in an easy to
2008 May 09
7
histogram
Dear R-expert,
For histogram function, can we get the table of bin and frequency like in excel, together with the histogram?
Therefore, we can check the number of data included.
Thank you so much for your attention and help.
____________________________________________________________________________________
[[elided Yahoo spam]]
2009 May 09
2
Histogram frequencies with a normal pdf curve overlay
Dear List,
When I plot a histogram with 'freq=FALSE' and overlay the histogram
with a normal pdf curve, everything looks as expected, as follows:
x <- rnorm(1000)
hist(x, freq=FALSE)
curve(dnorm(x), add=TRUE, col="blue")
What do I need to do if I want to show the frequencies (freq=TRUE)
with the same normal pdf overlay, so that the plot would still look
the same?
Regards,
2009 Oct 08
5
histogram
Hi all,
I have a question about hist()
1)
> t1 <- hist(c(1,2,3,4,5))
> t1
$breaks
[1] 1 2 3 4 5
$counts
[1] 2 1 1 1
why is there 2 counts for 1? And should the counts be '1 1 1 1 1' ?
Is there any other function to count frequency of discrete data?
Thanks.
-k
[[alternative HTML version deleted]]
2012 Mar 12
3
A question on histogram - area much less than 1
Hello,
I have problem running the histogram function "hist". The area under the
histogram is much lower than 1. Could anyone tell me what the problem is?
Thanks,
(The total number of observation is 992 (close to 1000), so the
probability that 0<Y1<35 is approximately 0.277)
miao
rm(list=ls())
par(mfrow=c(1, 1))
Y <- cbind(matrix(35*0.5,1,277), matrix(35*1.5, 1, 146),
2009 Dec 09
3
Population Histogram
How would I make a population histogram in R from an excel file? Thanks
[[alternative HTML version deleted]]
2005 Oct 20
1
having scaling problems with a histogram
Hello,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
I would like to create a histogram from a data collumn consisting of 4 classes (0; 0.05;0.5;25;75). Due to the difference in scale the classes 0;0.05 and 0.5 are displayed within one combined bin by default with the code:Hist(x, scale="percent",
2009 Jul 20
3
Histograms on a log scale
Dear All,
I would like to be able to plot histograms/densities on a semi-log or
log-log scale.
I found several suggestions online
http://tolstoy.newcastle.edu.au/R/help/05/09/12044.html
https://stat.ethz.ch/pipermail/r-help/2002-June/022295.html
http://www.harding.edu/fmccown/R/#histograms
Now, consider the code snippet taken from
http://www.harding.edu/fmccown/R/#histograms
# Get a random
2007 Sep 17
3
Histogram with colors
Is there a simple way to plot a histogram with colors?
For example, suppose I generate random points in the
N(2,1) distribution:
x <- rnorm(100000, mean = 2, sd = 1)
Now I would like to plot the histogram:
hist(x)
but I would like to show the bars with x < 0 in red, and the
bars with x >= 0 in lightgreen. Is there any simple way to
do it?
I think I can do it in two steps:
2004 Aug 19
3
probability histogram question
Hello, all;
I get an unexpected result when trying to plot a probability histogram
with R1.9.1 on windows xp:
#with the following code:
> x <- runif(100,0,1)
> hist(x)
> hist(x, freq=F)
> h <- hist(x, freq=F)
> summary(h)
# Length Class Mode
#breaks 11 -none- numeric
#counts 10 -none- numeric
#intensities 10 -none- numeric
#density 10
2005 Apr 20
6
Histogram
Dear everybody!
I am analysing data from an enquette. The answers are either A or B. How can I
draw a histogram without transforming the data from characters to numbers? If
the data are saved in a list M, hist(M[,1]) returns:
Error in hist.default(M[, 1]) : `x' must be numeric
Execution halted
Thank you in advance!
2004 Feb 04
5
Newbie question: histogram
Hello,
how do you create a histogram with a data frame?
year snow.cover
1970 6.5
1971 12.0
1972 14.9
1973 10.0
1974 10.7
1975 7.9
...
mydata=data.frame(year=c(1970,...),snow.cover=c(6.5,...))
hist(mydata) does not work.
Many thanks.
PR
2008 Nov 06
2
Incrementally building histograms
Hello
I need to build a histogram from data (numbers in the [0,1] interval)
stored in a number of different files. The total amount of data is very
large, so I can't load everything to memory and then simply call hist().
Since what I actually need are the histogram counts, I'm currently doing
it like this:
breaks <- seq(0, 1, by = 0.01)
files <- list.files(pattern = "some
2011 Jun 09
1
histogram - density on y axis and restriction to interval [0, 1]
Hello,
To indicate probability densities instead of counts on a histogram, I
specify freq = FALSE.
However, I expect that summing all top y coordinates over all the
intervals of the histogram will provide 1.
1)
v <- c(0.2885, 0.2988, 0.3139, 0.2615, 0.3179, 0.3163, 0.2583, 0.3052,
0.2527, 0.3147, 0.3235, 0.2408, 0.2480, 0.3108, 0.3577, 0.2829, 0.2694,
0.3275, 0.3314, 0.2639, 0.3076,