Dear all, I have a few gaussian distributions with known (mean and sd). How can I plot in R easily the cdf of them? In matlab there is a guid where you can give the values and have the plots ready. Is anything like that in R? Best Regards Alex
based on mean and std
3 messages · Alaios, S Ellison, Patrick Breheny
You can plot explicitly over a range of x; for example x<-seq(10, 15, 0.1) #for mean 12.5, sd 0.6 plot(x, pnorm(x, 12.5, 0.6), type="l", ylim=c(0,1) Or you can try the default plot for a univariate function (see ?curve) plot(function(x) pnorm(x, 12.5, 0.6), xlim=c(10,15)) #Note use of the function definition to include explicit mean and sd S Ellison
-----Original Message----- From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf Of Alaios Sent: 02 June 2011 12:06 To: R-help at r-project.org Subject: [R] based on mean and std Dear all, I have a few gaussian distributions with known (mean and sd). How can I plot in R easily the cdf of them? In matlab there is a guid where you can give the values and have the plots ready. Is anything like that in R? Best Regards Alex
______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. *******************************************************************
This email and any attachments are confidential. Any use...{{dropped:8}}
You could try:
f <- function(x){pnorm(x,mean=10,sd=20)}
curve(f,from=-10,to=30)
Or:
x <- seq(-10,30,len=101)
y <- pnorm(x,mean=10,sd=20)
plot(x,y,type="l")
Patrick Breheny Assistant Professor Department of Biostatistics Department of Statistics University of Kentucky On 06/02/2011 07:05 AM, Alaios wrote: > Dear all, I have a few gaussian distributions with known (mean and > sd). How can I plot in R easily the cdf of them? In matlab there is a > guid where you can give the values and have the plots ready. > > Is anything like that in R? > > Best Regards Alex > > ______________________________________________ R-help at r-project.org > mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do > read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.