data(api)
  xtabs(~sch.wide+stype, data=apipop)
  dclus1<-svydesign(id=~dnum, weights=~pw, data=apiclus1, fpc=~fpc)
  summary(dclus1)
  svytable(~sch.wide+stype, dclus1)
  svychisq(~sch.wide+stype, dclus1)
  svychisq(~sch.wide+stype, dclus1, statistic="Chisq")
  rclus1 <- as.svrepdesign(dclus1)
  svreptable(~sch.wide+stype, rclus1, round=TRUE)Run the code above in your browser using DataLab