Hi,

I have problem with my R program. Actually, it just a simple program, but I do 
not know the error is. Here is part of my program:

....
if (tau2ca==0) {MVvc <- 0.01} else {MVvc <- tau2ca}
ri_vc <- si2/MVvc
vi_vc <- ri_vc + 1
Y_bar_vc <- sum(y/vi_vc)/sum((1/vi_vc))
tau2MVvc <- sum((1/vi_vc)*(y - Y_bar_vc)^2)/(k-1)
....

But then, there is an error displayed in workspace

Error in if (tau2ca == 0) { : missing value where TRUE/FALSE needed

I do not know why there is an error like that. I think I type the program 
correctly. Also, I just want to make sure whether my program below is right or 
not.

for (l in 1:k)
{if (a[l]==0 | b[l]==0 | c[l]==0 | d[l]==0) 
{ a[l] <- a[l]+0.5
 b[l] <- b[l]+0.5
 c[1] <- c[1]+0.5
 d[1] <- d[1]+0.5
}
}

Looking forward to hearing from you.


Many thanks,
-pwikie-



      
        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to