[R] Help with ftable.svyby

Orsola Costantini ursilla at libero.it
Sun Jul 9 20:59:45 CEST 2017


Hi all,

When I try the following with pkg Survey it returns the error below:

ftable(svyby(~INCOME, ~AGECL+RACECL, svymean, design=q50),
rownames=list(AGECL=c("<35", "35-44", "45-54", "55-64",
                                                    "65-74", ">=75"),
           RACECL=c("white non hispanic", "non white or hispanic"))

Error in rbind(matrix("", nrow = length(xcv), ncol = length(xrv)),
charQuote(makeNames(xrv)),  :
  number of columns of matrices must match (see arg 3)

When I do the follwing instead all is good. But it only works for small
subsets!

h<-svymean(~interaction(INCOME, AGECL, RACECL), q3)

fh<-ftable(h, rownames=list(AGECL=c("<35", "35-44", "45-54", "55-64",
                                                    "65-74", ">=75"),
           RACECL=c("white non his", "non white or hispanic")))


any idea why?

Thanks!!!

U.

	[[alternative HTML version deleted]]



More information about the R-help mailing list