Re: [R] conditonal "if"

2010-07-30 Thread Erik Iverson
On 07/30/2010 06:04 PM, putri wikie wrote: 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(

Re: [R] conditonal "if"

2010-07-30 Thread Wu Gong
I replicated your error. tau2ca <- NA if (tau2ca==0) {x <- 0.01} else {x <- tau2ca} Hope it helps. And I couldn't replicate your second program, but it seems ok. - A R learner. -- View this message in context: http://r.789695.n4.nabble.com/conditonal-if-tp2308568p2308578.html Sent from

[R] conditonal "if"

2010-07-30 Thread putri wikie
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