Re: [R] merge two dataset and replace missing by 0

2010-11-15 Thread Kate Hsu
Thanks for all of your help. It works to me. Kate On Mon, Nov 15, 2010 at 10:06 AM, David Winsemius wrote: > > On Nov 15, 2010, at 10:42 AM, Kate Hsu wrote: > > Hi r users, >> >> I have two data sets (X1, X2). For example, >> time1<-c( 0, 8, 15, 22, 43,

[R] merge two dataset and replace missing by 0

2010-11-15 Thread Kate Hsu
Hi r users, I have two data sets (X1, X2). For example, time1<-c( 0, 8, 15, 22, 43, 64, 85, 106, 127, 148, 169, 190 ,211 ) outpue1<-c(171 ,164 ,150 ,141 ,109 , 73 , 47 ,26 ,15 ,12 ,6 ,2 ,1 ) X1<-cbind(time1,outpue1) time2<-c( 0 ,8 ,15 , 22 ,43 , 64 ,85 ,106 ,148) output2<-c(

[R] Question regarding to replace

2010-11-09 Thread Kate Hsu
Dear r-users, Basically, I have a data as follows, > data S s1 s2 s3 s4 s5 prob obs num.strata 1 N N N N N N 0.108 32 2 Y N N N N Y 0.0005292 16 3 NNNYN N N N Y N 0.0005292 24 4 NNNYY N N N Y Y 0.0259308 8 1

[R] Question related to combination and the corresponding probability

2010-11-08 Thread Kate Hsu
Dear r users, I have 4 variables x1,x2,x3,x4 and each one has two levels, for example Y and N. For x1: prob(Y)=0.6, prob(N)=0.4; For x2: prob(Y)=0.5, prob(N)=0.5; For x3: prob(Y)=0.8, prob(N)=0.2; For x4: prob(Y)=0.9, prob(N)=0.1; Therefore, the sample space for (x1, x2, x3, x4)={, YYYN, Y