Skip to content

based on mean and std

3 messages · Alaios, S Ellison, Patrick Breheny

#
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
#
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
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")