Hi Dave, Bill,
Thank you. That was it!
Best Regards,
Steven
On Mar 25, 2015, at 1:11 PM, David R Forrest wrote:
> I'm away from a computer that can check syntax, but make sure the return is
> outside of the for loop. To my eye it looks inside.
[[alternative HTML version deleted]]
sim.app.wald<-function(B=0.1,min=10,max=50,alpha=0.05){
result<-c(fails=0,n=0)
for(n in min:max){
x<-seq(1,n-1,1)
...
return(result) # indent! see what's wrong?
}
}
Make your indentation (of the return line) correspond to the braces
Hi Dave,
Thank you, but that didn't seem to do it. This code produces the same result:
sim.app.wald<-function(B=0.1,min=10,max=50,alpha=0.05){
result<-c(fails=0,n=0)
for(n in min:max){
x<-seq(1,n-1,1)
fhat<-x/n
se<-sqrt((fhat*(1-fhat
3 matches
Mail list logo