Hi I have created the following plot over the empirical returns.. What I now want to do is to overlay a curve/line with the normal density as a comparison of the two. Does anyone know how to do this? (NB the last two lines are the problem, and are wrong, I know). Thank you in advance! Rikke http://r.789695.n4.nabble.com/file/n3768783/S%26P_500_spot_and_return_2010.csv S%26P_500_spot_and_return_2010.csv setwd("F:/Data til speciale/") marketdata <- read.csv(file="S&P 500 spot and return 2010.csv", header=TRUE, sep=";") returns <- marketdata[,7] ### Kernel density estimator ########################### x <- density (returns) plot(density(returns), main = "Kernel density") y <- rnorm(209,mean=0,sd=1) curve(dnorm(y,mean=mean(normal1),sd=sd(normal1))) -- View this message in context: http://r.789695.n4.nabble.com/Adding-a-normal-density-curve-over-the-empirical-curve-tp3768783p3768783.html Sent from the R help mailing list archive at Nabble.com.
Adding a normal density curve over the empirical curve
2 messages · Newbie, R. Michael Weylandt
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20110825/6654be6a/attachment.pl>