There is no problem when only BY two variables, eg:
"graph bar (mean) antal_pr_maaned_kilde_aarsag, over(maaned) over(aar) blabel(bar) ytitle(Numbers pr month) by(, title(numbers pr month by two factors, size(medlarge))) xsize(10) ysize(18) by(prim_aarsag henvisningskilde , rows(8)) ylabel(,angle(0))"
But when running BY three variables it dosen´t work:
"graph bar (mean) antalprmd_paragraf_kilde_prim, over(maaned) over(aar) blabel(bar, size(tiny)) ytitle(Numbers pr month) by(, title(Number pr month by three factors, size(medlarge))) xsize(10) ysize(18) by(henvisningskilde prim_aarsag paragraf, rows(10)) ylabel(,angle(0))"
------
q1) Does anyone know how to make the command work?
q2) And if so - would it be possible to make Stata only produce bar charts that include some information? (since running BY three factors include a lot of combinations), alternatively would it be possible to split bar charts into two figures?
q3) And would it be possible to make sure all months (x-axis always 1-12) are included?
------
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input str29 henvisningskilde str17 paragraf str37 prim_aarsag float antal_pr_maaned int aar byte maaned float(antal_pr_maaned_kilde_aarsag antalprmd_paragraf_kilde_prim) "egen_L" "118" "KO" 21 2019 2 4 3 "egen_L" "118" "KO" 44 2019 3 6 6 "egen_L" "118" "kr" 56 2018 11 7 2 "egen_L" "118" "KO" 77 2019 1 5 2 "egen_L" "118" "Dia" 89 2018 11 3 4 "selv" "118" "KO" 23 2018 11 2 3 "hosp" "118" "kr" 15 2019 8 6 1 "hosp" "118" "kr" 67 2019 3 8 5 "hosp" "141" "bryk" 54 2019 2 5 7 "egen_L" "118" "ow" 65 2019 5 8 5 "selv" "118" "ow" 85 2019 6 9 2 "egen_L" "118" "KO" 23 2019 7 2 4 "hosp" "141" "kr" 44 2019 4 12 10 "hosp" "118" "cvd" 56 2019 5 20 12 "hosp" "118" "cvd" 77 2019 5 2 11 "selv" "118" "roeg" 98 2019 8 3 43 "egen_L" "118" "kr" 45 2018 11 2 1 "egen_L" "118" "Dia" 75 2019 6 1 3 "hosp" "118" "cvd" 34 2019 5 2 1 "hosp" "118" "roeg" 54 2018 11 1 14 "hosp" "141" "bryk" 65 2019 8 4 4 "hosp" "118" "kr" 23 2019 5 6 1 "egen_L" "118" "bryk" 67 2019 3 2 2 "hosp" "141" "kr" 24 2019 6 10 12 "hosp" "118" "KO" 88 2019 6 3 2 end
Lars
0 Response to Bar charts, multiple using both over and by
Post a Comment