Displaying 20 results from an estimated 10000 matches similar to: "how to get the distribution curve from a data set?"
2007 Dec 30
1
Histogram with different colors for different portions
Dear Rusers,
I would like to color different sections of a histogram different colors.
I have an example that was done by "brute force" given below. Has anyone
implemented something like this in general? If not, any suggestions/pointers
on how to write a general function to do so would be most appreciated.
Alan-
2008 Jul 22
5
How to filter a data frame?
I have a question about how to filter the data frame:
Suppose my data frame has variables like gender, age,... How to get a subset
of the data frame, with only female (or male) and/or age > 50...? What is
the typical syntax? I tried several condition expressions, but none of them
worked...
Thanks a lot!
--
View this message in context:
2005 Sep 25
4
hist(x, ...) with normal distribution curve
.
I am looking for a histogram or box plot with the adding normal
distribution curve
I think that must be possible, but I am not able to find out how to do.
Regards Knut
2004 Mar 01
6
How to plot Histogram with frequence overlaid by distribution curve
Hi,
I am facing the problem that I want to plot a histogram chart set
freq to true and overlay with normal or weibull or exponential distribution
curve.
The sample code is shown as below:
>samp<-c(-8.2262,-8.2262,-8.2262,-8.20209,-8.09294,-8.07321,-8.07321,
-8.07321,-8.07175,-8.04948,-8.04948,-8.04948,-8.03848,-8.03848,
2008 Jul 07
3
A quick question about lm()
I have a simple regression using lm().
If I just want to check the coefficient, I can use summary(lm())$coef; if I
need the standard error, I can use summary(lm())$s, if I need the residuals,
I can use summary(lm())$res. OK. How can I get the R-squares and Adjusted
R-squares using $...?
Is there a function, like objects(), that can show all the references for
values?
Thanks a lot!
--
View this
2008 Oct 21
5
how to plot the histogram and the curve in the same graph
i want to plot the histogram and the curve in the same graph.if i have a set
of data ,i plot the histogram and also want to see what distribution it
was.So i want to plot the curve to know what distribution it like.
--
View this message in context: http://www.nabble.com/how-to-plot-the-histogram-and-the-curve-in--the-same-graph-tp20082506p20082506.html
Sent from the R help mailing list archive at
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)
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,
2008 Jun 19
2
Draw curve for histogram
Hi all,
What parameter should I feed to the hist function to draw a line, not bar
graph for a histogram? Smoothed line would be great too.
I've looked at curve() for normal distribution but it's not what I need. I
need some curve on top of the histogram (fit to the actual data). Just as a
way to illustrate, rather than bargraph.
Thanks
--
Regards,
Anh Tran
UCLA NeuroOncology Lab
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
2003 Apr 09
3
plotting the lognormal density curve
I am trying to plot a lognormal density curve on top of an existing
histogram. Can anybody suggest a simple way to do this? Even if someone
could just explain how to plot a regular normal density curve on top of an
existing histogram, it would be a big help.
Also, is there some way to search through the R-help archives other than
simple browsing?
Thank you so much. Your help and time is greatly
2001 Oct 13
2
hist and normal curve
Dear R people:
I would like to superimpose a normal curve on a histogram.
I've seen this example in a book, somewhere.
I know that you draw the hist, get the mean and sd
of the data set, but then I'm stuck.
Could you help, please?
Thanks!
Erin
hodgess at uhddx01.dt.uh.edu
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read
2012 May 20
2
Histograms with bin proportions on the y-axis
I have what is probably a simple problem. I have a data file from an MCMC
Bayes estimation problem that is a vector of 500,000 numeric values (just
one variable) ranging from 100,000 to 700,000. I need to display the
histogram of this data in a high quality graphic for a figure in a journal
publication. I want 100 bins so as to display a reasonable complete and
smooth histogram, and I need the
2005 Nov 02
1
Visualizing a Data Distribution -- Was: breaks in hist()
> > Leaf Sun wrote:
> > The histogram is highly screwed to the right, say, the range
> > of the vector is [0, 2], but 95% of the value is squeezed in
> > the interval (0.01, 0.2).
I guess the histogram is as you wrote. See
http://web.maths.unsw.edu.au/~tduong/seminars/intro2kde/
for a short explanation.
> -----Original Message-----
> From: Berton Gunter
2005 Apr 27
4
Density curve over a histogram
Dear All
I would like to draw a picture with the density curve of a normal
distribution over a histogram of a set of random numbers extracted
from the same normal distribution. Is that possible?
Thanks in advance,
Paul
2002 Oct 14
2
Another newbie question: curve of normal distribution
I would like to get a curve of normal distrubtion over the
histogram. Something like the following (which obviously doesn't
work; see attached example).
maluj <- function() {
vrhy=read.csv("pennies.csv",head=TRUE)
hf=table(vrhy$HEADS)
postscript("heads.eps",onefile=FALSE,width=4.134,height=3.445,pointsize=12)
plot(hf,main="Frequency distribution of
2012 Mar 19
1
fitting a histogram to a Gaussian curve
Hello,
I am trying to fit my histogram to a smooth Gaussian curve(the data
closely resembles one except a few bars).
This is my code :
#!/usr/bin/Rscript
out_file = "irc_20M_opencl_test.png"
png(out_file)
scan("my.csv") -> myvals
hist(myvals, breaks = 50, main = "My Distribution",xlab = "My Values")
pdens <- density(myvals, na.rm=T)
plot(pdens,
2006 Aug 04
2
Doubt about Student t distribution simulation
Dear R list,
I would like to illustrate the origin of the Student t distribution using R.
So, if (sample.mean - pop.mean) / standard.error(sample.mean) has t
distribution with (sample.size - 1) degree free, what is wrong with the
simulation below? I think that the theoretical curve should agree with
the relative frequencies of the t values calculated:
#== begin options=====
# parameters
2009 Sep 02
2
Howto fit normal curve into histogram using GGPLOT2
Currently, I am doing it this way.
x <- mtcars$mpg
h<-hist(x, breaks=10, col="red", xlab="Miles Per Gallon",
main="Histogram with Normal Curve")
xfit<-seq(min(x),max(x),length=40)
yfit<-dnorm(xfit,mean=mean(x),sd=sd(x))
yfit <- yfit*diff(h$mids[1:2])*length(x)
lines(xfit, yfit, col="blue", lwd=2)
But since, ggplot2 has more appealing
2008 Oct 25
2
how to plot chi-square distribution in the graph
if i want to plot the chi-square distribution with a different degree of
freedom how can i plot it in the graph?Sometimes i plot the histogram and
cut it in a lot of piece.It's distribution like a chi-square.So i want to
plot the chi-square with a different degree of freedom to compare it .
--
View this message in context: