Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why need svyplot, svyhist, svyboxplot? #29

Closed
greimel opened this issue Aug 3, 2022 · 1 comment
Closed

Why need svyplot, svyhist, svyboxplot? #29

greimel opened this issue Aug 3, 2022 · 1 comment

Comments

@greimel
Copy link
Contributor

greimel commented Aug 3, 2022

Is there a reason to depend on a plotting package?

Is there a value added compared to using one directly?

(; apistrat) = dataset(api) # see issue #27 on renaming `data` to `dataset`

dstrat = svydesign(data = apistrat, id = :1, strata = :stype, weights = :pw, fpc = :fpc);

using AlgebraOfGraphics
data(dstrat.variables) * mapping(:api99, :api00, markersize = :pw) |> draw
data(dstrat.variables) * mapping(:enroll, weights = :pw) * visual(Hist) |> draw
data(dstrat.variables) * mapping(:stype, :enroll; weights = :pw) * visual(BoxPlot) |> draw

Then you don't need to define all kinds of plotting functions here, but you encourage the user to use the full power of Makie/AlgebraOfGraphics or StatsPlots.jl/Plots.jl.

To simplify the life of users, you could of course find a way to do
data(dstrat) * mapping(...) in AoG or @df dstrat plot(...) in StatsPlots (without the .variables). Probably it would be enough to define getproperty on a survey design.

@ayushpatnaikgit
Copy link
Member

Thanks, @greimel
Your question goes back to why we are making the package. It's not just about these 3 functions. We want to offer all the functionality of the survey package in R. This is because myself, people in my office, and people in my community use the survey package, and would like to switch to Julia for performance. While users can figure out the commands that you have mentioned, it would be of no harm to export these. It will make the transition smoother.

Finally, implementing these functions are like picking low-hanging fruits. Students who are implementing these gain knowledge about the surveys, weights, the package, GitHub and also gain confidence. You can consider these to be training exercises.
Later on, we can remove these functions if there is a strong reason.

Once we reach the R package, we will focus on surpassing it. We will encourage the full power of the cutting-edge packages in Julia such as Turing, Makie, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants