Skip to content

Commit

Permalink
artifacts for la
Browse files Browse the repository at this point in the history
  • Loading branch information
grahamstark committed Nov 15, 2024
1 parent 8e05640 commit b20804e
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 17 deletions.
8 changes: 8 additions & 0 deletions Artifacts.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@ lazy = true
sha256 = "c426f605704bde8c79df3573a4f150512614480aa00f900893accaf75408463c"
url = "https://virtual-worlds.biz/artifacts//exampledata.tar.gz"

[legalaid]
git-tree-sha1 = "3518935453a2ed48612f94a4f7ef8fe77f56aace"
lazy = true

[[legalaid.download]]
sha256 = "fb9a643138fea7669fceda20ef9b4f65b2646d2e8c27d4a0ecbb7306908cb3a9"
url = "https://virtual-worlds.biz/artifacts//legalaid.tar.gz"

[scottish-frs-data]
git-tree-sha1 = "9c5c1e8a29e8f82d861100579cee3e3e49cae464"
lazy = true
Expand Down
79 changes: 62 additions & 17 deletions src/LegalAidData.jl
Original file line number Diff line number Diff line change
Expand Up @@ -255,23 +255,68 @@ function load_costs( filename::String )::DataFrame
cost
end

const CIVIL_COSTS = load_costs( joinpath(MODEL_DATA_DIR, "legalaid", "civil-legal-aid-case-costs.tab" ))
const AA_COSTS = load_aa_costs( joinpath(MODEL_DATA_DIR, "legalaid", "aa-case-costs.tab" ))
const CIVIL_AWARDS = load_awards( joinpath(MODEL_DATA_DIR, "legalaid", "civil-applications.tab" ))
const CIVIL_AWARDS_GRP_NS = groupby(CIVIL_AWARDS, [:hsm, :age2, :sex])
const CIVIL_AWARDS_GRP1 = groupby(CIVIL_AWARDS, [:hsm])
const CIVIL_AWARDS_GRP2 = groupby(CIVIL_AWARDS, [:hsm, :la_status])
const CIVIL_AWARDS_GRP3 = groupby(CIVIL_AWARDS, [:hsm, :la_status, :sex])
const CIVIL_AWARDS_GRP4 = groupby(CIVIL_AWARDS, [:hsm, :la_status,:age2, :sex])
const CIVIL_COSTS_GRP_NS = groupby(CIVIL_COSTS, [:hsm, :age2, :sex])

const CIVIL_COSTS_GRP1 = groupby(CIVIL_COSTS, [:hsm_censored])
const AA_COSTS_GRP1 = groupby(AA_COSTS, [:hsm_censored])

const CIVIL_COSTS_GRP2 = groupby(CIVIL_COSTS, [:hsm, :la_status])
const CIVIL_COSTS_GRP3 = groupby(CIVIL_COSTS, [:hsm, :la_status, :sex])
const CIVIL_COSTS_GRP4 = groupby(CIVIL_COSTS, [:hsm, :la_status, :age2, :sex])
const CIVIL_SUBJECTS = sort(levels( CIVIL_AWARDS.hsm ))
CIVIL_COSTS = DataFrame()
AA_COSTS = DataFrame()
CIVIL_AWARDS = DataFrame()

CIVIL_AWARDS_GRP_NS = DataFrame()
CIVIL_AWARDS_GRP1 = DataFrame()
CIVIL_AWARDS_GRP2 = DataFrame()
CIVIL_AWARDS_GRP3 = DataFrame()
CIVIL_AWARDS_GRP4 = DataFrame()
CIVIL_COSTS_GRP_NS = DataFrame()

CIVIL_COSTS_GRP1 = DataFrame()
AA_COSTS_GRP1 = DataFrame()

CIVIL_COSTS_GRP2 = DataFrame()
CIVIL_COSTS_GRP3 = DataFrame()
CIVIL_COSTS_GRP4 = DataFrame()
CIVIL_SUBJECTS = DataFrame()


function init()

CIVIL_COSTS = DataFrame()
AA_COSTS = DataFrame()
CIVIL_AWARDS = DataFrame()

CIVIL_AWARDS_GRP_NS = DataFrame()
CIVIL_AWARDS_GRP1 = DataFrame()
CIVIL_AWARDS_GRP2 = DataFrame()
CIVIL_AWARDS_GRP3 = DataFrame()
CIVIL_AWARDS_GRP4 = DataFrame()
CIVIL_COSTS_GRP_NS = DataFrame()

CIVIL_COSTS_GRP1 = DataFrame()
AA_COSTS_GRP1 = DataFrame()

CIVIL_COSTS_GRP2 = DataFrame()
CIVIL_COSTS_GRP3 = DataFrame()
CIVIL_COSTS_GRP4 = DataFrame()
CIVIL_SUBJECTS = DataFrame()


CIVIL_COSTS = load_costs( joinpath(artifact"legalaid", "civil-legal-aid-case-costs.tab" ))
AA_COSTS = load_aa_costs( joinpath( artifact"legalaid", "aa-case-costs.tab" ))
CIVIL_AWARDS = load_awards( joinpath( artifact"legalaid", "civil-applications.tab" ))

CIVIL_AWARDS_GRP_NS = groupby(CIVIL_AWARDS, [:hsm, :age2, :sex])
CIVIL_AWARDS_GRP1 = groupby(CIVIL_AWARDS, [:hsm])
CIVIL_AWARDS_GRP2 = groupby(CIVIL_AWARDS, [:hsm, :la_status])
CIVIL_AWARDS_GRP3 = groupby(CIVIL_AWARDS, [:hsm, :la_status, :sex])
CIVIL_AWARDS_GRP4 = groupby(CIVIL_AWARDS, [:hsm, :la_status,:age2, :sex])
CIVIL_COSTS_GRP_NS = groupby(CIVIL_COSTS, [:hsm, :age2, :sex])

CIVIL_COSTS_GRP1 = groupby(CIVIL_COSTS, [:hsm_censored])
AA_COSTS_GRP1 = groupby(AA_COSTS, [:hsm_censored])

CIVIL_COSTS_GRP2 = groupby(CIVIL_COSTS, [:hsm, :la_status])
CIVIL_COSTS_GRP3 = groupby(CIVIL_COSTS, [:hsm, :la_status, :sex])
CIVIL_COSTS_GRP4 = groupby(CIVIL_COSTS, [:hsm, :la_status, :age2, :sex])
CIVIL_SUBJECTS = sort(levels( CIVIL_AWARDS.hsm ))
end

#=
psa = groupby(awards, [:hsm,:age_banded,:consolidatedsex])
k=(hsm = "Discrimination", age_banded = "5 - 9", consolidatedsex = "Male")
Expand Down

0 comments on commit b20804e

Please sign in to comment.