R Under development (unstable) (2024-03-07 r86063 ucrt) -- "Unsuffered Consequences" Copyright (C) 2024 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > library(survey) Loading required package: grid Loading required package: Matrix Loading required package: survival Attaching package: 'survey' The following object is masked from 'package:graphics': dotchart > data(api) > dclus1 <- svydesign(id=~dnum, weights=~pw, data=apiclus1, fpc=~fpc) > > dclus1<-update(dclus1, mealcat=cut(meals,c(0,25,50,75,100))) > > ## population marginal totals for each stratum > pop.types <- data.frame(stype=c("E","H","M"), Freq=c(4421,755,1018)) > pop.schwide <- data.frame(sch.wide=c("No","Yes"), Freq=c(1072,5122)) > > > ## rake with the population totals > dclus1r<-rake(dclus1, list(~stype,~sch.wide), list(pop.types, pop.schwide)) > > # works > m <- svyolr(mealcat~avg.ed+mobility+stype, design=dclus1) > > # fails in 4.1 (should work because svyolr's default na.action is na.omit) > m2 <- svyolr(mealcat~avg.ed+mobility+stype, design=dclus1r) > > # fails in 4.1 (should work because NA values are subsetted out) > m3 <- svyolr(mealcat~avg.ed+mobility+stype, design=subset( dclus1r , !is.na( avg.ed ) ) ) > > proc.time() user system elapsed 1.45 0.14 1.57