Re: [R] dummy coding problem

2014-03-26 Thread David Winsemius
On Mar 26, 2014, at 11:34 AM, Si Qi L. wrote: > Hi, I have got a problem with dummy coding and I really couldn't figure it > out. Would you please help me out? this is my codes: > > idx<-sort(unique(Employment.time$V1)); > dummy <- matrix(NA, nrow=nrow(Employment.time), ncol= length(idx)) > > f

Re: [R] dummy coding problem

2014-03-26 Thread Jim Lemon
On 03/27/2014 05:34 AM, Si Qi L. wrote: Hi, I have got a problem with dummy coding and I really couldn't figure it out. Would you please help me out? this is my codes: idx<-sort(unique(Employment.time$V1)); dummy<- matrix(NA, nrow=nrow(Employment.time), ncol= length(idx)) for (i in 1:nrow(Emplo

Re: [R] dummy coding problem

2014-03-26 Thread Bert Gunter
No you don't. You have a problem with not learning how R works. Dummy coding is not needed in R. R uses factors instead. Read "An Introduction to R" (ships with R) or a web tutorial of your choice to learn how to work with R. Cheers, Bert Bert Gunter Genentech Nonclinical Biostatistics (650) 467-

[R] dummy coding problem

2014-03-26 Thread Si Qi L.
Hi, I have got a problem with dummy coding and I really couldn't figure it out. Would you please help me out? this is my codes: idx<-sort(unique(Employment.time$V1)); dummy <- matrix(NA, nrow=nrow(Employment.time), ncol= length(idx)) for (i in 1:nrow(Employment.time)) { for (j in 1:length(idx))