[R] problem in R
Jim Lemon
drjimlemon at gmail.com
Fri Nov 6 02:31:18 CET 2015
Hi thanoon,
When I run your code, I get two error messages. Those error messages tell
you all you need to know to solve the first part of your problem (i.e. that
none of the values in W1 and W2 are changed from NA). The second part of
your problem is that even if you attend to those error messages, you will
only change the first values in W1 and W2. The fundamental problem that has
emerged in this discussion is that you seem to be applying the method of
post-modernist deconstruction to programming in R. I see no future in this
enterprise.
Jim
On Fri, Nov 6, 2015 at 1:10 AM, thanoon younis <thanoon.younis80 at gmail.com>
wrote:
> Dear Dr. Lemon
>
> I have a problem in the code below same the previous problem but the data
> now is dichotomous with two categories 0,1. I want to transfer the vector
> BZ with missing data to vector W with dichotomous data but the result is NA
> for W how can i solve this problem please?
>
> Mnay thanks in advance
>
>
>
>
> N1<-200;N2<-200;P<-9
> BZ1=matrix(NA, nrow=N1, ncol=1)
> BZ2=matrix(NA, nrow=N2, ncol=1)
> W1=matrix(NA, nrow=N1, ncol=1)
> W2=matrix(NA, nrow=N2, ncol=1)
>
> BZ1=rbinom(200,1,0.7)
>
>
> for (j in 1:1) { if (BZ1[i]>=0) W1[i]<-1 else W1[i]<-0 }
>
> BZ2=rbinom(200,1,0.7)
>
>
>
> for (j in 1:1) { if (BZ2[i]>=0) W2[i]<-1 else W2[i]<-0 }
>
>
> #Input data set for OpenBUGS
> data<-list(N1=200,N2=200,P=9,R=Ro,W1,W2)
>
>
> #end
>
> W1
> W2
>
> --
> Thanoon Y. Thanoon
> PhD Candidate
> Department of Mathematical Sciences
> Faculty of Science
> University Technology Malaysia, UTM
> E.Mail: Thanoon.younis80 at gmail.com
> E.Mail: dawn_prayer80 at yahoo.com
> Facebook:Thanoon Younis AL-Shakerchy
> Twitter: Thanoon Alshakerchy
> H.P:00601127550205
>
[[alternative HTML version deleted]]
More information about the R-help
mailing list