if (FALSE) {
# Recode ASBGBOOK
table(as.numeric(pirls$ASBGBOOK), pirls$ASBGBOOK)
pirls$BOOK[as.numeric(pirls$ASBGBOOK)==1] <- 5
pirls$BOOK[as.numeric(pirls$ASBGBOOK)==2] <- 18
pirls$BOOK[as.numeric(pirls$ASBGBOOK)==3] <- 63
pirls$BOOK[as.numeric(pirls$ASBGBOOK)==4] <- 151
pirls$BOOK[as.numeric(pirls$ASBGBOOK)==5] <- 251
table(pirls$BOOK)
pirls.reg(y= "BOOK", x= "ITSEX", by="IDCNTRYL", data=pirls)
}
Run the code above in your browser using DataLab