Skip to content

Commit

Permalink
Add tests for get_strata function
Browse files Browse the repository at this point in the history
  • Loading branch information
iuliadmtru committed Jul 13, 2022
1 parent 376e7a2 commit 8b26627
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ using Test
@test size(apiclus1) == (183, 40)
@test size(apiclus2) == (126, 41)
@test size(apipop) == ((6194, 38))
dclus1 = svydesign(id=:1, weights=:pw, data = apiclus1, fpc=:fpc)
dclus1 = svydesign(id=:1, strata=:stype, weights=:pw, data = apiclus1, fpc=:fpc)
@test dclus1.variables.strata[1] == "H"
@test length(dclus1.variables.probs) == 183
@test dclus1.id == 1
api00_by_cname = svyby(:api00, :cname, dclus1, svymean).mean
@test api00_by_cname [669.0000000000001, 472.00000000000006, 452.5, 647.2666666666668, 623.25, 519.25, 710.5625000000001, 709.5555555555557, 659.4363636363635, 551.1891891891892, 732.0769230769226]
api00_by_cname_meals = svyby(:api00, [:cname, :meals], dclus1, svymean)
@test api00_by_cname_meals[1,3] 608.0
@test api00_by_cname_meals[1,3] 608.0
end

include("svyglm.jl")

0 comments on commit 8b26627

Please sign in to comment.