Running ‘DBIcheck.R’
  Comparing ‘DBIcheck.Rout’ to ‘DBIcheck.Rout.save’ ...83,93c83,94
<  [1] "cds"         "stype"       "name"        "sname"       "snum"       
<  [6] "dname"       "dnum"        "cname"       "cnum"        "flag"       
< [11] "pcttest"     "api00"       "api99"       "target"      "growth"     
< [16] "sch_wide"    "comp_imp"    "both"        "awards"      "meals"      
< [21] "ell"         "yr_rnd"      "mobility"    "acs_k3"      "acs_46"     
< [26] "acs_core"    "pct_resp"    "not_hsg"     "hsg"         "some_col"   
< [31] "col_grad"    "grad_sch"    "avg_ed"      "full__1"     "emer"       
< [36] "enroll"      "api_stu"     "fpc"         "pw"          "row_names:1"
< [41] "wt1"         "wt2"         "wt3"         "wt4"         "wt5"        
< [46] "wt6"         "wt7"         "wt8"         "wt9"         "wt10"       
< [51] "wt11"        "wt12"        "wt13"        "wt14"        "wt15"       
---
>  [1] "row_names"   "cds"         "stype"       "name"        "sname"      
>  [6] "snum"        "dname"       "dnum"        "cname"       "cnum"       
> [11] "flag"        "pcttest"     "api00"       "api99"       "target"     
> [16] "growth"      "sch_wide"    "comp_imp"    "both"        "awards"     
> [21] "meals"       "ell"         "yr_rnd"      "mobility"    "acs_k3"     
> [26] "acs_46"      "acs_core"    "pct_resp"    "not_hsg"     "hsg"        
> [31] "some_col"    "col_grad"    "grad_sch"    "avg_ed"      "full__1"    
> [36] "emer"        "enroll"      "api_stu"     "fpc"         "pw"         
> [41] "row_names:1" "wt1"         "wt2"         "wt3"         "wt4"        
> [46] "wt5"         "wt6"         "wt7"         "wt8"         "wt9"        
> [51] "wt10"        "wt11"        "wt12"        "wt13"        "wt14"       
> [56] "wt15"       
  Running ‘api.R’
  Comparing ‘api.Rout’ to ‘api.Rout.save’ ...96c96
< 0.003669 0.037743 0.052840 0.042390 0.052840 0.052840 
---
> 0.003669 0.037740 0.052840 0.042390 0.052840 0.052840 
124c124
< 0.003669 0.037743 0.052840 0.042390 0.052840 0.052840 
---
> 0.003669 0.037740 0.052840 0.042390 0.052840 0.052840 
302c302
< 0.003669 0.037743 0.052840 0.042390 0.052840 0.052840 
---
> 0.003669 0.037740 0.052840 0.042390 0.052840 0.052840 
330c330
< 0.003669 0.037743 0.052840 0.042390 0.052840 0.052840 
---
> 0.003669 0.037740 0.052840 0.042390 0.052840 0.052840 
  Running ‘badcal.R’
  Comparing ‘badcal.Rout’ to ‘badcal.Rout.save’ ... OK
  Running ‘bycovmat.R’
  Comparing ‘bycovmat.Rout’ to ‘bycovmat.Rout.save’ ... OK
  Running ‘caleg.R’
  Comparing ‘caleg.Rout’ to ‘caleg.Rout.save’ ... OK
  Running ‘check.R’
  Comparing ‘check.Rout’ to ‘check.Rout.save’ ... OK
  Running ‘deff.R’
  Comparing ‘deff.Rout’ to ‘deff.Rout.save’ ... OK
  Running ‘domain.R’
  Comparing ‘domain.Rout’ to ‘domain.Rout.save’ ... OK
  Running ‘fpc.R’
  Comparing ‘fpc.Rout’ to ‘fpc.Rout.save’ ... OK
  Running ‘kalton.R’
  Comparing ‘kalton.Rout’ to ‘kalton.Rout.save’ ... OK
  Running ‘lonely.psu.R’
  Comparing ‘lonely.psu.Rout’ to ‘lonely.psu.Rout.save’ ... OK
  Running ‘multistage.R’
  Comparing ‘multistage.Rout’ to ‘multistage.Rout.save’ ... OK
  Running ‘nwts-cch.R’
  Comparing ‘nwts-cch.Rout’ to ‘nwts-cch.Rout.save’ ... OK
  Running ‘nwts.R’
  Comparing ‘nwts.Rout’ to ‘nwts.Rout.save’ ... OK
  Running ‘pps.R’
  Comparing ‘pps.Rout’ to ‘pps.Rout.save’ ... OK
  Running ‘quantile.R’
  Comparing ‘quantile.Rout’ to ‘quantile.Rout.save’ ... OK
  Running ‘rakecheck.R’
  Running ‘raowuboot.R’
  Comparing ‘raowuboot.Rout’ to ‘raowuboot.Rout.save’ ... OK
  Running ‘regpredict.R’
  Comparing ‘regpredict.Rout’ to ‘regpredict.Rout.save’ ... OK
  Running ‘scoping.R’
  Comparing ‘scoping.Rout’ to ‘scoping.Rout.save’ ... OK
  Running ‘survcurve.R’ [10s/12s]
  Comparing ‘survcurve.Rout’ to ‘survcurve.Rout.save’ ... OK
  Running ‘twophase.R’
  Comparing ‘twophase.Rout’ to ‘twophase.Rout.save’ ... OK
