Hello forum,
I want to do a test of independence with svychisq, but I get an error, then this my code: am18 <- read.spss("C:/Users/diana/Dropbox/Semestre 10/Tesis 10/Tesis Diana/AMcomuna18-29MAR2012.sav", use.value.labels=TRUE, max.value.labels=Inf, to.data.frame=TRUE) b<-matrix(c(am18$N6_MANZANA),ncol=1) c<-matrix(c(am18$PM1_1_PONDEMUESTRA),ncol=1) d<-matrix(c(am18$M1_3_ESTRATO),ncol=1) e<-matrix(c(rep(0.078,315)),ncol=1) Muestra.comp<-svydesign(id=~b,strata =~d,nest=TRUE,weights=~c,data=am18, fpc=~e) ocupacion <-matrix(c(am18$M1_19_OCUPACIONPRINCIPALACTUAL),ncol=1) APES<-matrix(c(am18$M3_11_AUTOPERCEPCIONSALUDGENERAL),ncol=1) tbl1<-svytable(~ocupacion+APES,Muestra.comp) summary(tbl1, statistic="Chisq") Error en `[.data.frame`(design$variables, , as.character(rows)) : undefined columns selected when I call am18 at the end says it is a data.frame (to.data.frame = TRUE)) and by that I aprace error. I would appreciate help with this problem [[alternative HTML version deleted]] ______________________________________________ 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.