I relate to R codes. When i type
sim.clt <- function (m=100,n=10,p=0.25) { z = rbinom(m,n,p) x = (zn*p)/sqrt(n*p*(1-p)) hist(x,prob=T,breaks=20,main=paste("n =",n,"p =",p)) curve(dnorm(x),add=T) }
This gives me errors:
Error: unexpected input in: " x = (zn*p)/sqrt(n*p*(1-p)) hist(x,prob=T,breaks=20,main=paste("n =",n,? > curve(dnorm(x),add=T) > } Error: unexpected '}' in "}" >
How to fix the error? thank you
source share