-
Notifications
You must be signed in to change notification settings - Fork 19
Description
It's really great that you aim to replicate features provided by the R survey package as it's really the reference in that domain. However, its API is quite ad hoc and forces users to learn a completely new syntax when moving from unweighted to weighted/survey analyses. Have you considered adopting a syntax based on DataFrames group_by and combine/select/transform? In R, the recent srvyr package does that by wrapping survey functions with a dplyr-like syntax.
In particular, svyby(:api00, [:cname, :meals], dclus1, svymean) could be written as combine(groupby(dclus1, [:cname, :meals]), :api00 => svymean). With DataFramesMeta, this could become @combine(groupby(dclus1, [:cname, :meals]), svymean(:api00)). One would also be able to compute the mean of all columns using combine(dclus1, All() .=> svymean).
In terms of implementation I saw that you already use combine under the hood so it shouldn't be problematic.
Cc: @bkamins