r - How can I overlay 2 normal distribution curves on the same plot? -


i'm brand new r, , i'm facing problem without in- class resources. need i'm sure simple. can point me in right direction? task:

let x denote monthly return on microsoft stock , let y denote monthly return on starbucks stock. assume x∼n(0.05,(0.10)2) , y∼n(0.025,(0.05)2).

using grid of values between –0.25 , 0.35, plot normal curves x , y. make sure both normal curves on same plot.

i've been able randomly generated normal distribution generated, not both on same plot, , not specifying mean , st dev. big in advance.

use functions lines or points, i.e.

s <- seq(-.25,.35,0.01) plot(s, dnorm(s,mean1, sd1), type="l") lines(s, dnorm(s,mean2, sd2), col="red") 

also, check function par (using ?par ) plotting options, common options include labels (xlab/ylab), plotlimits (xlim/ylim), colors(col), etc...


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -