Skip to content

Julian design for the package #40

@ayushpatnaikgit

Description

@ayushpatnaikgit

At first, we should make the package work for simple random samples and then extend the functionality to other design types. The current design of the package doesn't allow development to be done in that way.

How about:

abstract type SurveyDesign end
struct SimpleRandomSample <: SurveyDesign
       data::DataFrame
end
struct StratifiedSample <: SurveyDesign
       data::DataFrame
end
function plot(x::SurveyDesign)
plot(x.data)
# works on any child of SurveyDesign
end
function mean(variable, x::SimpleRandomSample)
# computes the mean of a variable from a simple random sample
end

Later, we can add:

function mean(variable, x::StratifiedSample)
# computes the mean of a variable from a stratified sample. 
end

There is pristine clarity on which functions work on which design types.
If we want to keep the API similar to R, we should consider wrappers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions