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.

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to