Can anyone help? I can't get both plots on the same graph. Everything
else works OK & I can plot each individually. Here's my code:
a <- seq(from = -12, to = 12, by = .01)
out1 <- c()
for (i in 1:length(a)){
out1[i] <- fbin.rep(a[i], y=y.bin1)
out2[i] <- fbin.rep(a[i], y=y.bin2)
}
#
a <- pnorm(a, sd=4)
plot(a, out2, type="l", lwd=1.5, xlab="Binomial parameter: pi", ylab=
"log-likelihood")
lines(a, out1, col="blue", lty="dashed")
abline(v = pnorm(opt1$par, sd=4), col = "skyblue", lty="dashed")
abline(v = pnorm(opt2$par, sd=4), col = "hotpink")
Thanks
Jeremy
Dr Jeremy Hodgen
Senior Lecturer in Mathematics Education
King's College London
Department of Education and Professional Studies
Franklin-Wilkins Building
Waterloo Bridge Wing
150 Stamford Street
London SE1 9NH
Tel: 020 7848 3102
Fax: 020 7848 3182
E-mail: jeremy.hodgen at kcl.ac.uk
Show replies by date