[R] Error message

Mathew, Abraham T amathew at ku.edu
Mon Mar 22 17:39:38 CET 2010



I'm recoding variables and running a logit. Unfortunately, I get the following error.



data04$V043114
part <- data04$V043114
attributes(part)
summary(part)

partb < part
partb[part %in% levels(part)[4]] <- NA
partb[part %in% levels(part)[5]] <- NA
partb[part %in% levels(part)[6]] <- NA
partb[part %in% levels(part)[7]] <- NA
partb <- factor(partb)

attributes(partb)
summary(partb)
table(partb)
table(part, partb)
cbind(part, partb)

partisan041 <- partb
partisan042 <- as.numeric(partb)

summary(partisan041)
summary(partisan042)


Then when I try to run the logit model using Zelig, I get an error message

anes04one <- zelig(trade041a ~ age042 + education042 + personal042 + economy042 + partisan042 + employment042 + union042 + home042 + market042 + race042 + income042 + gender042, model="logit", data=data04)

#Error in model.frame.default(formula = trade041a ~ age042 + education042 +  : 
#  variable lengths differ (found for 'partisan042')


Can anyone help???
Abraham M.



More information about the R-help mailing list