Running the tests in ‘tests/rakecheck.R’ failed.
Complete output:
  > 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)
  > rclus1 <- as.svrepdesign(dclus1)
  > 
  > ## 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))
  > 
  > rclus1r <- rake(rclus1, list(~stype,~sch.wide), list(pop.types, pop.schwide))
  > 
  > svymean(~api00, rclus1r)
          mean     SE
  api00 641.23 26.873
  > svytotal(~enroll, rclus1r)
           total     SE
  enroll 3647300 463511
  > 
  > ff<-~stype+sch.wide
  > poptotals<-colSums(model.matrix(ff,model.frame(ff,apipop)))
  > rclus1g<-calibrate(rclus1, ~stype+sch.wide, poptotals,calfun="raking")
  > 
  > svymean(~api00,rclus1g)
          mean     SE
  api00 641.23 26.874
  > svytotal(~enroll,rclus1g)
           total     SE
  enroll 3647280 463582
  > 
  > summary(weights(rclus1g)/weights(rclus1r))
         V1           V2          V3          V4           V5          V6   
   Min.   :1    Min.   :1   Min.   :1   Min.   :1    Min.   :1   Min.   :1  
   1st Qu.:1    1st Qu.:1   1st Qu.:1   1st Qu.:1    1st Qu.:1   1st Qu.:1  
   Median :1    Median :1   Median :1   Median :1    Median :1   Median :1  
   Mean   :1    Mean   :1   Mean   :1   Mean   :1    Mean   :1   Mean   :1  
   3rd Qu.:1    3rd Qu.:1   3rd Qu.:1   3rd Qu.:1    3rd Qu.:1   3rd Qu.:1  
   Max.   :1    Max.   :1   Max.   :1   Max.   :1    Max.   :1   Max.   :1  
   NA's   :11   NA's   :4   NA's   :2   NA's   :13   NA's   :2   NA's   :4  
         V7          V8           V9         V10          V11    
   Min.   :1   Min.   :1    Min.   :1   Min.   :1    Min.   :1   
   1st Qu.:1   1st Qu.:1    1st Qu.:1   1st Qu.:1    1st Qu.:1   
   Median :1   Median :1    Median :1   Median :1    Median :1   
   Mean   :1   Mean   :1    Mean   :1   Mean   :1    Mean   :1   
   3rd Qu.:1   3rd Qu.:1    3rd Qu.:1   3rd Qu.:1    3rd Qu.:1   
   Max.   :1   Max.   :1    Max.   :1   Max.   :1    Max.   :1   
   NA's   :4   NA's   :16   NA's   :9   NA's   :34   NA's   :21  
        V12              V13          V14         V15    
   Min.   :0.9997   Min.   :1    Min.   :1   Min.   :1   
   1st Qu.:1.0001   1st Qu.:1    1st Qu.:1   1st Qu.:1   
   Median :1.0001   Median :1    Median :1   Median :1   
   Mean   :1.0000   Mean   :1    Mean   :1   Mean   :1   
   3rd Qu.:1.0001   3rd Qu.:1    3rd Qu.:1   3rd Qu.:1   
   Max.   :1.0002   Max.   :1    Max.   :1   Max.   :1   
   NA's   :37       NA's   :13   NA's   :1   NA's   :12  
  > 
  > 
  > ## Do it for a design without replicate weights
  > dclus1r<-rake(dclus1, list(~stype,~sch.wide), list(pop.types, pop.schwide))
  > 
  > svymean(~api00, dclus1r)
          mean     SE
  api00 641.23 23.704
  > svytotal(~enroll, dclus1r)
           total     SE
  enroll 3647300 400603
  > 
  > dclus1g<-calibrate(dclus1, ~stype+sch.wide, poptotals,calfun="raking")
  > 
  > svymean(~api00,dclus1g)
          mean     SE
  api00 641.23 23.704
  > svytotal(~enroll,dclus1g)
           total     SE
  enroll 3647280 400603
  > 
  > summary(weights(dclus1g)/weights(dclus1r))
     Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
        1       1       1       1       1       1 
  > 
  > 
  > 
  > ## Example of raking with partial joint distributions
  > pop.table <- xtabs(~stype+sch.wide,apipop)
  > pop.imp<-data.frame(comp.imp=c("No","Yes"),Freq=c(1712,4482))
  > dclus1r2<-rake(dclus1, list(~stype+sch.wide, ~comp.imp),
  +                list(pop.table, pop.imp))
  Error in if (delta < epsilon) { : missing value where TRUE/FALSE needed
  Calls: rake
  Execution halted