library(haven)
library(dplyr)
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
setwd("C:/Users/Amra/Documents/HBS database inspecting")
HBS_2015_HH_short <- read_sav("~/HBS database inspecting/HBS_2015_HH - short.sav")

01 OZNACAVA DA SE RADI O PRVOM CLANU DOMACINSTVA KOJI JE PRIMAO ZARADE
Ovdje pita prvog clana da li ste prmili i jedan od slijedecih incoma

hbs_short <- HBS_2015_HH_short
hbs_short$Q02_YN_01_S12[[2]]
## <labelled<double>[1]>: Have you received any of the following incomes in the last 12 months, yes or no?
## [1] 1
## 
## Labels:
##  value   label
##      1      da
##      2      ne
##      8 Refusal
summary(hbs_short$Q02_YN_01_S12)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##   1.000   1.000   1.000   1.481   2.000   2.000      77
prop.table(table(hbs_short$Q02_YN_01_S12))*100
## 
##       1       2 
## 51.9082 48.0918

52% je primilo neku od naknada a 77 ima Naova…

QA01_YN_01_S12

hbs_short$QA01_YN_01_S12 [[2]]
## <labelled<double>[1]>: Did you receive salary of employees working for a local employer in the last 12 months?
## [1] 2
## 
## Labels:
##  value      label
##      1         da
##      2         ne
##      8    Refusal
##      9 Don't Know
str(hbs_short$QA01_YN_01_S12)
##  dbl+lbl [1:7702] NA,  2, NA,  2,  2,  2, NA,  2, NA, NA, NA,  1, NA,  2,  ...
##  @ label        : chr "Did you receive salary of employees working for a local employer in the last 12 months?"
##  @ format.spss  : chr "F1.0"
##  @ display_width: int 16
##  @ labels       : Named num [1:4] 1 2 8 9
##   ..- attr(*, "names")= chr [1:4] "da" "ne" "Refusal" "Don't Know"
summary(hbs_short$QA01_YN_01_S12)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##   1.000   1.000   1.000   1.411   2.000   2.000    4125
prop.table(table(hbs_short$QA01_YN_01_S12))
## 
##         1         2 
## 0.5887615 0.4112385

To znaci da od 7,702 domacinstava za 4125, nema podataka a od ovih koji su odgovorili samo 58.9% je reklo da je primilo platu od lokalnog poslodavca. Pitanje se odnosi na prvog clana familije

QA02_YN_01_S12

hbs_short$QA02_YN_01_S12 [[2]]
## <labelled<double>[1]>: Did you receive salary of employees working for a foreign employer in BiH in the last 12 months?
## [1] 2
## 
## Labels:
##  value      label
##      1         da
##      2         ne
##      8    Refusal
##      9 Don't Know
str(hbs_short$QA02_YN_01_S12)
##  dbl+lbl [1:7702] NA,  2, NA,  2,  2,  2, NA,  2, NA, NA, NA,  2, NA,  2,  ...
##  @ label        : chr "Did you receive salary of employees working for a foreign employer in BiH in the last 12 months?"
##  @ format.spss  : chr "F1.0"
##  @ display_width: int 16
##  @ labels       : Named num [1:4] 1 2 8 9
##   ..- attr(*, "names")= chr [1:4] "da" "ne" "Refusal" "Don't Know"
summary(hbs_short$QA02_YN_01_S12)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##   1.000   2.000   2.000   1.988   2.000   2.000    4533
prop.table(table(hbs_short$QA02_YN_01_S12))
## 
##          1          2 
## 0.01230672 0.98769328

Od 7702 domacinstava samo na ovo pitanje Da li ste primili platu od poslodavca koji ima sjediste van BiH u zadnjih 12 mjeseci? 4533 nije nista odgovorilo a ovi koji su odgovorili samo su 12.3% su rekli da jesu.

QA03_YN_01_S12 “Did you receive cash (a salary) for work done abroad in the last 12 months?

hbs_short$QA03_YN_01_S12 [[2]]
## <labelled<double>[1]>: Did you receive cash (a salary) for work done abroad in the last 12 months?
## [1] 2
## 
## Labels:
##  value      label
##      1         da
##      2         ne
##      8    Refusal
##      9 Don't Know
str(hbs_short$QA03_YN_01_S12)
##  dbl+lbl [1:7702] NA,  2, NA,  2,  2,  2, NA,  2, NA, NA, NA,  2, NA,  2,  ...
##  @ label        : chr "Did you receive cash (a salary) for work done abroad in the last 12 months?"
##  @ format.spss  : chr "F1.0"
##  @ display_width: int 16
##  @ labels       : Named num [1:4] 1 2 8 9
##   ..- attr(*, "names")= chr [1:4] "da" "ne" "Refusal" "Don't Know"
summary(hbs_short$QA03_YN_01_S12)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##   1.000   2.000   2.000   1.963   2.000   2.000    4527
prop.table(table(hbs_short$QA03_YN_01_S12))
## 
##          1          2 
## 0.03748031 0.96251969

Na ovo pitanje 4527 nije dalo niakka odgovor a od ovih koji jesu samo 3,7% je odgovorilo da su dobili platu za rad u inostranstvu

QA04_YN_01_S12
Did you receive fee for work done by you for a local employer based on a contract for services rendered, author”

hbs_short$QA04_YN_01_S12 [[2]]
## <labelled<double>[1]>: Did you receive fee for work done by you for a local employer based on a contract for services rendered, author-ship contract and occasional and temporary jobs or agreementsin the last 12 months?
## [1] 2
## 
## Labels:
##  value      label
##      1         da
##      2         ne
##      8    Refusal
##      9 Don't Know
str(hbs_short$QA04_YN_01_S12)
##  dbl+lbl [1:7702] NA,  2, NA,  2,  2,  2, NA,  2, NA, NA, NA,  2, NA,  2,  ...
##  @ label        : chr "Did you receive fee for work done by you for a local employer based on a contract for services rendered, author"| __truncated__
##  @ format.spss  : chr "F1.0"
##  @ display_width: int 16
##  @ labels       : Named num [1:4] 1 2 8 9
##   ..- attr(*, "names")= chr [1:4] "da" "ne" "Refusal" "Don't Know"
summary(hbs_short$QA04_YN_01_S12)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##    1.00    2.00    2.00    1.94    2.00    2.00    4516
prop.table(table(hbs_short$QA04_YN_01_S12))
## 
##          1          2 
## 0.05963591 0.94036409

Od ukupnog broja 4516 nije odgovorilo na ovo pitanja, a ovi koji su odgovorili samo 6% je odgovorilo da su primili.

QA05_YN_01_S12
Did you receive Fee for work done by you for a foreign employer in BiH based on a contract for services rendere

hbs_short$QA05_YN_01_S12 [[2]]
## <labelled<double>[1]>: Did you receive Fee for work done by you for a foreign employer in BiH based on a contract for services rendered, authorship contract and occasional and temporary jobs or agreements with a local employer in the last 12 months?
## [1] 2
## 
## Labels:
##  value      label
##      1         da
##      2         ne
##      8    Refusal
##      9 Don't Know
str(hbs_short$QA05_YN_01_S12)
##  dbl+lbl [1:7702] NA,  2, NA,  2,  2,  2, NA,  2, NA, NA, NA,  2, NA,  2,  ...
##  @ label        : chr "Did you receive Fee for work done by you for a foreign employer in BiH based on a contract for services rendere"| __truncated__
##  @ format.spss  : chr "F1.0"
##  @ display_width: int 16
##  @ labels       : Named num [1:4] 1 2 8 9
##   ..- attr(*, "names")= chr [1:4] "da" "ne" "Refusal" "Don't Know"
summary(hbs_short$QA05_YN_01_S12)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##   1.000   2.000   2.000   1.995   2.000   2.000    4538
prop.table(table(hbs_short$QA05_YN_01_S12))*100
## 
##          1          2 
##  0.4740834 99.5259166

Od 7702 4538 nije odgovorilo, a ovi sto su odgovorili samo 0.05% je reklo da jeste.

QA06_YN_01_S12 Did you receive fee for work done by you for an employer abroad BiH based on a contract for services rendered, au-thorship contract and occasional and temporary jobs or agreements with a local employer in the last 12 months?

hbs_short$QA06_YN_01_S12 [[2]]
## <labelled<double>[1]>: Did you receive fee for work done by you for an employer abroad BiH based on a contract for services rendered, au-thorship contract and occasional and temporary jobs or agreements with a local employer in the last 12 months?
## [1] 2
## 
## Labels:
##  value      label
##      1         da
##      2         ne
##      8    Refusal
##      9 Don't Know
str(hbs_short$QA06_YN_01_S12)
##  dbl+lbl [1:7702] NA,  2, NA,  2,  2,  2, NA,  2, NA, NA, NA,  2, NA,  2,  ...
##  @ label        : chr "Did you receive fee for work done by you for an employer abroad BiH based on a contract for services rendered, "| __truncated__
##  @ format.spss  : chr "F1.0"
##  @ display_width: int 16
##  @ labels       : Named num [1:4] 1 2 8 9
##   ..- attr(*, "names")= chr [1:4] "da" "ne" "Refusal" "Don't Know"
summary(hbs_short$QA06_YN_01_S12)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##   1.000   2.000   2.000   1.994   2.000   2.000    4537
prop.table(table(hbs_short$QA06_YN_01_S12))
## 
##           1           2 
## 0.005687204 0.994312796

Samo je 6% odgovirilo da jesu a opet oko 4537 je NA

QA07_YN_01_S12 Did you receive meal allowance (excludes coupons and meals) in the last 12 months?

hbs_short$QA07_YN_01_S12 [[2]]
## <labelled<double>[1]>: Did you receive meal allowance (excludes coupons and meals) in the last 12 months?
## [1] 2
## 
## Labels:
##  value      label
##      1         da
##      2         ne
##      8    Refusal
##      9 Don't Know
str(hbs_short$QA07_YN_01_S12)
##  dbl+lbl [1:7702] NA,  2, NA,  2,  2,  2, NA,  2, NA, NA, NA,  1, NA,  2,  ...
##  @ label        : chr "Did you receive meal allowance (excludes coupons and meals) in the last 12 months?"
##  @ format.spss  : chr "F1.0"
##  @ display_width: int 16
##  @ labels       : Named num [1:4] 1 2 8 9
##   ..- attr(*, "names")= chr [1:4] "da" "ne" "Refusal" "Don't Know"
summary(hbs_short$QA07_YN_01_S12)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##   1.000   1.000   2.000   1.742   2.000   2.000    4496
prop.table(table(hbs_short$QA07_YN_01_S12))
## 
##         1         2 
## 0.2582658 0.7417342

4496 nije odgovorilo, 25,8% je primilo topli obrok

QA08_YN_01_S12

hbs_short$QA08_YN_01_S12 [[2]]
## <labelled<double>[1]>: Did you receive transport allowance to and from work (excludes coupons)  in the last 12 months?
## [1] 2
## 
## Labels:
##  value      label
##      1         da
##      2         ne
##      8    Refusal
##      9 Don't Know
str(hbs_short$QA08_YN_01_S12)
##  dbl+lbl [1:7702] NA,  2, NA,  2,  2,  2, NA,  2, NA, NA, NA,  2, NA,  2,  ...
##  @ label        : chr "Did you receive transport allowance to and from work (excludes coupons)  in the last 12 months?"
##  @ format.spss  : chr "F1.0"
##  @ display_width: int 17
##  @ labels       : Named num [1:4] 1 2 8 9
##   ..- attr(*, "names")= chr [1:4] "da" "ne" "Refusal" "Don't Know"
summary(hbs_short$QA08_YN_01_S12)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##    1.00    2.00    2.00    1.91    2.00    2.00    4530
prop.table(table(hbs_short$QA08_YN_01_S12))
## 
##          1          2 
## 0.09047919 0.90952081

od ovih koji su odgovorili 9% ih je primilo putne troskove.

QA09_YN_01_S12

hbs_short$QA09_YN_01_S12 [[2]]
## <labelled<double>[1]>: Did you receive allowance for living in other town in the last 12 months?
## [1] 2
## 
## Labels:
##  value      label
##      1         da
##      2         ne
##      8    Refusal
##      9 Don't Know
str(hbs_short$QA09_YN_01_S12)
##  dbl+lbl [1:7702] NA,  2, NA,  2,  2,  2, NA,  2, NA, NA, NA,  2, NA,  2,  ...
##  @ label        : chr "Did you receive allowance for living in other town in the last 12 months?"
##  @ format.spss  : chr "F1.0"
##  @ display_width: int 17
##  @ labels       : Named num [1:4] 1 2 8 9
##   ..- attr(*, "names")= chr [1:4] "da" "ne" "Refusal" "Don't Know"
summary(hbs_short$QA09_YN_01_S12)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##   1.000   2.000   2.000   1.997   2.000   2.000    4542
prop.table(table(hbs_short$QA09_YN_01_S12))
## 
##           1           2 
## 0.002531646 0.997468354

Od onih koji su odgovorili samo je 0.25% odgovorilo da su prmili nakandnu ya zivto u drugom gradu.

QA10_YN_01_S12

hbs_short$QA10_YN_01_S12 [[2]]
## <labelled<double>[1]>: Did you receive fees for management/supervisory board mem-bers in the last 12 months?
## [1] 2
## 
## Labels:
##  value      label
##      1         da
##      2         ne
##      8    Refusal
##      9 Don't Know
str(hbs_short$QA10_YN_01_S12)
##  dbl+lbl [1:7702] NA,  2, NA,  2,  2,  2, NA,  2, NA, NA, NA,  2, NA,  2,  ...
##  @ label        : chr "Did you receive fees for management/supervisory board mem-bers in the last 12 months?"
##  @ format.spss  : chr "F1.0"
##  @ display_width: int 17
##  @ labels       : Named num [1:4] 1 2 8 9
##   ..- attr(*, "names")= chr [1:4] "da" "ne" "Refusal" "Don't Know"
summary(hbs_short$QA10_YN_01_S12)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##   1.000   2.000   2.000   1.999   2.000   2.000    4543
prop.table(table(hbs_short$QA10_YN_01_S12))*100
## 
##           1           2 
##  0.09496676 99.90503324

0.09% je primalo naknadu za odvojen zivot.

QA11_YN_01_S12 Did you receive other cash income from employment in the last 12 months?

hbs_short$QA11_YN_01_S12 [[2]]
## <labelled<double>[1]>: Did you receive other cash income from employment in the last 12 months?
## [1] 2
## 
## Labels:
##  value      label
##      1         da
##      2         ne
##      8    Refusal
##      9 Don't Know
str(hbs_short$QA11_YN_01_S12)
##  dbl+lbl [1:7702] NA,  2, NA,  2,  2,  2, NA,  2, NA, NA, NA,  2, NA,  2,  ...
##  @ label        : chr "Did you receive other cash income from employment in the last 12 months?"
##  @ format.spss  : chr "F1.0"
##  @ display_width: int 17
##  @ labels       : Named num [1:4] 1 2 8 9
##   ..- attr(*, "names")= chr [1:4] "da" "ne" "Refusal" "Don't Know"
summary(hbs_short$QA11_YN_01_S12)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##   1.000   2.000   2.000   1.926   2.000   2.000    4540
prop.table(table(hbs_short$QA11_YN_01_S12))*100
## 
##         1         2 
##  7.432005 92.567995

7,4% je primilo drugu naknadnu od zaposlenosti.

QA12_YN_01_S12 Did you receive in-kind income from employment in the last 12 months?

hbs_short$QA12_YN_01_S12 [[2]]
## <labelled<double>[1]>: Did you receive in-kind income from employment  in the last 12 months?
## [1] 2
## 
## Labels:
##  value      label
##      1         da
##      2         ne
##      8    Refusal
##      9 Don't Know
str(hbs_short$QA12_YN_01_S12)
##  dbl+lbl [1:7702] NA,  2, NA,  2,  2,  2, NA,  2, NA, NA, NA,  2, NA,  2,  ...
##  @ label        : chr "Did you receive in-kind income from employment  in the last 12 months?"
##  @ format.spss  : chr "F1.0"
##  @ display_width: int 17
##  @ labels       : Named num [1:4] 1 2 8 9
##   ..- attr(*, "names")= chr [1:4] "da" "ne" "Refusal" "Don't Know"
summary(hbs_short$QA12_YN_01_S12)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##   1.000   2.000   2.000   1.989   2.000   2.000    4540
prop.table(table(hbs_short$QA12_YN_01_S12))*100
## 
##        1        2 
##  1.13852 98.86148

4,540 je NA a 1.1% je primilo ovu nakandu

QA14_YN_01_S12 Did you receive earnings for work done on your own agricultural holding/s in the last 12 months?

hbs_short$QA14_YN_01_S12 [[2]]
## <labelled<double>[1]>: Did you receive earnings for work done on your own agricultural holding/s in the last 12 months?
## [1] 2
## 
## Labels:
##  value      label
##      1         da
##      2         ne
##      8    Refusal
##      9 Don't Know
str(hbs_short$QA14_YN_01_S12)
##  dbl+lbl [1:7702] NA,  2, NA,  2,  1,  2, NA,  2, NA, NA, NA,  2, NA,  1,  ...
##  @ label        : chr "Did you receive earnings for work done on your own agricultural holding/s in the last 12 months?"
##  @ format.spss  : chr "F1.0"
##  @ display_width: int 17
##  @ labels       : Named num [1:4] 1 2 8 9
##   ..- attr(*, "names")= chr [1:4] "da" "ne" "Refusal" "Don't Know"
summary(hbs_short$QA14_YN_01_S12)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##   1.000   2.000   2.000   1.803   2.000   2.000    4364
prop.table(table(hbs_short$QA14_YN_01_S12))*100
## 
##       1       2 
## 19.7124 80.2876

19.7% je primalo nakandu za poljoprivredu

QA15_YN_01_S12 id you receive earnings for trade and free professions (lawyers, painters, singers, etc.) in the last 12 months?

hbs_short$QA15_YN_01_S12 [[2]]
## <labelled<double>[1]>: Did you receive earnings for trade and free professions (lawyers, painters, singers, etc.) in the last 12 months?
## [1] 2
## 
## Labels:
##  value      label
##      1         da
##      2         ne
##      8    Refusal
##      9 Don't Know
str(hbs_short$QA15_YN_01_S12)
##  dbl+lbl [1:7702] NA,  2, NA,  2,  2,  2, NA,  2, NA, NA, NA,  2, NA,  2,  ...
##  @ label        : chr "Did you receive earnings for trade and free professions (lawyers, painters, singers, etc.) in the last 12 months?"
##  @ format.spss  : chr "F1.0"
##  @ display_width: int 17
##  @ labels       : Named num [1:4] 1 2 8 9
##   ..- attr(*, "names")= chr [1:4] "da" "ne" "Refusal" "Don't Know"
summary(hbs_short$QA15_YN_01_S12)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##    1.00    2.00    2.00    1.94    2.00    2.00    4520
prop.table(table(hbs_short$QA15_YN_01_S12))*100
## 
##         1         2 
##  6.033941 93.966059

6% ih je primilo ovaj vid nakande

QA16_YN_01_S12 Did you receive income from interest, savings, dividends or profit from capital investment in the last 12 months?

hbs_short$QA16_YN_01_S12 [[2]]
## <labelled<double>[1]>: Did you receive income from interest, savings, dividends or profit from capital investment in the last 12 months?
## [1] 2
## 
## Labels:
##  value      label
##      1         da
##      2         ne
##      8    Refusal
##      9 Don't Know
str(hbs_short$QA16_YN_01_S12)
##  dbl+lbl [1:7702] NA,  2, NA,  2,  2,  2, NA,  2, NA, NA, NA,  2, NA,  2,  ...
##  @ label        : chr "Did you receive income from interest, savings, dividends or profit from capital investment in the last 12 months?"
##  @ format.spss  : chr "F1.0"
##  @ display_width: int 17
##  @ labels       : Named num [1:4] 1 2 8 9
##   ..- attr(*, "names")= chr [1:4] "da" "ne" "Refusal" "Don't Know"
summary(hbs_short$QA16_YN_01_S12)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##   1.000   2.000   2.000   1.999   2.000   2.000    4543
prop.table(table(hbs_short$QA16_YN_01_S12))*100
## 
##           1           2 
##  0.09496676 99.90503324

Kamate i dividnede samo 0.9% stanovnika.

QA17_YN_01_S12 Did you receive income from the rent of landin the last 12 months?

hbs_short$QA17_YN_01_S12 [[2]]
## <labelled<double>[1]>: Did you receive income from the rent of landin the last 12 months?
## [1] 2
## 
## Labels:
##  value      label
##      1         da
##      2         ne
##      8    Refusal
##      9 Don't Know
str(hbs_short$QA17_YN_01_S12)
##  dbl+lbl [1:7702] NA,  2, NA,  2,  2,  2, NA,  2, NA, NA, NA,  2, NA,  2,  ...
##  @ label        : chr "Did you receive income from the rent of landin the last 12 months?"
##  @ format.spss  : chr "F1.0"
##  @ display_width: int 17
##  @ labels       : Named num [1:4] 1 2 8 9
##   ..- attr(*, "names")= chr [1:4] "da" "ne" "Refusal" "Don't Know"
summary(hbs_short$QA17_YN_01_S12)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##   1.000   2.000   2.000   1.994   2.000   2.000    4536
prop.table(table(hbs_short$QA17_YN_01_S12))*100
## 
##          1          2 
##  0.6317119 99.3682881

0.63% su primili (od odgovorenih)

QA18_YN_01_S12 Did you receive income from the rent of residential premises in the last 12 months?

hbs_short$QA18_YN_01_S12 [[2]]
## <labelled<double>[1]>: Did you receive income from the rent of residential premises in the last 12 months?
## [1] 2
## 
## Labels:
##  value      label
##      1         da
##      2         ne
##      8    Refusal
##      9 Don't Know
str(hbs_short$QA18_YN_01_S12)
##  dbl+lbl [1:7702] NA,  2, NA,  2,  2,  2, NA,  2, NA, NA, NA,  2, NA,  2,  ...
##  @ label        : chr "Did you receive income from the rent of residential premises in the last 12 months?"
##  @ format.spss  : chr "F1.0"
##  @ display_width: int 17
##  @ labels       : Named num [1:4] 1 2 8 9
##   ..- attr(*, "names")= chr [1:4] "da" "ne" "Refusal" "Don't Know"
summary(hbs_short$QA18_YN_01_S12)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##   1.000   2.000   2.000   1.995   2.000   2.000    4543
prop.table(table(hbs_short$QA18_YN_01_S12))*100
## 
##          1          2 
##  0.5064894 99.4935106

Samo 0.5% Da

QA19_YN_01_S12 Did you receive income from the rent of business premises, gar-ages, etc. in the last 12 months?”

hbs_short$QA19_YN_01_S12 [[2]]
## <labelled<double>[1]>: Did you receive income from the rent of business premises, gar-ages, etc. in the last 12 months?
## [1] 2
## 
## Labels:
##  value      label
##      1         da
##      2         ne
##      8    Refusal
##      9 Don't Know
str(hbs_short$QA19_YN_01_S12)
##  dbl+lbl [1:7702] NA,  2, NA,  2,  2,  2, NA,  2, NA, NA, NA,  2, NA,  2,  ...
##  @ label        : chr "Did you receive income from the rent of business premises, gar-ages, etc. in the last 12 months?"
##  @ format.spss  : chr "F1.0"
##  @ display_width: int 17
##  @ labels       : Named num [1:4] 1 2 8 9
##   ..- attr(*, "names")= chr [1:4] "da" "ne" "Refusal" "Don't Know"
summary(hbs_short$QA19_YN_01_S12)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##   1.000   2.000   2.000   1.994   2.000   2.000    4542
prop.table(table(hbs_short$QA19_YN_01_S12))*100
## 
##          1          2 
##  0.5696203 99.4303797

Od odgovorenih, samo 0.57% je iydavalo posl.prostore garaze i slicno

QA20_YN_01_S12 Did you receive income from the rent of equipment, cattle, etc. in the last 12 months?

hbs_short$QA20_YN_01_S12 [[2]]
## <labelled<double>[1]>: Did you receive income from the rent of equipment, cattle, etc. in the last 12 months?
## [1] 2
## 
## Labels:
##  value      label
##      1         da
##      2         ne
##      8    Refusal
##      9 Don't Know
str(hbs_short$QA20_YN_01_S12)
##  dbl+lbl [1:7702] NA,  2, NA,  2,  2,  2, NA,  2, NA, NA, NA,  2, NA,  2,  ...
##  @ label        : chr "Did you receive income from the rent of equipment, cattle, etc. in the last 12 months?"
##  @ format.spss  : chr "F1.0"
##  @ display_width: int 17
##  @ labels       : Named num [1:4] 1 2 8 9
##   ..- attr(*, "names")= chr [1:4] "da" "ne" "Refusal" "Don't Know"
summary(hbs_short$QA20_YN_01_S12)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##   1.000   2.000   2.000   1.993   2.000   2.000    4539
prop.table(table(hbs_short$QA20_YN_01_S12))*100
## 
##          1          2 
##  0.6639267 99.3360733

0.66% od odgovorenih jesu.

QA21_YN_01_S12 - OVO VJEROVATNO NE JER NIJE OD POSLA NEGO NEKA DOYNAKA Did you receive money from other households or persons in BiH in the last 12 months?

hbs_short$QA21_YN_01_S12 [[2]]
## <labelled<double>[1]>: Did you receive money from other households or persons in BiH in the last 12 months?
## [1] 1
## 
## Labels:
##  value      label
##      1         da
##      2         ne
##      8    Refusal
##      9 Don't Know
str(hbs_short$QA21_YN_01_S12)
##  dbl+lbl [1:7702] NA,  1, NA,  2,  2,  1, NA,  2, NA, NA, NA,  2, NA,  2,  ...
##  @ label        : chr "Did you receive money from other households or persons in BiH in the last 12 months?"
##  @ format.spss  : chr "F1.0"
##  @ display_width: int 17
##  @ labels       : Named num [1:4] 1 2 8 9
##   ..- attr(*, "names")= chr [1:4] "da" "ne" "Refusal" "Don't Know"
summary(hbs_short$QA21_YN_01_S12)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##    1.00    2.00    2.00    1.94    2.00    2.00    4502
prop.table(table(hbs_short$QA21_YN_01_S12))*100
## 
##        1        2 
##  6.03125 93.96875

QA22_YN_01_S12 - OVO VJEROVATNO NE JER NIJE OD POSLA NEGO NEKA DOYNAKA Did you receive money from other households or persons abroad (remittances) in the last 12 months?

hbs_short$QA22_YN_01_S12 [[2]]
## <labelled<double>[1]>: Did you receive money from other households or persons abroad (remittances) in the last 12 months?
## [1] 2
## 
## Labels:
##  value      label
##      1         da
##      2         ne
##      8    Refusal
##      9 Don't Know
str(hbs_short$QA22_YN_01_S12)
##  dbl+lbl [1:7702] NA,  2, NA,  1,  2,  2, NA,  1, NA, NA, NA,  2, NA,  2,  ...
##  @ label        : chr "Did you receive money from other households or persons abroad (remittances) in the last 12 months?"
##  @ format.spss  : chr "F1.0"
##  @ display_width: int 17
##  @ labels       : Named num [1:4] 1 2 8 9
##   ..- attr(*, "names")= chr [1:4] "da" "ne" "Refusal" "Don't Know"
summary(hbs_short$QA22_YN_01_S12)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##   1.000   2.000   2.000   1.864   2.000   2.000    4465
prop.table(table(hbs_short$QA22_YN_01_S12))*100
## 
##        1        2 
## 13.56194 86.43806

13.5% jesu

QA23_YN_01_S12 - OVO VJEROVATNO NE JER NIJE OD POSLA NEGO NEKA DOYNAKA Did you receive money from other households or persons abroad (remittances) in the last 12 months?

hbs_short$QA23_YN_01_S12 [[2]]
## <labelled<double>[1]>: Did you receive salary of employees working for a local employer in the last 12 months?
## [1] 2
## 
## Labels:
##  value      label
##      1         da
##      2         ne
##      8    Refusal
##      9 Don't Know
str(hbs_short$QA23_YN_01_S12)
##  dbl+lbl [1:7702] NA,  2, NA,  2,  2,  2, NA,  2, NA, NA, NA,  2, NA,  2,  ...
##  @ label        : chr "Did you receive salary of employees working for a local employer in the last 12 months?"
##  @ format.spss  : chr "F1.0"
##  @ display_width: int 17
##  @ labels       : Named num [1:4] 1 2 8 9
##   ..- attr(*, "names")= chr [1:4] "da" "ne" "Refusal" "Don't Know"
summary(hbs_short$QA23_YN_01_S12)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##   1.000   2.000   2.000   1.951   2.000   2.000    4516
prop.table(table(hbs_short$QA23_YN_01_S12))*100
## 
##         1         2 
##  4.865035 95.134965

##SADA IDEMO NA DRUGOG CLANA DOMACINSTVA
02 QA01_YN_02_S12 Did you receive salary of employees working for a local employer in the last 12 months?

hbs_short$QA01_YN_02_S12 [[2]]
## <labelled<double>[1]>: Did you receive salary of employees working for a local employer in the last 12 months?
## [1] NA
## 
## Labels:
##  value      label
##      1         da
##      2         ne
##      8    Refusal
##      9 Don't Know
str(hbs_short$QA01_YN_02_S12)
##  dbl+lbl [1:7702] NA, NA, NA, NA, NA, NA, NA,  2, NA, NA, NA, NA,  1,  1,  ...
##  @ label        : chr "Did you receive salary of employees working for a local employer in the last 12 months?"
##  @ format.spss  : chr "F1.0"
##  @ display_width: int 17
##  @ labels       : Named num [1:4] 1 2 8 9
##   ..- attr(*, "names")= chr [1:4] "da" "ne" "Refusal" "Don't Know"
summary(hbs_short$QA01_YN_02_S12)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##   1.000   1.000   1.000   1.319   2.000   2.000    5790
prop.table(table(hbs_short$QA01_YN_02_S12))*100
## 
##        1        2 
## 68.14854 31.85146

To znaci da od 7702 domacinstava za 5790, nema podataka a od ovih koji su odgovorili samo 68.1% je reklo da je primilo platu od lokalnog poslodavca. Pitanje se odnosi na DRUGOG clana familije

QA02_YN_02_S12

hbs_short$QA02_YN_02_S12 [[2]]
## <labelled<double>[1]>: Did you receive salary of employees working for a foreign employer in BiH in the last 12 months?
## [1] NA
## 
## Labels:
##  value      label
##      1         da
##      2         ne
##      8    Refusal
##      9 Don't Know
str(hbs_short$QA02_YN_02_S12)
##  dbl+lbl [1:7702] NA, NA, NA, NA, NA, NA, NA,  2, NA, NA, NA, NA,  2,  2,  ...
##  @ label        : chr "Did you receive salary of employees working for a foreign employer in BiH in the last 12 months?"
##  @ format.spss  : chr "F1.0"
##  @ display_width: int 17
##  @ labels       : Named num [1:4] 1 2 8 9
##   ..- attr(*, "names")= chr [1:4] "da" "ne" "Refusal" "Don't Know"
summary(hbs_short$QA02_YN_02_S12)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##   1.000   2.000   2.000   1.986   2.000   2.000    6036
prop.table(table(hbs_short$QA02_YN_02_S12))*100
## 
##         1         2 
##  1.380552 98.619448

Od 7702 domacinstava samo na ovo pitanje Da li ste primili platu od poslodavca koji ima sjediste van BiH u zadnjih 12 mjeseci? 6036 nije nista odgovorilo a ovi koji su odgovorili samo su 1,4% su rekli da jesu.

QA03_YN_02_S12 “Did you receive cash (a salary) for work done abroad in the last 12 months?

hbs_short$QA03_YN_02_S12 [[2]]
## <labelled<double>[1]>: Did you receive cash (a salary) for work done abroad in the last 12 months?
## [1] NA
## 
## Labels:
##  value      label
##      1         da
##      2         ne
##      8    Refusal
##      9 Don't Know
str(hbs_short$QA03_YN_02_S12)
##  dbl+lbl [1:7702] NA, NA, NA, NA, NA, NA, NA,  2, NA, NA, NA, NA,  2,  2,  ...
##  @ label        : chr "Did you receive cash (a salary) for work done abroad in the last 12 months?"
##  @ format.spss  : chr "F1.0"
##  @ display_width: int 17
##  @ labels       : Named num [1:4] 1 2 8 9
##   ..- attr(*, "names")= chr [1:4] "da" "ne" "Refusal" "Don't Know"
summary(hbs_short$QA03_YN_02_S12)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##   1.000   2.000   2.000   1.976   2.000   2.000    6036
prop.table(table(hbs_short$QA03_YN_02_S12))
## 
##         1         2 
## 0.0240096 0.9759904

Na ovo pitanje 6036 nije dalo niakka odgovor a od ovih koji jesu samo 0,02% je odgovorilo da su dobili platu za rad u inostranstvu

QA04_YN_02_S12
Did you receive fee for work done by you for a local employer based on a contract for services rendered, author”

hbs_short$QA04_YN_02_S12 [[2]]
## <labelled<double>[1]>: Did you receive fee for work done by you for a local employer based on a contract for services rendered, author-ship contract and occasional and temporary jobs or agreementsin the last 12 months?
## [1] NA
## 
## Labels:
##  value      label
##      1         da
##      2         ne
##      8    Refusal
##      9 Don't Know
str(hbs_short$QA04_YN_02_S12)
##  dbl+lbl [1:7702] NA, NA, NA, NA, NA, NA, NA,  2, NA, NA, NA, NA,  2,  2,  ...
##  @ label        : chr "Did you receive fee for work done by you for a local employer based on a contract for services rendered, author"| __truncated__
##  @ format.spss  : chr "F1.0"
##  @ display_width: int 17
##  @ labels       : Named num [1:4] 1 2 8 9
##   ..- attr(*, "names")= chr [1:4] "da" "ne" "Refusal" "Don't Know"
summary(hbs_short$QA04_YN_02_S12)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##   1.000   2.000   2.000   1.971   2.000   2.000    6032
prop.table(table(hbs_short$QA04_YN_02_S12))*100
## 
##         1         2 
##  2.874251 97.125749

Od ukupnog broja 6032 nije odgovorilo na ovo pitanja, a ovi koji su odgovorili samo 2,9% je odgovorilo da su primili.

QA05_YN_02_S12
Did you receive Fee for work done by you for a foreign employer in BiH based on a contract for services rendere

hbs_short$QA05_YN_02_S12 [[2]]
## <labelled<double>[1]>: Did you receive Fee for work done by you for a foreign employer in BiH based on a contract for services rendered, authorship contract and occasional and temporary jobs or agreements with a local employer in the last 12 months?
## [1] NA
## 
## Labels:
##  value      label
##      1         da
##      2         ne
##      8    Refusal
##      9 Don't Know
str(hbs_short$QA05_YN_02_S12)
##  dbl+lbl [1:7702] NA, NA, NA, NA, NA, NA, NA,  2, NA, NA, NA, NA,  2,  2,  ...
##  @ label        : chr "Did you receive Fee for work done by you for a foreign employer in BiH based on a contract for services rendere"| __truncated__
##  @ format.spss  : chr "F1.0"
##  @ display_width: int 17
##  @ labels       : Named num [1:4] 1 2 8 9
##   ..- attr(*, "names")= chr [1:4] "da" "ne" "Refusal" "Don't Know"
summary(hbs_short$QA05_YN_02_S12)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##   1.000   2.000   2.000   1.999   2.000   2.000    6038
prop.table(table(hbs_short$QA05_YN_02_S12))
## 
##           1           2 
## 0.001201923 0.998798077

Od 7702 6038 nije odgovorilo, a ovi sto su odgovorili samo 0.01% je reklo da jeste.

QA06_YN_02_S12

Did you receive fee for work done by you for an employer abroad BiH based on a contract for services rendered, au-thorship contract and occasional and temporary jobs or agreements with a local employer in the last 12 months?

hbs_short$QA06_YN_02_S12 [[2]]
## <labelled<double>[1]>: Did you receive fee for work done by you for an employer abroad BiH based on a contract for services rendered, au-thorship contract and occasional and temporary jobs or agreements with a local employer in the last 12 months?
## [1] NA
## 
## Labels:
##  value      label
##      1         da
##      2         ne
##      8    Refusal
##      9 Don't Know
str(hbs_short$QA06_YN_02_S12)
##  dbl+lbl [1:7702] NA, NA, NA, NA, NA, NA, NA,  2, NA, NA, NA, NA,  2,  2,  ...
##  @ label        : chr "Did you receive fee for work done by you for an employer abroad BiH based on a contract for services rendered, "| __truncated__
##  @ format.spss  : chr "F1.0"
##  @ display_width: int 17
##  @ labels       : Named num [1:4] 1 2 8 9
##   ..- attr(*, "names")= chr [1:4] "da" "ne" "Refusal" "Don't Know"
summary(hbs_short$QA06_YN_02_S12)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##   1.000   2.000   2.000   1.994   2.000   2.000    6038
prop.table(table(hbs_short$QA06_YN_02_S12))*100
## 
##          1          2 
##  0.6009615 99.3990385

Samo je 0,6% odgovirilo da jesu a opet oko 6038 je NA

QA07_YN_02_S12 Did you receive meal allowance (excludes coupons and meals) in the last 12 months?

hbs_short$QA07_YN_02_S12 [[2]]
## <labelled<double>[1]>: Did you receive meal allowance (excludes coupons and meals) in the last 12 months?
## [1] NA
## 
## Labels:
##  value      label
##      1         da
##      2         ne
##      8    Refusal
##      9 Don't Know
str(hbs_short$QA07_YN_02_S12)
##  dbl+lbl [1:7702] NA, NA, NA, NA, NA, NA, NA,  2, NA, NA, NA, NA,  2,  1,  ...
##  @ label        : chr "Did you receive meal allowance (excludes coupons and meals) in the last 12 months?"
##  @ format.spss  : chr "F1.0"
##  @ display_width: int 17
##  @ labels       : Named num [1:4] 1 2 8 9
##   ..- attr(*, "names")= chr [1:4] "da" "ne" "Refusal" "Don't Know"
summary(hbs_short$QA07_YN_02_S12)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##   1.000   1.000   2.000   1.744   2.000   2.000    6035
prop.table(table(hbs_short$QA07_YN_02_S12))*100
## 
##        1        2 
## 25.61488 74.38512

6035 nije odgovorilo, 25,6% je primilo topli obrok

QA08_YN_02_S12

hbs_short$QA08_YN_02_S12 [[2]]
## <labelled<double>[1]>: Did you receive transport allowance to and from work (excludes coupons)  in the last 12 months?
## [1] NA
## 
## Labels:
##  value      label
##      1         da
##      2         ne
##      8    Refusal
##      9 Don't Know
str(hbs_short$QA08_YN_02_S12)
##  dbl+lbl [1:7702] NA, NA, NA, NA, NA, NA, NA,  2, NA, NA, NA, NA,  2,  1,  ...
##  @ label        : chr "Did you receive transport allowance to and from work (excludes coupons)  in the last 12 months?"
##  @ format.spss  : chr "F1.0"
##  @ display_width: int 17
##  @ labels       : Named num [1:4] 1 2 8 9
##   ..- attr(*, "names")= chr [1:4] "da" "ne" "Refusal" "Don't Know"
summary(hbs_short$QA08_YN_02_S12)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##   1.000   2.000   2.000   1.914   2.000   2.000    6036
prop.table(table(hbs_short$QA08_YN_02_S12))*100
## 
##         1         2 
##  8.583433 91.416567

od ovih koji su odgovorili 8,5% ih je primilo putne troskove.

QA09_YN_02_S12

hbs_short$QA09_YN_02_S12 [[2]]
## <labelled<double>[1]>: Did you receive allowance for living in other town in the last 12 months?
## [1] NA
## 
## Labels:
##  value      label
##      1         da
##      2         ne
##      8    Refusal
##      9 Don't Know
str(hbs_short$QA09_YN_02_S12)
##  dbl+lbl [1:7702] NA, NA, NA, NA, NA, NA, NA,  2, NA, NA, NA, NA,  2,  2,  ...
##  @ label        : chr "Did you receive allowance for living in other town in the last 12 months?"
##  @ format.spss  : chr "F1.0"
##  @ display_width: int 17
##  @ labels       : Named num [1:4] 1 2 8 9
##   ..- attr(*, "names")= chr [1:4] "da" "ne" "Refusal" "Don't Know"
summary(hbs_short$QA09_YN_02_S12)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##   1.000   2.000   2.000   1.999   2.000   2.000    6039
prop.table(table(hbs_short$QA09_YN_02_S12))*100
## 
##           1           2 
##  0.06013229 99.93986771

Od onih koji su odgovorili samo je 0.06% odgovorilo da su prmili nakandnu ya zivto u drugom gradu.

QA10_YN_02_S12 Did you receive fees for management/supervisory board mem-bers in the last 12 months?

hbs_short$QA10_YN_02_S12 [[2]]
## <labelled<double>[1]>: Did you receive fees for management/supervisory board mem-bers in the last 12 months?
## [1] NA
## 
## Labels:
##  value      label
##      1         da
##      2         ne
##      8    Refusal
##      9 Don't Know
str(hbs_short$QA10_YN_02_S12)
##  dbl+lbl [1:7702] NA, NA, NA, NA, NA, NA, NA,  2, NA, NA, NA, NA,  2,  2,  ...
##  @ label        : chr "Did you receive fees for management/supervisory board mem-bers in the last 12 months?"
##  @ format.spss  : chr "F1.0"
##  @ display_width: int 17
##  @ labels       : Named num [1:4] 1 2 8 9
##   ..- attr(*, "names")= chr [1:4] "da" "ne" "Refusal" "Don't Know"
summary(hbs_short$QA10_YN_02_S12)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##   1.000   2.000   2.000   1.998   2.000   2.000    6037
prop.table(table(hbs_short$QA10_YN_02_S12))*100
## 
##          1          2 
##  0.2402402 99.7597598

0.24% je primalo naknadu za odvojen zivot.

QA11_YN_02_S12 Did you receive other cash income from employment in the last 12 months?

hbs_short$QA11_YN_02_S12 [[2]]
## <labelled<double>[1]>: Did you receive other cash income from employment in the last 12 months?
## [1] NA
## 
## Labels:
##  value      label
##      1         da
##      2         ne
##      8    Refusal
##      9 Don't Know
str(hbs_short$QA11_YN_02_S12)
##  dbl+lbl [1:7702] NA, NA, NA, NA, NA, NA, NA,  2, NA, NA, NA, NA,  2,  2,  ...
##  @ label        : chr "Did you receive other cash income from employment in the last 12 months?"
##  @ format.spss  : chr "F1.0"
##  @ display_width: int 17
##  @ labels       : Named num [1:4] 1 2 8 9
##   ..- attr(*, "names")= chr [1:4] "da" "ne" "Refusal" "Don't Know"
summary(hbs_short$QA11_YN_02_S12)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##   1.000   2.000   2.000   1.929   2.000   2.000    6040
prop.table(table(hbs_short$QA11_YN_02_S12))*100
## 
##        1        2 
##  7.09988 92.90012

7,1% je primilo drugu naknadnu od zaposlenosti.

QA12_YN_02_S12 Did you receive in-kind income from employment in the last 12 months?

hbs_short$QA12_YN_02_S12 [[2]]
## <labelled<double>[1]>: Did you receive in-kind income from employment  in the last 12 months?
## [1] NA
## 
## Labels:
##  value      label
##      1         da
##      2         ne
##      8    Refusal
##      9 Don't Know
str(hbs_short$QA12_YN_02_S12)
##  dbl+lbl [1:7702] NA, NA, NA, NA, NA, NA, NA,  2, NA, NA, NA, NA,  2,  2,  ...
##  @ label        : chr "Did you receive in-kind income from employment  in the last 12 months?"
##  @ format.spss  : chr "F1.0"
##  @ display_width: int 17
##  @ labels       : Named num [1:4] 1 2 8 9
##   ..- attr(*, "names")= chr [1:4] "da" "ne" "Refusal" "Don't Know"
summary(hbs_short$QA12_YN_02_S12)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##   1.000   2.000   2.000   1.992   2.000   2.000    6038
prop.table(table(hbs_short$QA12_YN_02_S12))*100
## 
##          1          2 
##  0.8413462 99.1586538

6038 je NA a 0,8% je primilo ovu nakandu

QA14_YN_02_S12 Did you receive earnings for work done on your own agricultural holding/s in the last 12 months?

hbs_short$QA14_YN_02_S12 [[2]]
## <labelled<double>[1]>: Did you receive earnings for work done on your own agricultural holding/s in the last 12 months?
## [1] NA
## 
## Labels:
##  value      label
##      1         da
##      2         ne
##      8    Refusal
##      9 Don't Know
str(hbs_short$QA14_YN_02_S12)
##  dbl+lbl [1:7702] NA, NA, NA, NA, NA, NA, NA,  2, NA, NA, NA, NA,  2,  2,  ...
##  @ label        : chr "Did you receive earnings for work done on your own agricultural holding/s in the last 12 months?"
##  @ format.spss  : chr "F1.0"
##  @ display_width: int 17
##  @ labels       : Named num [1:4] 1 2 8 9
##   ..- attr(*, "names")= chr [1:4] "da" "ne" "Refusal" "Don't Know"
summary(hbs_short$QA14_YN_02_S12)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##   1.000   2.000   2.000   1.815   2.000   2.000    5973
prop.table(table(hbs_short$QA14_YN_02_S12))*100
## 
##        1        2 
## 18.50781 81.49219

18,5% je primalo nakandu za poljoprivredu 5973 IS NA

QA15_YN_02_S12 id you receive earnings for trade and free professions (lawyers, painters, singers, etc.) in the last 12 months?

hbs_short$QA15_YN_02_S12 [[2]]
## <labelled<double>[1]>: Did you receive earnings for trade and free professions (lawyers, painters, singers, etc.) in the last 12 months?
## [1] NA
## 
## Labels:
##  value      label
##      1         da
##      2         ne
##      8    Refusal
##      9 Don't Know
str(hbs_short$QA15_YN_02_S12)
##  dbl+lbl [1:7702] NA, NA, NA, NA, NA, NA, NA,  2, NA, NA, NA, NA,  2,  2,  ...
##  @ label        : chr "Did you receive earnings for trade and free professions (lawyers, painters, singers, etc.) in the last 12 months?"
##  @ format.spss  : chr "F1.0"
##  @ display_width: int 17
##  @ labels       : Named num [1:4] 1 2 8 9
##   ..- attr(*, "names")= chr [1:4] "da" "ne" "Refusal" "Don't Know"
summary(hbs_short$QA15_YN_02_S12)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##   1.000   2.000   2.000   1.969   2.000   2.000    6035
prop.table(table(hbs_short$QA15_YN_02_S12))*100
## 
##         1         2 
##  3.059388 96.940612

3% ih je primilo ovaj vid nakande

QA16_YN_02_S12 Did you receive income from interest, savings, dividends or profit from capital investment in the last 12 months?

hbs_short$QA16_YN_02_S12 [[2]]
## <labelled<double>[1]>: Did you receive income from interest, savings, dividends or profit from capital investment in the last 12 months?
## [1] NA
## 
## Labels:
##  value      label
##      1         da
##      2         ne
##      8    Refusal
##      9 Don't Know
str(hbs_short$QA16_YN_02_S12)
##  dbl+lbl [1:7702] NA, NA, NA, NA, NA, NA, NA,  2, NA, NA, NA, NA,  2,  2,  ...
##  @ label        : chr "Did you receive income from interest, savings, dividends or profit from capital investment in the last 12 months?"
##  @ format.spss  : chr "F1.0"
##  @ display_width: int 17
##  @ labels       : Named num [1:4] 1 2 8 9
##   ..- attr(*, "names")= chr [1:4] "da" "ne" "Refusal" "Don't Know"
summary(hbs_short$QA16_YN_02_S12)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##       2       2       2       2       2       2    6041
prop.table(table(hbs_short$QA16_YN_02_S12))*100
## 
##   2 
## 100

Kamate i dividnede samo NIKO

QA17_YN_02_S12 Did you receive income from the rent of landinG the last 12 months?

hbs_short$QA17_YN_02_S12 [[2]]
## <labelled<double>[1]>: Did you receive income from the rent of landin the last 12 months?
## [1] NA
## 
## Labels:
##  value      label
##      1         da
##      2         ne
##      8    Refusal
##      9 Don't Know
str(hbs_short$QA17_YN_02_S12)
##  dbl+lbl [1:7702] NA, NA, NA, NA, NA, NA, NA,  2, NA, NA, NA, NA,  2,  2,  ...
##  @ label        : chr "Did you receive income from the rent of landin the last 12 months?"
##  @ format.spss  : chr "F1.0"
##  @ display_width: int 17
##  @ labels       : Named num [1:4] 1 2 8 9
##   ..- attr(*, "names")= chr [1:4] "da" "ne" "Refusal" "Don't Know"
summary(hbs_short$QA17_YN_02_S12)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##   1.000   2.000   2.000   1.998   2.000   2.000    6037
prop.table(table(hbs_short$QA17_YN_02_S12))*100
## 
##          1          2 
##  0.1801802 99.8198198

0.18% su primili (od odgovorenih)

QA18_YN_02_S12 Did you receive income from the rent of residential premises in the last 12 months?

hbs_short$QA18_YN_02_S12 [[2]]
## <labelled<double>[1]>: Did you receive income from the rent of residential premises in the last 12 months?
## [1] NA
## 
## Labels:
##  value      label
##      1         da
##      2         ne
##      8    Refusal
##      9 Don't Know
str(hbs_short$QA18_YN_02_S12)
##  dbl+lbl [1:7702] NA, NA, NA, NA, NA, NA, NA,  2, NA, NA, NA, NA,  2,  2,  ...
##  @ label        : chr "Did you receive income from the rent of residential premises in the last 12 months?"
##  @ format.spss  : chr "F1.0"
##  @ display_width: int 17
##  @ labels       : Named num [1:4] 1 2 8 9
##   ..- attr(*, "names")= chr [1:4] "da" "ne" "Refusal" "Don't Know"
summary(hbs_short$QA18_YN_02_S12)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##   1.000   2.000   2.000   1.996   2.000   2.000    6041
prop.table(table(hbs_short$QA18_YN_02_S12))*100
## 
##          1          2 
##  0.3612282 99.6387718

Samo 0.36% Da

QA19_YN_02_S12 Did you receive income from the rent of business premises, gar-ages, etc. in the last 12 months?”

hbs_short$QA19_YN_02_S12 [[2]]
## <labelled<double>[1]>: Did you receive income from the rent of business premises, gar-ages, etc. in the last 12 months?
## [1] NA
## 
## Labels:
##  value      label
##      1         da
##      2         ne
##      8    Refusal
##      9 Don't Know
str(hbs_short$QA19_YN_02_S12)
##  dbl+lbl [1:7702] NA, NA, NA, NA, NA, NA, NA,  2, NA, NA, NA, NA,  2,  2,  ...
##  @ label        : chr "Did you receive income from the rent of business premises, gar-ages, etc. in the last 12 months?"
##  @ format.spss  : chr "F1.0"
##  @ display_width: int 17
##  @ labels       : Named num [1:4] 1 2 8 9
##   ..- attr(*, "names")= chr [1:4] "da" "ne" "Refusal" "Don't Know"
summary(hbs_short$QA19_YN_02_S12)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##   1.000   2.000   2.000   1.996   2.000   2.000    6039
prop.table(table(hbs_short$QA19_YN_02_S12))*100
## 
##          1          2 
##  0.3607937 99.6392063

Od odgovorenih, samo 0.36% je iydavalo posl.prostore garaze i slicno

QA20_YN_02_S12 Did you receive income from the rent of equipment, cattle, etc. in the last 12 months?

hbs_short$QA20_YN_02_S12 [[2]]
## <labelled<double>[1]>: Did you receive income from the rent of equipment, cattle, etc. in the last 12 months?
## [1] NA
## 
## Labels:
##  value      label
##      1         da
##      2         ne
##      8    Refusal
##      9 Don't Know
str(hbs_short$QA20_YN_02_S12)
##  dbl+lbl [1:7702] NA, NA, NA, NA, NA, NA, NA,  2, NA, NA, NA, NA,  2,  2,  ...
##  @ label        : chr "Did you receive income from the rent of equipment, cattle, etc. in the last 12 months?"
##  @ format.spss  : chr "F1.0"
##  @ display_width: int 17
##  @ labels       : Named num [1:4] 1 2 8 9
##   ..- attr(*, "names")= chr [1:4] "da" "ne" "Refusal" "Don't Know"
summary(hbs_short$QA20_YN_02_S12)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##   1.000   2.000   2.000   1.997   2.000   2.000    6043
prop.table(table(hbs_short$QA20_YN_02_S12))*100
## 
##          1          2 
##  0.3013864 99.6986136

0.3% od odgovorenih jesu.

QA21_YN_02_S12 - OVO VJEROVATNO NE JER NIJE OD POSLA NEGO NEKA DOYNAKA Did you receive money from other households or persons in BiH in the last 12 months?

hbs_short$QA21_YN_02_S12 [[2]]
## <labelled<double>[1]>: Did you receive money from other households or persons in BiH in the last 12 months?
## [1] NA
## 
## Labels:
##  value      label
##      1         da
##      2         ne
##      8    Refusal
##      9 Don't Know
str(hbs_short$QA21_YN_02_S12)
##  dbl+lbl [1:7702] NA, NA, NA, NA, NA, NA, NA,  2, NA, NA, NA, NA,  2,  2,  ...
##  @ label        : chr "Did you receive money from other households or persons in BiH in the last 12 months?"
##  @ format.spss  : chr "F1.0"
##  @ display_width: int 17
##  @ labels       : Named num [1:4] 1 2 8 9
##   ..- attr(*, "names")= chr [1:4] "da" "ne" "Refusal" "Don't Know"
summary(hbs_short$QA21_YN_02_S12)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##    1.00    2.00    2.00    1.98    2.00    2.00    6034
prop.table(table(hbs_short$QA21_YN_02_S12))*100
## 
##         1         2 
##  2.038369 97.961631

2% od odgovorenih

QA22_YN_02_S12 - OVO VJEROVATNO NE JER NIJE OD POSLA NEGO NEKA DOYNAKA Did you receive money from other households or persons abroad (remittances) in the last 12 months?

hbs_short$QA22_YN_02_S12 [[2]]
## <labelled<double>[1]>: Did you receive money from other households or persons abroad (remittances) in the last 12 months?
## [1] NA
## 
## Labels:
##  value      label
##      1         da
##      2         ne
##      8    Refusal
##      9 Don't Know
str(hbs_short$QA22_YN_02_S12)
##  dbl+lbl [1:7702] NA, NA, NA, NA, NA, NA, NA,  1, NA, NA, NA, NA,  2,  2,  ...
##  @ label        : chr "Did you receive money from other households or persons abroad (remittances) in the last 12 months?"
##  @ format.spss  : chr "F1.0"
##  @ display_width: int 17
##  @ labels       : Named num [1:4] 1 2 8 9
##   ..- attr(*, "names")= chr [1:4] "da" "ne" "Refusal" "Don't Know"
summary(hbs_short$QA22_YN_02_S12)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##   1.000   2.000   2.000   1.914   2.000   2.000    6022
prop.table(table(hbs_short$QA22_YN_02_S12))*100
## 
##         1         2 
##  8.630952 91.369048

8,6% jesu

QA23_YN_02_S12 - Did you receive salary of employees working for a local employer in the last 12 months? Detalji oko ove vrste zaposlenosti odnose se na cuvanje djece, prosnja, prevod.. itd

hbs_short$QA23_YN_02_S12 [[2]]
## <labelled<double>[1]>: Did you receive salary of employees working for a local employer in the last 12 months?
## [1] NA
## 
## Labels:
##  value      label
##      1         da
##      2         ne
##      8    Refusal
##      9 Don't Know
str(hbs_short$QA23_YN_02_S12)
##  dbl+lbl [1:7702] NA, NA, NA, NA, NA, NA, NA,  2, NA, NA, NA, NA,  2,  2,  ...
##  @ label        : chr "Did you receive salary of employees working for a local employer in the last 12 months?"
##  @ format.spss  : chr "F1.0"
##  @ display_width: int 17
##  @ labels       : Named num [1:4] 1 2 8 9
##   ..- attr(*, "names")= chr [1:4] "da" "ne" "Refusal" "Don't Know"
summary(hbs_short$QA23_YN_02_S12)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##   1.000   2.000   2.000   1.957   2.000   2.000    6032
prop.table(table(hbs_short$QA23_YN_02_S12))*100
## 
##         1         2 
##  4.251497 95.748503

4.25% je priilo ovu nakandu

##SADA IDEMO NA TRECEG CLANA DOMACINSTVA
03

QA01_YN_03_S12 Did you receive salary of employees working for a local employer in the last 12 months?

hbs_short$QA01_YN_03_S12 [[2]]
## <labelled<double>[1]>: Did you receive salary of employees working for a local employer in the last 12 months?
## [1] NA
## 
## Labels:
##  value      label
##      1         da
##      2         ne
##      8    Refusal
##      9 Don't Know
str(hbs_short$QA01_YN_03_S12)
##  dbl+lbl [1:7702] NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,  1, N...
##  @ label        : chr "Did you receive salary of employees working for a local employer in the last 12 months?"
##  @ format.spss  : chr "F1.0"
##  @ display_width: int 17
##  @ labels       : Named num [1:4] 1 2 8 9
##   ..- attr(*, "names")= chr [1:4] "da" "ne" "Refusal" "Don't Know"
summary(hbs_short$QA01_YN_03_S12)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##   1.000   1.000   1.000   1.258   2.000   2.000    6690
prop.table(table(hbs_short$QA01_YN_03_S12))*100
## 
##        1        2 
## 74.20949 25.79051

To znaci da od 7702 domacinstava za 6690, nema podataka a od ovih koji su odgovorili samo 74,2% je reklo da je primilo platu od lokalnog poslodavca. Pitanje se odnosi na DRUGOG clana familije

QA02_YN_03_S12
Did you receive salary of employees working for a foreign employer in BiH in the last 12 months?

hbs_short$QA02_YN_03_S12 [[2]]
## <labelled<double>[1]>: Did you receive salary of employees working for a foreign employer in BiH in the last 12 months?
## [1] NA
## 
## Labels:
##  value      label
##      1         da
##      2         ne
##      8    Refusal
##      9 Don't Know
str(hbs_short$QA02_YN_03_S12)
##  dbl+lbl [1:7702] NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,  2, N...
##  @ label        : chr "Did you receive salary of employees working for a foreign employer in BiH in the last 12 months?"
##  @ format.spss  : chr "F1.0"
##  @ display_width: int 17
##  @ labels       : Named num [1:4] 1 2 8 9
##   ..- attr(*, "names")= chr [1:4] "da" "ne" "Refusal" "Don't Know"
summary(hbs_short$QA02_YN_03_S12)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##   1.000   2.000   2.000   1.988   2.000   2.000    6873
prop.table(table(hbs_short$QA02_YN_03_S12))*100
## 
##         1         2 
##  1.206273 98.793727

Od 7702 domacinstava samo na ovo pitanje Da li ste primili platu od poslodavca koji ima sjediste van BiH u zadnjih 12 mjeseci? 6873 nije nista odgovorilo a ovi koji su odgovorili samo su 1,2% su rekli da jesu.

QA03_YN_03_S12 “Did you receive cash (a salary) for work done abroad in the last 12 months?

hbs_short$QA03_YN_03_S12 [[2]]
## <labelled<double>[1]>: Did you receive cash (a salary) for work done abroad in the last 12 months?
## [1] NA
## 
## Labels:
##  value      label
##      1         da
##      2         ne
##      8    Refusal
##      9 Don't Know
str(hbs_short$QA03_YN_03_S12)
##  dbl+lbl [1:7702] NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,  2, N...
##  @ label        : chr "Did you receive cash (a salary) for work done abroad in the last 12 months?"
##  @ format.spss  : chr "F1.0"
##  @ display_width: int 17
##  @ labels       : Named num [1:4] 1 2 8 9
##   ..- attr(*, "names")= chr [1:4] "da" "ne" "Refusal" "Don't Know"
summary(hbs_short$QA03_YN_03_S12)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##   1.000   2.000   2.000   1.955   2.000   2.000    6862
prop.table(table(hbs_short$QA03_YN_03_S12))
## 
##         1         2 
## 0.0452381 0.9547619

Na ovo pitanje 6862 nije dalo niakka odgovor a od ovih koji jesu samo 0,04% je odgovorilo da su dobili platu za rad u inostranstvu

QA04_YN_03_S12
Did you receive fee for work done by you for a local employer based on a contract for services rendered, author”

hbs_short$QA04_YN_03_S12 [[2]]
## <labelled<double>[1]>: Did you receive fee for work done by you for a local employer based on a contract for services rendered, author-ship contract and occasional and temporary jobs or agreementsin the last 12 months?
## [1] NA
## 
## Labels:
##  value      label
##      1         da
##      2         ne
##      8    Refusal
##      9 Don't Know
str(hbs_short$QA04_YN_03_S12)
##  dbl+lbl [1:7702] NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,  2, N...
##  @ label        : chr "Did you receive fee for work done by you for a local employer based on a contract for services rendered, author"| __truncated__
##  @ format.spss  : chr "F1.0"
##  @ display_width: int 17
##  @ labels       : Named num [1:4] 1 2 8 9
##   ..- attr(*, "names")= chr [1:4] "da" "ne" "Refusal" "Don't Know"
summary(hbs_short$QA04_YN_03_S12)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##   1.000   2.000   2.000   1.945   2.000   2.000    6868
prop.table(table(hbs_short$QA04_YN_03_S12))*100
## 
##         1         2 
##  5.515588 94.484412

Od ukupnog broja 6868 nije odgovorilo na ovo pitanja, a ovi koji su odgovorili samo 5,5% je odgovorilo da su primili.

QA05_YN_03_S12
Did you receive Fee for work done by you for a foreign employer in BiH based on a contract for services rendere

hbs_short$QA05_YN_03_S12 [[2]]
## <labelled<double>[1]>: Did you receive Fee for work done by you for a foreign employer in BiH based on a contract for services rendered, authorship contract and occasional and temporary jobs or agreements with a local employer in the last 12 months?
## [1] NA
## 
## Labels:
##  value      label
##      1         da
##      2         ne
##      8    Refusal
##      9 Don't Know
str(hbs_short$QA05_YN_03_S12)
##  dbl+lbl [1:7702] NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,  2, N...
##  @ label        : chr "Did you receive Fee for work done by you for a foreign employer in BiH based on a contract for services rendere"| __truncated__
##  @ format.spss  : chr "F1.0"
##  @ display_width: int 17
##  @ labels       : Named num [1:4] 1 2 8 9
##   ..- attr(*, "names")= chr [1:4] "da" "ne" "Refusal" "Don't Know"
summary(hbs_short$QA05_YN_03_S12)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##   1.000   2.000   2.000   1.998   2.000   2.000    6871
prop.table(table(hbs_short$QA05_YN_03_S12))
## 
##           1           2 
## 0.002406739 0.997593261

Od 7702 6,871 nije odgovorilo, a ovi sto su odgovorili samo 0.02% je reklo da jeste.

QA06_YN_03_S12

Did you receive fee for work done by you for an employer abroad BiH based on a contract for services rendered, au-thorship contract and occasional and temporary jobs or agreements with a local employer in the last 12 months?

hbs_short$QA06_YN_03_S12 [[2]]
## <labelled<double>[1]>: Did you receive fee for work done by you for an employer abroad BiH based on a contract for services rendered, au-thorship contract and occasional and temporary jobs or agreements with a local employer in the last 12 months?
## [1] NA
## 
## Labels:
##  value      label
##      1         da
##      2         ne
##      8    Refusal
##      9 Don't Know
str(hbs_short$QA06_YN_03_S12)
##  dbl+lbl [1:7702] NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,  2, N...
##  @ label        : chr "Did you receive fee for work done by you for an employer abroad BiH based on a contract for services rendered, "| __truncated__
##  @ format.spss  : chr "F1.0"
##  @ display_width: int 17
##  @ labels       : Named num [1:4] 1 2 8 9
##   ..- attr(*, "names")= chr [1:4] "da" "ne" "Refusal" "Don't Know"
summary(hbs_short$QA06_YN_03_S12)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##   1.000   2.000   2.000   1.998   2.000   2.000    6872
prop.table(table(hbs_short$QA06_YN_03_S12))*100
## 
##          1          2 
##  0.2409639 99.7590361

Samo je 0,2% odgovirilo da jesu a opet oko 6872 je NA

QA07_YN_03_S12 Did you receive meal allowance (excludes coupons and meals) in the last 12 months?

hbs_short$QA07_YN_03_S12 [[2]]
## <labelled<double>[1]>: Did you receive meal allowance (excludes coupons and meals) in the last 12 months?
## [1] NA
## 
## Labels:
##  value      label
##      1         da
##      2         ne
##      8    Refusal
##      9 Don't Know
str(hbs_short$QA07_YN_03_S12)
##  dbl+lbl [1:7702] NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,  1, N...
##  @ label        : chr "Did you receive meal allowance (excludes coupons and meals) in the last 12 months?"
##  @ format.spss  : chr "F1.0"
##  @ display_width: int 17
##  @ labels       : Named num [1:4] 1 2 8 9
##   ..- attr(*, "names")= chr [1:4] "da" "ne" "Refusal" "Don't Know"
summary(hbs_short$QA07_YN_03_S12)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##   1.000   2.000   2.000   1.758   2.000   2.000    6858
prop.table(table(hbs_short$QA07_YN_03_S12))*100
## 
##        1        2 
## 24.17062 75.82938

6858 nije odgovorilo, 24,2% je primilo topli obrok

QA08_YN_03_S12

hbs_short$QA08_YN_03_S12 [[2]]
## <labelled<double>[1]>: Did you receive transport allowance to and from work (excludes coupons)  in the last 12 months?
## [1] NA
## 
## Labels:
##  value      label
##      1         da
##      2         ne
##      8    Refusal
##      9 Don't Know
str(hbs_short$QA08_YN_03_S12)
##  dbl+lbl [1:7702] NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,  1, N...
##  @ label        : chr "Did you receive transport allowance to and from work (excludes coupons)  in the last 12 months?"
##  @ format.spss  : chr "F1.0"
##  @ display_width: int 17
##  @ labels       : Named num [1:4] 1 2 8 9
##   ..- attr(*, "names")= chr [1:4] "da" "ne" "Refusal" "Don't Know"
summary(hbs_short$QA08_YN_03_S12)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##   1.000   2.000   2.000   1.915   2.000   2.000    6869
prop.table(table(hbs_short$QA08_YN_03_S12))*100
## 
##         1         2 
##  8.523409 91.476591

od ovih koji su odgovorili 8,5% ih je primilo putne troskove.

QA09_YN_03_S12

hbs_short$QA09_YN_03_S12 [[2]]
## <labelled<double>[1]>: Did you receive allowance for living in other town in the last 12 months?
## [1] NA
## 
## Labels:
##  value      label
##      1         da
##      2         ne
##      8    Refusal
##      9 Don't Know
str(hbs_short$QA09_YN_03_S12)
##  dbl+lbl [1:7702] NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,  2, N...
##  @ label        : chr "Did you receive allowance for living in other town in the last 12 months?"
##  @ format.spss  : chr "F1.0"
##  @ display_width: int 17
##  @ labels       : Named num [1:4] 1 2 8 9
##   ..- attr(*, "names")= chr [1:4] "da" "ne" "Refusal" "Don't Know"
summary(hbs_short$QA09_YN_03_S12)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##       2       2       2       2       2       2    6873
prop.table(table(hbs_short$QA09_YN_03_S12))*100
## 
##   2 
## 100

Od onih koji su odgovorili NIKO NIJE prmili nakandnu ya zivto u drugom gradu.

QA10_YN_03_S12 Did you receive fees for management/supervisory board mem-bers in the last 12 months?

hbs_short$QA10_YN_03_S12 [[2]]
## <labelled<double>[1]>: Did you receive fees for management/supervisory board mem-bers in the last 12 months?
## [1] NA
## 
## Labels:
##  value      label
##      1         da
##      2         ne
##      8    Refusal
##      9 Don't Know
str(hbs_short$QA10_YN_03_S12)
##  dbl+lbl [1:7702] NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,  2, N...
##  @ label        : chr "Did you receive fees for management/supervisory board mem-bers in the last 12 months?"
##  @ format.spss  : chr "F1.0"
##  @ display_width: int 17
##  @ labels       : Named num [1:4] 1 2 8 9
##   ..- attr(*, "names")= chr [1:4] "da" "ne" "Refusal" "Don't Know"
summary(hbs_short$QA10_YN_03_S12)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##   1.000   2.000   2.000   1.998   2.000   2.000    6871
prop.table(table(hbs_short$QA10_YN_03_S12))*100
## 
##          1          2 
##  0.2406739 99.7593261

0.24% je primalo naknadu za odvojen zivot.

QA11_YN_03_S12 Did you receive other cash income from employment in the last 12 months?

hbs_short$QA11_YN_03_S12 [[2]]
## <labelled<double>[1]>: Did you receive other cash income from employment in the last 12 months?
## [1] NA
## 
## Labels:
##  value      label
##      1         da
##      2         ne
##      8    Refusal
##      9 Don't Know
str(hbs_short$QA11_YN_03_S12)
##  dbl+lbl [1:7702] NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,  2, N...
##  @ label        : chr "Did you receive other cash income from employment in the last 12 months?"
##  @ format.spss  : chr "F1.0"
##  @ display_width: int 17
##  @ labels       : Named num [1:4] 1 2 8 9
##   ..- attr(*, "names")= chr [1:4] "da" "ne" "Refusal" "Don't Know"
summary(hbs_short$QA11_YN_03_S12)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##    1.00    2.00    2.00    1.96    2.00    2.00    6869
prop.table(table(hbs_short$QA11_YN_03_S12))*100
## 
##         1         2 
##  3.961585 96.038415

3,4% je primilo drugu naknadnu od zaposlenosti.

QA12_YN_03_S12 Did you receive in-kind income from employment in the last 12 months?

hbs_short$QA12_YN_03_S12 [[2]]
## <labelled<double>[1]>: Did you receive in-kind income from employment  in the last 12 months?
## [1] NA
## 
## Labels:
##  value      label
##      1         da
##      2         ne
##      8    Refusal
##      9 Don't Know
str(hbs_short$QA12_YN_03_S12)
##  dbl+lbl [1:7702] NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,  2, N...
##  @ label        : chr "Did you receive in-kind income from employment  in the last 12 months?"
##  @ format.spss  : chr "F1.0"
##  @ display_width: int 17
##  @ labels       : Named num [1:4] 1 2 8 9
##   ..- attr(*, "names")= chr [1:4] "da" "ne" "Refusal" "Don't Know"
summary(hbs_short$QA12_YN_03_S12)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##   1.000   2.000   2.000   1.992   2.000   2.000    6872
prop.table(table(hbs_short$QA12_YN_03_S12))*100
## 
##          1          2 
##  0.8433735 99.1566265

6872 je NA a 0,84% je primilo ovu nakandu

QA14_YN_03_S12 Did you receive earnings for work done on your own agricultural holding/s in the last 12 months?

hbs_short$QA14_YN_03_S12 [[2]]
## <labelled<double>[1]>: Did you receive earnings for work done on your own agricultural holding/s in the last 12 months?
## [1] NA
## 
## Labels:
##  value      label
##      1         da
##      2         ne
##      8    Refusal
##      9 Don't Know
str(hbs_short$QA14_YN_03_S12)
##  dbl+lbl [1:7702] NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,  2, N...
##  @ label        : chr "Did you receive earnings for work done on your own agricultural holding/s in the last 12 months?"
##  @ format.spss  : chr "F1.0"
##  @ display_width: int 17
##  @ labels       : Named num [1:4] 1 2 8 9
##   ..- attr(*, "names")= chr [1:4] "da" "ne" "Refusal" "Don't Know"
summary(hbs_short$QA14_YN_03_S12)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##   1.000   2.000   2.000   1.852   2.000   2.000    6836
prop.table(table(hbs_short$QA14_YN_03_S12))*100
## 
##       1       2 
## 14.7806 85.2194

14,7% je primalo nakandu za poljoprivredu 6836 IS NA

QA15_YN_03_S12 id you receive earnings for trade and free professions (lawyers, painters, singers, etc.) in the last 12 months?

hbs_short$QA15_YN_03_S12 [[2]]
## <labelled<double>[1]>: Did you receive earnings for trade and free professions (lawyers, painters, singers, etc.) in the last 12 months?
## [1] NA
## 
## Labels:
##  value      label
##      1         da
##      2         ne
##      8    Refusal
##      9 Don't Know
str(hbs_short$QA15_YN_03_S12)
##  dbl+lbl [1:7702] NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,  2, N...
##  @ label        : chr "Did you receive earnings for trade and free professions (lawyers, painters, singers, etc.) in the last 12 months?"
##  @ format.spss  : chr "F1.0"
##  @ display_width: int 17
##  @ labels       : Named num [1:4] 1 2 8 9
##   ..- attr(*, "names")= chr [1:4] "da" "ne" "Refusal" "Don't Know"
summary(hbs_short$QA15_YN_03_S12)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##   1.000   2.000   2.000   1.954   2.000   2.000    6868
prop.table(table(hbs_short$QA15_YN_03_S12))*100
## 
##         1         2 
##  4.556355 95.443645

4,5% ih je primilo ovaj vid nakande

QA16_YN_03_S12 Did you receive income from interest, savings, dividends or profit from capital investment in the last 12 months?

hbs_short$QA16_YN_03_S12 [[2]]
## <labelled<double>[1]>: Did you receive income from interest, savings, dividends or profit from capital investment in the last 12 months?
## [1] NA
## 
## Labels:
##  value      label
##      1         da
##      2         ne
##      8    Refusal
##      9 Don't Know
str(hbs_short$QA16_YN_03_S12)
##  dbl+lbl [1:7702] NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,  2, N...
##  @ label        : chr "Did you receive income from interest, savings, dividends or profit from capital investment in the last 12 months?"
##  @ format.spss  : chr "F1.0"
##  @ display_width: int 17
##  @ labels       : Named num [1:4] 1 2 8 9
##   ..- attr(*, "names")= chr [1:4] "da" "ne" "Refusal" "Don't Know"
summary(hbs_short$QA16_YN_03_S12)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##       2       2       2       2       2       2    6872
prop.table(table(hbs_short$QA16_YN_03_S12))*100
## 
##   2 
## 100

Kamate i dividnede samo NIKO

QA17_YN_03_S12 Did you receive income from the rent of landinG the last 12 months?

hbs_short$QA17_YN_03_S12 [[2]]
## <labelled<double>[1]>: Did you receive income from the rent of landin the last 12 months?
## [1] NA
## 
## Labels:
##  value      label
##      1         da
##      2         ne
##      8    Refusal
##      9 Don't Know
str(hbs_short$QA17_YN_03_S12)
##  dbl+lbl [1:7702] NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,  2, N...
##  @ label        : chr "Did you receive income from the rent of landin the last 12 months?"
##  @ format.spss  : chr "F1.0"
##  @ display_width: int 17
##  @ labels       : Named num [1:4] 1 2 8 9
##   ..- attr(*, "names")= chr [1:4] "da" "ne" "Refusal" "Don't Know"
summary(hbs_short$QA17_YN_03_S12)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##       2       2       2       2       2       2    6872
prop.table(table(hbs_short$QA17_YN_03_S12))*100
## 
##   2 
## 100

NIKO (od odgovorenih)

QA18_YN_03_S12 Did you receive income from the rent of residential premises in the last 12 months?

hbs_short$QA18_YN_03_S12 [[2]]
## <labelled<double>[1]>: Did you receive income from the rent of residential premises in the last 12 months?
## [1] NA
## 
## Labels:
##  value      label
##      1         da
##      2         ne
##      8    Refusal
##      9 Don't Know
str(hbs_short$QA18_YN_03_S12)
##  dbl+lbl [1:7702] NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,  2, N...
##  @ label        : chr "Did you receive income from the rent of residential premises in the last 12 months?"
##  @ format.spss  : chr "F1.0"
##  @ display_width: int 17
##  @ labels       : Named num [1:4] 1 2 8 9
##   ..- attr(*, "names")= chr [1:4] "da" "ne" "Refusal" "Don't Know"
summary(hbs_short$QA18_YN_03_S12)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##       2       2       2       2       2       2    6873
prop.table(table(hbs_short$QA18_YN_03_S12))*100
## 
##   2 
## 100

NIKO

QA19_YN_03_S12 Did you receive income from the rent of business premises, gar-ages, etc. in the last 12 months?”

hbs_short$QA19_YN_03_S12 [[2]]
## <labelled<double>[1]>: Did you receive income from the rent of business premises, gar-ages, etc. in the last 12 months?
## [1] NA
## 
## Labels:
##  value      label
##      1         da
##      2         ne
##      8    Refusal
##      9 Don't Know
str(hbs_short$QA19_YN_03_S12)
##  dbl+lbl [1:7702] NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,  2, N...
##  @ label        : chr "Did you receive income from the rent of business premises, gar-ages, etc. in the last 12 months?"
##  @ format.spss  : chr "F1.0"
##  @ display_width: int 17
##  @ labels       : Named num [1:4] 1 2 8 9
##   ..- attr(*, "names")= chr [1:4] "da" "ne" "Refusal" "Don't Know"
summary(hbs_short$QA19_YN_03_S12)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##   1.000   2.000   2.000   1.999   2.000   2.000    6871
prop.table(table(hbs_short$QA19_YN_03_S12))*100
## 
##          1          2 
##  0.1203369 99.8796631

Od odgovorenih, samo 0.12% je iydavalo posl.prostore garaze i slicno

QA20_YN_03_S12 Did you receive income from the rent of equipment, cattle, etc. in the last 12 months?

hbs_short$QA20_YN_03_S12 [[2]]
## <labelled<double>[1]>: Did you receive income from the rent of equipment, cattle, etc. in the last 12 months?
## [1] NA
## 
## Labels:
##  value      label
##      1         da
##      2         ne
##      8    Refusal
##      9 Don't Know
str(hbs_short$QA20_YN_03_S12)
##  dbl+lbl [1:7702] NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,  2, N...
##  @ label        : chr "Did you receive income from the rent of equipment, cattle, etc. in the last 12 months?"
##  @ format.spss  : chr "F1.0"
##  @ display_width: int 17
##  @ labels       : Named num [1:4] 1 2 8 9
##   ..- attr(*, "names")= chr [1:4] "da" "ne" "Refusal" "Don't Know"
summary(hbs_short$QA20_YN_03_S12)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##   1.000   2.000   2.000   1.999   2.000   2.000    6874
prop.table(table(hbs_short$QA20_YN_03_S12))*100
## 
##          1          2 
##  0.1207729 99.8792271

0.12% od odgovorenih jesu.

QA21_YN_03_S12 - OVO VJEROVATNO NE JER NIJE OD POSLA NEGO NEKA DOYNAKA Did you receive money from other households or persons in BiH in the last 12 months?

hbs_short$QA21_YN_03_S12 [[2]]
## <labelled<double>[1]>: Did you receive money from other households or persons in BiH in the last 12 months?
## [1] NA
## 
## Labels:
##  value      label
##      1         da
##      2         ne
##      8    Refusal
##      9 Don't Know
str(hbs_short$QA21_YN_03_S12)
##  dbl+lbl [1:7702] NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,  2, N...
##  @ label        : chr "Did you receive money from other households or persons in BiH in the last 12 months?"
##  @ format.spss  : chr "F1.0"
##  @ display_width: int 17
##  @ labels       : Named num [1:4] 1 2 8 9
##   ..- attr(*, "names")= chr [1:4] "da" "ne" "Refusal" "Don't Know"
summary(hbs_short$QA21_YN_03_S12)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##   1.000   2.000   2.000   1.994   2.000   2.000    6869
prop.table(table(hbs_short$QA21_YN_03_S12))*100
## 
##          1          2 
##  0.6002401 99.3997599

0,6% od odgovorenih

QA22_YN_03_S12 - OVO VJEROVATNO NE JER NIJE OD POSLA NEGO NEKA DOYNAKA Did you receive money from other households or persons abroad (remittances) in the last 12 months?

hbs_short$QA22_YN_03_S12 [[2]]
## <labelled<double>[1]>: Did you receive money from other households or persons abroad (remittances) in the last 12 months?
## [1] NA
## 
## Labels:
##  value      label
##      1         da
##      2         ne
##      8    Refusal
##      9 Don't Know
str(hbs_short$QA22_YN_03_S12)
##  dbl+lbl [1:7702] NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,  2, N...
##  @ label        : chr "Did you receive money from other households or persons abroad (remittances) in the last 12 months?"
##  @ format.spss  : chr "F1.0"
##  @ display_width: int 17
##  @ labels       : Named num [1:4] 1 2 8 9
##   ..- attr(*, "names")= chr [1:4] "da" "ne" "Refusal" "Don't Know"
summary(hbs_short$QA22_YN_03_S12)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##   1.000   2.000   2.000   1.973   2.000   2.000    6872
prop.table(table(hbs_short$QA22_YN_03_S12))*100
## 
##         1         2 
##  2.650602 97.349398

2,65% jesu

QA23_YN_03_S12 - Did you receive salary of employees working for a local employer in the last 12 months? Detalji oko ove vrste zaposlenosti odnose se na cuvanje djece, prosnja, prevod.. itd

hbs_short$QA23_YN_03_S12 [[2]]
## <labelled<double>[1]>: Did you receive salary of employees working for a local employer in the last 12 months?
## [1] NA
## 
## Labels:
##  value      label
##      1         da
##      2         ne
##      8    Refusal
##      9 Don't Know
str(hbs_short$QA23_YN_03_S12)
##  dbl+lbl [1:7702] NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,  2, N...
##  @ label        : chr "Did you receive salary of employees working for a local employer in the last 12 months?"
##  @ format.spss  : chr "F1.0"
##  @ display_width: int 17
##  @ labels       : Named num [1:4] 1 2 8 9
##   ..- attr(*, "names")= chr [1:4] "da" "ne" "Refusal" "Don't Know"
summary(hbs_short$QA23_YN_03_S12)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##   1.000   2.000   2.000   1.956   2.000   2.000    6869
prop.table(table(hbs_short$QA23_YN_03_S12))*100
## 
##         1         2 
##  4.441777 95.558223

4.4% je primilo ovu nakandu

##SADA IDEMO NA CETVRTOG CLANA DOMACINSTVA
04

QA01_YN_04_S12 Did you receive salary of employees working for a local employer in the last 12 months?

hbs_short$QA01_YN_04_S12 [[2]]
## <labelled<double>[1]>: Did you receive salary of employees working for a local employer in the last 12 months?
## [1] NA
## 
## Labels:
##  value      label
##      1         da
##      2         ne
##      8    Refusal
##      9 Don't Know
str(hbs_short$QA01_YN_04_S12)
##  dbl+lbl [1:7702] NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N...
##  @ label        : chr "Did you receive salary of employees working for a local employer in the last 12 months?"
##  @ format.spss  : chr "F1.0"
##  @ display_width: int 17
##  @ labels       : Named num [1:4] 1 2 8 9
##   ..- attr(*, "names")= chr [1:4] "da" "ne" "Refusal" "Don't Know"
summary(hbs_short$QA01_YN_04_S12)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##   1.000   1.000   1.000   1.252   1.750   2.000    7384
prop.table(table(hbs_short$QA01_YN_04_S12))*100
## 
##        1        2 
## 74.84277 25.15723

To znaci da od 7702 domacinstava za 7384, nema podataka a od ovih koji su odgovorili 74,8% je reklo da je primilo platu od lokalnog poslodavca. Pitanje se odnosi na CETVRTOG clana familije

QA02_YN_04_S12
Did you receive salary of employees working for a foreign employer in BiH in the last 12 months?

hbs_short$QA02_YN_04_S12 [[2]]
## <labelled<double>[1]>: Did you receive salary of employees working for a foreign employer in BiH in the last 12 months?
## [1] NA
## 
## Labels:
##  value      label
##      1         da
##      2         ne
##      8    Refusal
##      9 Don't Know
str(hbs_short$QA02_YN_04_S12)
##  dbl+lbl [1:7702] NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N...
##  @ label        : chr "Did you receive salary of employees working for a foreign employer in BiH in the last 12 months?"
##  @ format.spss  : chr "F1.0"
##  @ display_width: int 17
##  @ labels       : Named num [1:4] 1 2 8 9
##   ..- attr(*, "names")= chr [1:4] "da" "ne" "Refusal" "Don't Know"
summary(hbs_short$QA02_YN_04_S12)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##   1.000   2.000   2.000   1.985   2.000   2.000    7441
prop.table(table(hbs_short$QA02_YN_04_S12))*100
## 
##         1         2 
##  1.532567 98.467433

Od 7702 domacinstava samo na ovo pitanje Da li ste primili platu od poslodavca koji ima sjediste van BiH u zadnjih 12 mjeseci? 7441 nije nista odgovorilo a ovi koji su odgovorili samo su 1,5% su rekli da jesu.

QA03_YN_04_S12 “Did you receive cash (a salary) for work done abroad in the last 12 months?

hbs_short$QA03_YN_04_S12 [[2]]
## <labelled<double>[1]>: Did you receive cash (a salary) for work done abroad in the last 12 months?
## [1] NA
## 
## Labels:
##  value      label
##      1         da
##      2         ne
##      8    Refusal
##      9 Don't Know
str(hbs_short$QA03_YN_04_S12)
##  dbl+lbl [1:7702] NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N...
##  @ label        : chr "Did you receive cash (a salary) for work done abroad in the last 12 months?"
##  @ format.spss  : chr "F1.0"
##  @ display_width: int 17
##  @ labels       : Named num [1:4] 1 2 8 9
##   ..- attr(*, "names")= chr [1:4] "da" "ne" "Refusal" "Don't Know"
summary(hbs_short$QA03_YN_04_S12)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##    1.00    2.00    2.00    1.95    2.00    2.00    7440
prop.table(table(hbs_short$QA03_YN_04_S12))
## 
##          1          2 
## 0.04961832 0.95038168

Na ovo pitanje 7440 nije dalo niakka odgovor a od ovih koji jesu samo 0,05% je odgovorilo da su dobili platu za rad u inostranstvu

QA04_YN_04_S12
Did you receive fee for work done by you for a local employer based on a contract for services rendered, author”

hbs_short$QA04_YN_04_S12 [[2]]
## <labelled<double>[1]>: Did you receive fee for work done by you for a local employer based on a contract for services rendered, author-ship contract and occasional and temporary jobs or agreementsin the last 12 months?
## [1] NA
## 
## Labels:
##  value      label
##      1         da
##      2         ne
##      8    Refusal
##      9 Don't Know
str(hbs_short$QA04_YN_04_S12)
##  dbl+lbl [1:7702] NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N...
##  @ label        : chr "Did you receive fee for work done by you for a local employer based on a contract for services rendered, author"| __truncated__
##  @ format.spss  : chr "F1.0"
##  @ display_width: int 17
##  @ labels       : Named num [1:4] 1 2 8 9
##   ..- attr(*, "names")= chr [1:4] "da" "ne" "Refusal" "Don't Know"
summary(hbs_short$QA04_YN_04_S12)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##   1.000   2.000   2.000   1.943   2.000   2.000    7439
prop.table(table(hbs_short$QA04_YN_04_S12))*100
## 
##         1         2 
##  5.703422 94.296578

Od ukupnog broja 7439 nije odgovorilo na ovo pitanja, a ovi koji su odgovorili samo 5,7% je odgovorilo da su primili.

QA05_YN_04_S12
Did you receive Fee for work done by you for a foreign employer in BiH based on a contract for services rendere

hbs_short$QA05_YN_04_S12 [[2]]
## <labelled<double>[1]>: Did you receive Fee for work done by you for a foreign employer in BiH based on a contract for services rendered, authorship contract and occasional and temporary jobs or agreements with a local employer in the last 12 months?
## [1] NA
## 
## Labels:
##  value      label
##      1         da
##      2         ne
##      8    Refusal
##      9 Don't Know
str(hbs_short$QA05_YN_04_S12)
##  dbl+lbl [1:7702] NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N...
##  @ label        : chr "Did you receive Fee for work done by you for a foreign employer in BiH based on a contract for services rendere"| __truncated__
##  @ format.spss  : chr "F1.0"
##  @ display_width: int 17
##  @ labels       : Named num [1:4] 1 2 8 9
##   ..- attr(*, "names")= chr [1:4] "da" "ne" "Refusal" "Don't Know"
summary(hbs_short$QA05_YN_04_S12)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##   1.000   2.000   2.000   1.996   2.000   2.000    7442
prop.table(table(hbs_short$QA05_YN_04_S12))
## 
##           1           2 
## 0.003846154 0.996153846

Od 7702 7442 nije odgovorilo, a ovi sto su odgovorili samo 0.003% je reklo da jeste.

QA06_YN_04_S12

Did you receive fee for work done by you for an employer abroad BiH based on a contract for services rendered, au-thorship contract and occasional and temporary jobs or agreements with a local employer in the last 12 months?

hbs_short$QA06_YN_04_S12 [[2]]
## <labelled<double>[1]>: Did you receive fee for work done by you for an employer abroad BiH based on a contract for services rendered, au-thorship contract and occasional and temporary jobs or agreements with a local employer in the last 12 months?
## [1] NA
## 
## Labels:
##  value      label
##      1         da
##      2         ne
##      8    Refusal
##      9 Don't Know
str(hbs_short$QA06_YN_04_S12)
##  dbl+lbl [1:7702] NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N...
##  @ label        : chr "Did you receive fee for work done by you for an employer abroad BiH based on a contract for services rendered, "| __truncated__
##  @ format.spss  : chr "F1.0"
##  @ display_width: int 17
##  @ labels       : Named num [1:4] 1 2 8 9
##   ..- attr(*, "names")= chr [1:4] "da" "ne" "Refusal" "Don't Know"
summary(hbs_short$QA06_YN_04_S12)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##       2       2       2       2       2       2    7443
prop.table(table(hbs_short$QA06_YN_04_S12))*100
## 
##   2 
## 100

NIKO nije primo ovu naknadu a opet oko 7443 je NA

QA07_YN_04_S12 Did you receive meal allowance (excludes coupons and meals) in the last 12 months?

hbs_short$QA07_YN_04_S12 [[2]]
## <labelled<double>[1]>: Did you receive meal allowance (excludes coupons and meals) in the last 12 months?
## [1] NA
## 
## Labels:
##  value      label
##      1         da
##      2         ne
##      8    Refusal
##      9 Don't Know
str(hbs_short$QA07_YN_04_S12)
##  dbl+lbl [1:7702] NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N...
##  @ label        : chr "Did you receive meal allowance (excludes coupons and meals) in the last 12 months?"
##  @ format.spss  : chr "F1.0"
##  @ display_width: int 17
##  @ labels       : Named num [1:4] 1 2 8 9
##   ..- attr(*, "names")= chr [1:4] "da" "ne" "Refusal" "Don't Know"
summary(hbs_short$QA07_YN_04_S12)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##   1.000   2.000   2.000   1.776   2.000   2.000    7439
prop.table(table(hbs_short$QA07_YN_04_S12))*100
## 
##        1        2 
## 22.43346 77.56654

7439 nije odgovorilo, 22,4% je primilo topli obrok

QA08_YN_04_S12 Did you receive transport allowance to and from work (excludes coupons) in the last 12 months?

hbs_short$QA08_YN_04_S12 [[2]]
## <labelled<double>[1]>: Did you receive transport allowance to and from work (excludes coupons)  in the last 12 months?
## [1] NA
## 
## Labels:
##  value      label
##      1         da
##      2         ne
##      8    Refusal
##      9 Don't Know
str(hbs_short$QA08_YN_04_S12)
##  dbl+lbl [1:7702] NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N...
##  @ label        : chr "Did you receive transport allowance to and from work (excludes coupons)  in the last 12 months?"
##  @ format.spss  : chr "F1.0"
##  @ display_width: int 17
##  @ labels       : Named num [1:4] 1 2 8 9
##   ..- attr(*, "names")= chr [1:4] "da" "ne" "Refusal" "Don't Know"
summary(hbs_short$QA08_YN_04_S12)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##   1.000   2.000   2.000   1.928   2.000   2.000    7439
prop.table(table(hbs_short$QA08_YN_04_S12))*100
## 
##         1         2 
##  7.224335 92.775665

od ovih koji su odgovorili 7,2% ih je primilo putne troskove.

QA09_YN_04_S12

hbs_short$QA09_YN_04_S12 [[2]]
## <labelled<double>[1]>: Did you receive allowance for living in other town in the last 12 months?
## [1] NA
## 
## Labels:
##  value      label
##      1         da
##      2         ne
##      8    Refusal
##      9 Don't Know
str(hbs_short$QA09_YN_04_S12)
##  dbl+lbl [1:7702] NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N...
##  @ label        : chr "Did you receive allowance for living in other town in the last 12 months?"
##  @ format.spss  : chr "F1.0"
##  @ display_width: int 17
##  @ labels       : Named num [1:4] 1 2 8 9
##   ..- attr(*, "names")= chr [1:4] "da" "ne" "Refusal" "Don't Know"
summary(hbs_short$QA09_YN_04_S12)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##       2       2       2       2       2       2    7442
prop.table(table(hbs_short$QA09_YN_04_S12))*100
## 
##   2 
## 100

Od onih koji su odgovorili NIKO NIJE prmili nakandnu ya zivto u drugom gradu.

QA10_YN_04_S12 Did you receive fees for management/supervisory board mem-bers in the last 12 months?

hbs_short$QA10_YN_04_S12 [[2]]
## <labelled<double>[1]>: Did you receive fees for management/supervisory board mem-bers in the last 12 months?
## [1] NA
## 
## Labels:
##  value      label
##      1         da
##      2         ne
##      8    Refusal
##      9 Don't Know
str(hbs_short$QA10_YN_04_S12)
##  dbl+lbl [1:7702] NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N...
##  @ label        : chr "Did you receive fees for management/supervisory board mem-bers in the last 12 months?"
##  @ format.spss  : chr "F1.0"
##  @ display_width: int 17
##  @ labels       : Named num [1:4] 1 2 8 9
##   ..- attr(*, "names")= chr [1:4] "da" "ne" "Refusal" "Don't Know"
summary(hbs_short$QA10_YN_04_S12)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##   1.000   2.000   2.000   1.996   2.000   2.000    7443
prop.table(table(hbs_short$QA10_YN_04_S12))*100
## 
##          1          2 
##  0.3861004 99.6138996

0.36% je primalo naknadu za odvojen zivot.

QA11_YN_04_S12 Did you receive other cash income from employment in the last 12 months?

hbs_short$QA11_YN_04_S12 [[2]]
## <labelled<double>[1]>: Did you receive other cash income from employment in the last 12 months?
## [1] NA
## 
## Labels:
##  value      label
##      1         da
##      2         ne
##      8    Refusal
##      9 Don't Know
str(hbs_short$QA11_YN_04_S12)
##  dbl+lbl [1:7702] NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N...
##  @ label        : chr "Did you receive other cash income from employment in the last 12 months?"
##  @ format.spss  : chr "F1.0"
##  @ display_width: int 17
##  @ labels       : Named num [1:4] 1 2 8 9
##   ..- attr(*, "names")= chr [1:4] "da" "ne" "Refusal" "Don't Know"
summary(hbs_short$QA11_YN_04_S12)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##   1.000   2.000   2.000   1.992   2.000   2.000    7442
prop.table(table(hbs_short$QA11_YN_04_S12))*100
## 
##          1          2 
##  0.7692308 99.2307692

0,76% je primilo drugu naknadnu od zaposlenosti.

QA12_YN_04_S12 Did you receive in-kind income from employment in the last 12 months?

hbs_short$QA12_YN_04_S12 [[2]]
## <labelled<double>[1]>: Did you receive in-kind income from employment  in the last 12 months?
## [1] NA
## 
## Labels:
##  value      label
##      1         da
##      2         ne
##      8    Refusal
##      9 Don't Know
str(hbs_short$QA12_YN_04_S12)
##  dbl+lbl [1:7702] NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N...
##  @ label        : chr "Did you receive in-kind income from employment  in the last 12 months?"
##  @ format.spss  : chr "F1.0"
##  @ display_width: int 17
##  @ labels       : Named num [1:4] 1 2 8 9
##   ..- attr(*, "names")= chr [1:4] "da" "ne" "Refusal" "Don't Know"
summary(hbs_short$QA12_YN_04_S12)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##   1.000   2.000   2.000   1.992   2.000   2.000    7442
prop.table(table(hbs_short$QA12_YN_04_S12))*100
## 
##          1          2 
##  0.7692308 99.2307692

7442 je NA a 0,77% je primilo ovu nakandu

QA14_YN_04_S12 Did you receive earnings for work done on your own agricultural holding/s in the last 12 months?

hbs_short$QA14_YN_04_S12 [[2]]
## <labelled<double>[1]>: Did you receive earnings for work done on your own agricultural holding/s in the last 12 months?
## [1] NA
## 
## Labels:
##  value      label
##      1         da
##      2         ne
##      8    Refusal
##      9 Don't Know
str(hbs_short$QA14_YN_04_S12)
##  dbl+lbl [1:7702] NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N...
##  @ label        : chr "Did you receive earnings for work done on your own agricultural holding/s in the last 12 months?"
##  @ format.spss  : chr "F1.0"
##  @ display_width: int 17
##  @ labels       : Named num [1:4] 1 2 8 9
##   ..- attr(*, "names")= chr [1:4] "da" "ne" "Refusal" "Don't Know"
summary(hbs_short$QA14_YN_04_S12)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##   1.000   2.000   2.000   1.809   2.000   2.000    7425
prop.table(table(hbs_short$QA14_YN_04_S12))*100
## 
##        1        2 
## 19.13357 80.86643

19,1% je primalo nakandu za poljoprivredu 7425 IS NA

QA15_YN_04_S12 id you receive earnings for trade and free professions (lawyers, painters, singers, etc.) in the last 12 months?

hbs_short$QA15_YN_04_S12 [[2]]
## <labelled<double>[1]>: Did you receive earnings for trade and free professions (lawyers, painters, singers, etc.) in the last 12 months?
## [1] NA
## 
## Labels:
##  value      label
##      1         da
##      2         ne
##      8    Refusal
##      9 Don't Know
str(hbs_short$QA15_YN_04_S12)
##  dbl+lbl [1:7702] NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N...
##  @ label        : chr "Did you receive earnings for trade and free professions (lawyers, painters, singers, etc.) in the last 12 months?"
##  @ format.spss  : chr "F1.0"
##  @ display_width: int 17
##  @ labels       : Named num [1:4] 1 2 8 9
##   ..- attr(*, "names")= chr [1:4] "da" "ne" "Refusal" "Don't Know"
summary(hbs_short$QA15_YN_04_S12)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##   1.000   2.000   2.000   1.977   2.000   2.000    7443
prop.table(table(hbs_short$QA15_YN_04_S12))*100
## 
##         1         2 
##  2.316602 97.683398

2,3% ih je primilo ovaj vid nakande

QA16_YN_04_S12 Did you receive income from interest, savings, dividends or profit from capital investment in the last 12 months?

hbs_short$QA16_YN_04_S12 [[2]]
## <labelled<double>[1]>: Did you receive income from interest, savings, dividends or profit from capital investment in the last 12 months?
## [1] NA
## 
## Labels:
##  value      label
##      1         da
##      2         ne
##      8    Refusal
##      9 Don't Know
str(hbs_short$QA16_YN_04_S12)
##  dbl+lbl [1:7702] NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N...
##  @ label        : chr "Did you receive income from interest, savings, dividends or profit from capital investment in the last 12 months?"
##  @ format.spss  : chr "F1.0"
##  @ display_width: int 17
##  @ labels       : Named num [1:4] 1 2 8 9
##   ..- attr(*, "names")= chr [1:4] "da" "ne" "Refusal" "Don't Know"
summary(hbs_short$QA16_YN_04_S12)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##       2       2       2       2       2       2    7442
prop.table(table(hbs_short$QA16_YN_04_S12))*100
## 
##   2 
## 100

Kamate i dividnede samo NIKO

QA17_YN_04_S12 Did you receive income from the rent of landinG the last 12 months?

hbs_short$QA17_YN_04_S12 [[2]]
## <labelled<double>[1]>: Did you receive income from the rent of landin the last 12 months?
## [1] NA
## 
## Labels:
##  value      label
##      1         da
##      2         ne
##      8    Refusal
##      9 Don't Know
str(hbs_short$QA17_YN_04_S12)
##  dbl+lbl [1:7702] NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N...
##  @ label        : chr "Did you receive income from the rent of landin the last 12 months?"
##  @ format.spss  : chr "F1.0"
##  @ display_width: int 17
##  @ labels       : Named num [1:4] 1 2 8 9
##   ..- attr(*, "names")= chr [1:4] "da" "ne" "Refusal" "Don't Know"
summary(hbs_short$QA17_YN_04_S12)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##       2       2       2       2       2       2    7442
prop.table(table(hbs_short$QA17_YN_04_S12))*100
## 
##   2 
## 100

NIKO (od odgovorenih)

QA18_YN_04_S12 Did you receive income from the rent of residential premises in the last 12 months?

hbs_short$QA18_YN_04_S12 [[2]]
## <labelled<double>[1]>: Did you receive income from the rent of residential premises in the last 12 months?
## [1] NA
## 
## Labels:
##  value      label
##      1         da
##      2         ne
##      8    Refusal
##      9 Don't Know
str(hbs_short$QA18_YN_04_S12)
##  dbl+lbl [1:7702] NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N...
##  @ label        : chr "Did you receive income from the rent of residential premises in the last 12 months?"
##  @ format.spss  : chr "F1.0"
##  @ display_width: int 17
##  @ labels       : Named num [1:4] 1 2 8 9
##   ..- attr(*, "names")= chr [1:4] "da" "ne" "Refusal" "Don't Know"
summary(hbs_short$QA18_YN_04_S12)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##       2       2       2       2       2       2    7442
prop.table(table(hbs_short$QA18_YN_04_S12))*100
## 
##   2 
## 100

NIKO

QA19_YN_04_S12 Did you receive income from the rent of business premises, gar-ages, etc. in the last 12 months?”

hbs_short$QA19_YN_04_S12 [[2]]
## <labelled<double>[1]>: Did you receive income from the rent of business premises, gar-ages, etc. in the last 12 months?
## [1] NA
## 
## Labels:
##  value      label
##      1         da
##      2         ne
##      8    Refusal
##      9 Don't Know
str(hbs_short$QA19_YN_04_S12)
##  dbl+lbl [1:7702] NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N...
##  @ label        : chr "Did you receive income from the rent of business premises, gar-ages, etc. in the last 12 months?"
##  @ format.spss  : chr "F1.0"
##  @ display_width: int 17
##  @ labels       : Named num [1:4] 1 2 8 9
##   ..- attr(*, "names")= chr [1:4] "da" "ne" "Refusal" "Don't Know"
summary(hbs_short$QA19_YN_04_S12)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##       2       2       2       2       2       2    7442
prop.table(table(hbs_short$QA19_YN_04_S12))*100
## 
##   2 
## 100

NIKO OD odgovorenih iydavalo posl.prostore garaze i slicno

QA20_YN_04_S12 Did you receive income from the rent of equipment, cattle, etc. in the last 12 months?

hbs_short$QA20_YN_04_S12 [[2]]
## <labelled<double>[1]>: Did you receive income from the rent of equipment, cattle, etc. in the last 12 months?
## [1] NA
## 
## Labels:
##  value      label
##      1         da
##      2         ne
##      8    Refusal
##      9 Don't Know
str(hbs_short$QA20_YN_04_S12)
##  dbl+lbl [1:7702] NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N...
##  @ label        : chr "Did you receive income from the rent of equipment, cattle, etc. in the last 12 months?"
##  @ format.spss  : chr "F1.0"
##  @ display_width: int 17
##  @ labels       : Named num [1:4] 1 2 8 9
##   ..- attr(*, "names")= chr [1:4] "da" "ne" "Refusal" "Don't Know"
summary(hbs_short$QA20_YN_04_S12)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##       2       2       2       2       2       2    7442
prop.table(table(hbs_short$QA20_YN_04_S12))*100
## 
##   2 
## 100

NIKO

QA21_YN_04_S12 - OVO VJEROVATNO NE JER NIJE OD POSLA NEGO NEKA DOYNAKA Did you receive money from other households or persons in BiH in the last 12 months?

hbs_short$QA21_YN_04_S12 [[2]]
## <labelled<double>[1]>: Did you receive money from other households or persons in BiH in the last 12 months?
## [1] NA
## 
## Labels:
##  value      label
##      1         da
##      2         ne
##      8    Refusal
##      9 Don't Know
str(hbs_short$QA21_YN_04_S12)
##  dbl+lbl [1:7702] NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N...
##  @ label        : chr "Did you receive money from other households or persons in BiH in the last 12 months?"
##  @ format.spss  : chr "F1.0"
##  @ display_width: int 17
##  @ labels       : Named num [1:4] 1 2 8 9
##   ..- attr(*, "names")= chr [1:4] "da" "ne" "Refusal" "Don't Know"
summary(hbs_short$QA21_YN_04_S12)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##       2       2       2       2       2       2    7442
prop.table(table(hbs_short$QA21_YN_04_S12))*100
## 
##   2 
## 100

NIKO

QA22_YN_04_S12 - OVO VJEROVATNO NE JER NIJE OD POSLA NEGO NEKA DOYNAKA Did you receive money from other households or persons abroad (remittances) in the last 12 months?

hbs_short$QA22_YN_04_S12 [[2]]
## <labelled<double>[1]>: Did you receive money from other households or persons abroad (remittances) in the last 12 months?
## [1] NA
## 
## Labels:
##  value      label
##      1         da
##      2         ne
##      8    Refusal
##      9 Don't Know
str(hbs_short$QA22_YN_04_S12)
##  dbl+lbl [1:7702] NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N...
##  @ label        : chr "Did you receive money from other households or persons abroad (remittances) in the last 12 months?"
##  @ format.spss  : chr "F1.0"
##  @ display_width: int 17
##  @ labels       : Named num [1:4] 1 2 8 9
##   ..- attr(*, "names")= chr [1:4] "da" "ne" "Refusal" "Don't Know"
summary(hbs_short$QA22_YN_04_S12)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##   1.000   2.000   2.000   1.969   2.000   2.000    7442
prop.table(table(hbs_short$QA22_YN_04_S12))*100
## 
##         1         2 
##  3.076923 96.923077

3% jesu

QA23_YN_04_S12 - Did you receive salary of employees working for a local employer in the last 12 months? Detalji oko ove vrste zaposlenosti odnose se na cuvanje djece, prosnja, prevod.. itd

hbs_short$QA23_YN_04_S12 [[2]]
## <labelled<double>[1]>: Did you receive salary of employees working for a local employer in the last 12 months?
## [1] NA
## 
## Labels:
##  value      label
##      1         da
##      2         ne
##      8    Refusal
##      9 Don't Know
str(hbs_short$QA23_YN_04_S12)
##  dbl+lbl [1:7702] NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N...
##  @ label        : chr "Did you receive salary of employees working for a local employer in the last 12 months?"
##  @ format.spss  : chr "F1.0"
##  @ display_width: int 17
##  @ labels       : Named num [1:4] 1 2 8 9
##   ..- attr(*, "names")= chr [1:4] "da" "ne" "Refusal" "Don't Know"
summary(hbs_short$QA23_YN_04_S12)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##   1.000   2.000   2.000   1.954   2.000   2.000    7439
prop.table(table(hbs_short$QA23_YN_04_S12))*100
## 
##         1         2 
##  4.562738 95.437262

4.5% je primilo ovu nakandu

Sada cu sabrati za svakog clana domacinstva koji su rekli da su primili neku od nakanda i vidjeti koliko mi to pokriva opstina

hbs_short$amr.NEWINCOM <- rowSums(hbs_short[,c("Q02_YN_01_S12","Q02_YN_02_S12","Q02_YN_03_S12","Q02_YN_04_S12","Q02_YN_05_S12","Q02_YN_06_S12", "Q02_YN_07_S12", "Q02_YN_08_S12", "Q02_YN_09_S12","Q02_YN_10_S12","Q02_YN_11_S12","Q02_YN_12_S12", "Q02_YN_13_S12")],na.rm = T)

table(hbs_short$amr.NEWINCOM)
## 
##    0    1    2    3    4    5    6    7    8    9   10   11   12   13   14   15 
##   44  592 1583 1297 1598  900  697  500  231  134   63   39   11    7    1    3 
##   18 
##    2

Prema ovoma samo u 44 domacinstava ni jedan clan ne dobiva nsita sto je navedeno u piatanjama QA01 - QA23.

Plan za dalje: 1. Za svaku varijablu koja ima neki inkom izracunati mjesecne izdatke i za svakog clana. jer imaju i iznos a ima i koliko mjesecno je primao, tako da to treba mnoziti sa kolonom broj mjeseci pa dijeli sa brojem 12. 2. Nakon toga cu da izracunam mjesecna primanja za svakog clana domacinstva 3. Necu racunati allowance jer to nije zarada niti cu stavljati iznamljivanje zemlje, garaze i slicen rente jer i to mi nije zarada. Ali cu prije svega PITATI ISMIRA, KOJE VARIJABLE DA IZBACIM 4. Onda cu to sve sabrati i imacu mjesecnu zaradu po domacinstvu.

ZA PLATE UZIMAM SVAKOG CLANA PORODICE POSEBNO

  1. _IZBACUJEM S2, _S6, _S7, _S10, COICOP, Samo prvih osam clanova izdvajati, jer npr za 9-og clana QA01_YN_09_S12 samo je jedan primio remitencices, 10 nije nisa, _S11 brisati to su penzije, QBizbaciti to su penzije, a ostaviti QA, to je income, izbaciti QC, QD,
library(dplyr)

hbs_wage <- hbs_short %>% select(contains(c( "SifraDom","Entity","Canton","naziv_opcine","RurUrb","ncomp","finweight","Relat","Sex","Age", "Educ","Activ", "HH_Monthly", "QA")))
##815 varijabla

#remove additional unnecessary varialbles

hbs_wage <- hbs_wage  %>% select(-c(M_Entity, M_Canton_Region, Relat_9, Relat_10, Relat_11, Relat_12, Relat_13, Sex_9, Sex_10, Sex_11, Sex_12, Sex_13, Age_9, Age_10, Age_11, Age_12, Age_13, Educ_9, Educ_10, Educ_11, Educ_12,Educ_13))
#794 varijabli
hbs_wage <- hbs_wage  %>% select(!contains(c("Class","now","Level")))
##754 varijabli
hbs_wage <- hbs_wage  %>% select(-c(Activ_9, Activ_10, Activ_11, Activ_12, Activ_13, HH_Monthly_Consumption, HH_Monthly_Consumption_Equilized))
#748
hbs_wage <- hbs_wage  %>% select(-contains(c("QA16","QA17","QA18", "QA19", "QA20", "QA22", "QA21","_09_S12", "_10_S12")))
#440

##FAZA 2

SADA PRVO FORMIRAM WAGE ZA SVAKOG CLANA DOMACINSTVA ZA INCOME

mjesecno all wage for 1st household

library(haven)
hbs_wage$QA01_01_mj <- (hbs_wage$QA01_IN_01_S12*hbs_wage$QA01_NM_01_S12)/12
hbs_wage$QA02_01_mj <- (hbs_wage$QA02_IN_01_S12*hbs_wage$QA02_NM_01_S12)/12
hbs_wage$QA03_01_mj <- (hbs_wage$QA03_IN_01_S12*hbs_wage$QA03_NM_01_S12)/12
hbs_wage$QA04_01_mj <- (hbs_wage$QA04_IN_01_S12*hbs_wage$QA04_NM_01_S12)/12
hbs_wage$QA05_01_mj <- (hbs_wage$QA05_IN_01_S12*hbs_wage$QA05_NM_01_S12)/12
hbs_wage$QA06_01_mj <- (hbs_wage$QA06_IN_01_S12*hbs_wage$QA06_NM_01_S12)/12
hbs_wage$QA07_01_mj <- (hbs_wage$QA07_IN_01_S12*hbs_wage$QA07_NM_01_S12)/12
hbs_wage$QA08_01_mj <- (hbs_wage$QA08_IN_01_S12*hbs_wage$QA08_NM_01_S12)/12
hbs_wage$QA09_01_mj <- (hbs_wage$QA09_IN_01_S12*hbs_wage$QA09_NM_01_S12)/12
hbs_wage$QA10_01_mj <- (hbs_wage$QA10_IN_01_S12*hbs_wage$QA10_NM_01_S12)/12
hbs_wage$QA11_01_mj <- (hbs_wage$QA11_IN_01_S12*hbs_wage$QA11_NM_01_S12)/12
hbs_wage$QA12_01_mj <- (hbs_wage$QA12_IN_01_S12*hbs_wage$QA12_NM_01_S12)/12
hbs_wage$QA13_01_mj <- (hbs_wage$QA13_IN_01_S12*hbs_wage$QA13_NM_01_S12)/12
hbs_wage$QA14_01_mj <- (hbs_wage$QA14_IN_01_S12*hbs_wage$QA14_NM_01_S12)/12
hbs_wage$QA15_01_mj <- (hbs_wage$QA15_IN_01_S12*hbs_wage$QA15_NM_01_S12)/12
hbs_wage$QA23_01_mj <- (hbs_wage$QA23_IN_01_S12*hbs_wage$QA23_NM_01_S12)/12

Mjesecno sva primanja za prvog householda

hbs_wage$QA_01_all_mj <- rowSums(hbs_wage[,c("QA01_01_mj","QA02_01_mj","QA03_01_mj","QA04_01_mj","QA05_01_mj","QA06_01_mj", "QA07_01_mj", "QA08_01_mj", "QA09_01_mj","QA10_01_mj","QA11_01_mj","QA12_01_mj","QA13_01_mj", "QA14_01_mj", "QA15_01_mj", "QA23_01_mj")],na.rm = T)
summary(hbs_wage$QA_01_all_mj)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##     0.0     0.0     0.0   290.0   466.7 18350.0
plot(density(hbs_wage$QA_01_all_mj))

mjesecno all wage for 2nd household

hbs_wage$QA01_02_mj <- (hbs_wage$QA01_IN_02_S12*hbs_wage$QA01_NM_02_S12)/12
hbs_wage$QA02_02_mj <- (hbs_wage$QA02_IN_02_S12*hbs_wage$QA02_NM_02_S12)/12
hbs_wage$QA03_02_mj <- (hbs_wage$QA03_IN_02_S12*hbs_wage$QA03_NM_02_S12)/12
hbs_wage$QA04_02_mj <- (hbs_wage$QA04_IN_02_S12*hbs_wage$QA04_NM_02_S12)/12
hbs_wage$QA05_02_mj <- (hbs_wage$QA05_IN_02_S12*hbs_wage$QA05_NM_02_S12)/12
hbs_wage$QA06_02_mj <- (hbs_wage$QA06_IN_02_S12*hbs_wage$QA06_NM_02_S12)/12
hbs_wage$QA07_02_mj <- (hbs_wage$QA07_IN_02_S12*hbs_wage$QA07_NM_02_S12)/12
hbs_wage$QA08_02_mj <- (hbs_wage$QA08_IN_02_S12*hbs_wage$QA08_NM_02_S12)/12
hbs_wage$QA09_02_mj <- (hbs_wage$QA09_IN_02_S12*hbs_wage$QA09_NM_02_S12)/12
hbs_wage$QA10_02_mj <- (hbs_wage$QA10_IN_02_S12*hbs_wage$QA10_NM_02_S12)/12
hbs_wage$QA11_02_mj <- (hbs_wage$QA11_IN_02_S12*hbs_wage$QA11_NM_02_S12)/12
hbs_wage$QA12_02_mj <- (hbs_wage$QA12_IN_02_S12*hbs_wage$QA12_NM_02_S12)/12
hbs_wage$QA13_02_mj <- (hbs_wage$QA13_IN_02_S12*hbs_wage$QA13_NM_02_S12)/12
hbs_wage$QA14_02_mj <- (hbs_wage$QA14_IN_02_S12*hbs_wage$QA14_NM_02_S12)/12
hbs_wage$QA15_02_mj <- (hbs_wage$QA15_IN_02_S12*hbs_wage$QA15_NM_02_S12)/12
hbs_wage$QA23_02_mj <- (hbs_wage$QA23_IN_02_S12*hbs_wage$QA23_NM_02_S12)/12

Mjesecno sva primanja za drugog householda

hbs_wage$QA_02_all_mj <- rowSums(hbs_wage[,c("QA01_02_mj","QA02_02_mj","QA03_02_mj","QA04_02_mj","QA05_02_mj","QA06_02_mj", "QA07_02_mj", "QA08_02_mj", "QA09_02_mj","QA10_02_mj","QA11_02_mj","QA12_02_mj","QA13_02_mj", "QA14_02_mj", "QA15_02_mj", "QA23_02_mj")],na.rm = T)
hbs_wage$QA_02_all_mj <- as.numeric(hbs_wage$QA_02_all_mj)
summary(hbs_wage$QA_02_all_mj)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##     0.0     0.0     0.0   140.9     0.0 12833.3
str(hbs_wage$QA_02_all_mj)
##  num [1:7702] 0 0 0 0 0 0 0 0 0 0 ...
plot(density(hbs_wage$QA_02_all_mj))

mjesecno all wage for 3nd household

hbs_wage$QA01_03_mj <- (hbs_wage$QA01_IN_03_S12*hbs_wage$QA01_NM_03_S12)/12
hbs_wage$QA02_03_mj <- (hbs_wage$QA02_IN_03_S12*hbs_wage$QA02_NM_03_S12)/12
hbs_wage$QA03_03_mj <- (hbs_wage$QA03_IN_03_S12*hbs_wage$QA03_NM_03_S12)/12
hbs_wage$QA04_03_mj <- (hbs_wage$QA04_IN_03_S12*hbs_wage$QA04_NM_03_S12)/12
hbs_wage$QA05_03_mj <- (hbs_wage$QA05_IN_03_S12*hbs_wage$QA05_NM_03_S12)/12
hbs_wage$QA06_03_mj <- (hbs_wage$QA06_IN_03_S12*hbs_wage$QA06_NM_03_S12)/12
hbs_wage$QA07_03_mj <- (hbs_wage$QA07_IN_03_S12*hbs_wage$QA07_NM_03_S12)/12
hbs_wage$QA08_03_mj <- (hbs_wage$QA08_IN_03_S12*hbs_wage$QA08_NM_03_S12)/12
hbs_wage$QA09_03_mj <- (hbs_wage$QA09_IN_03_S12*hbs_wage$QA09_NM_03_S12)/12
hbs_wage$QA10_03_mj <- (hbs_wage$QA10_IN_03_S12*hbs_wage$QA10_NM_03_S12)/12
hbs_wage$QA11_03_mj <- (hbs_wage$QA11_IN_03_S12*hbs_wage$QA11_NM_03_S12)/12
hbs_wage$QA12_03_mj <- (hbs_wage$QA12_IN_03_S12*hbs_wage$QA12_NM_03_S12)/12
hbs_wage$QA13_03_mj <- (hbs_wage$QA13_IN_03_S12*hbs_wage$QA13_NM_03_S12)/12
hbs_wage$QA14_03_mj <- (hbs_wage$QA14_IN_03_S12*hbs_wage$QA14_NM_03_S12)/12
hbs_wage$QA15_03_mj <- (hbs_wage$QA15_IN_03_S12*hbs_wage$QA15_NM_03_S12)/12
hbs_wage$QA23_03_mj <- (hbs_wage$QA23_IN_03_S12*hbs_wage$QA23_NM_03_S12)/12

Mjesecno sva primanja za treci householda

hbs_wage$QA_03_all_mj <- rowSums(hbs_wage[,c("QA01_03_mj","QA02_03_mj","QA03_03_mj","QA04_03_mj","QA05_03_mj","QA06_03_mj", "QA07_03_mj", "QA08_03_mj", "QA09_03_mj","QA10_03_mj","QA11_03_mj","QA12_03_mj","QA13_03_mj", "QA14_03_mj", "QA15_03_mj", "QA23_03_mj")],na.rm = T)
hbs_wage$QA_03_all_mj <- as.numeric(hbs_wage$QA_03_all_mj)
summary(hbs_wage$QA_03_all_mj)
##     Min.  1st Qu.   Median     Mean  3rd Qu.     Max. 
##     0.00     0.00     0.00    75.06     0.00 12000.00
str(hbs_wage$QA_03_all_mj)
##  num [1:7702] 0 0 0 0 0 0 0 0 0 0 ...
plot(density(hbs_wage$QA_03_all_mj))

mjesecno all wage for 4th household

hbs_wage$QA01_04_mj <- (hbs_wage$QA01_IN_04_S12*hbs_wage$QA01_NM_04_S12)/12
hbs_wage$QA02_04_mj <- (hbs_wage$QA02_IN_04_S12*hbs_wage$QA02_NM_04_S12)/12
hbs_wage$QA03_04_mj <- (hbs_wage$QA03_IN_04_S12*hbs_wage$QA03_NM_04_S12)/12
hbs_wage$QA04_04_mj <- (hbs_wage$QA04_IN_04_S12*hbs_wage$QA04_NM_04_S12)/12
hbs_wage$QA05_04_mj <- (hbs_wage$QA05_IN_04_S12*hbs_wage$QA05_NM_04_S12)/12
hbs_wage$QA06_04_mj <- (hbs_wage$QA06_IN_04_S12*hbs_wage$QA06_NM_04_S12)/12
hbs_wage$QA07_04_mj <- (hbs_wage$QA07_IN_04_S12*hbs_wage$QA07_NM_04_S12)/12
hbs_wage$QA08_04_mj <- (hbs_wage$QA08_IN_04_S12*hbs_wage$QA08_NM_04_S12)/12
hbs_wage$QA09_04_mj <- (hbs_wage$QA09_IN_04_S12*hbs_wage$QA09_NM_04_S12)/12
hbs_wage$QA10_04_mj <- (hbs_wage$QA10_IN_04_S12*hbs_wage$QA10_NM_04_S12)/12
hbs_wage$QA11_04_mj <- (hbs_wage$QA11_IN_04_S12*hbs_wage$QA11_NM_04_S12)/12
hbs_wage$QA12_04_mj <- (hbs_wage$QA12_IN_04_S12*hbs_wage$QA12_NM_04_S12)/12
hbs_wage$QA13_04_mj <- (hbs_wage$QA13_IN_04_S12*hbs_wage$QA13_NM_04_S12)/12
hbs_wage$QA14_04_mj <- (hbs_wage$QA14_IN_04_S12*hbs_wage$QA14_NM_04_S12)/12
hbs_wage$QA15_04_mj <- (hbs_wage$QA15_IN_04_S12*hbs_wage$QA15_NM_04_S12)/12
hbs_wage$QA23_04_mj <- (hbs_wage$QA23_IN_04_S12*hbs_wage$QA23_NM_04_S12)/12

Mjesecno sva primanja za cetvrta householda

hbs_wage$QA_04_all_mj <- rowSums(hbs_wage[,c("QA01_04_mj","QA02_04_mj","QA03_04_mj","QA04_04_mj","QA05_04_mj","QA06_04_mj", "QA07_04_mj", "QA08_04_mj", "QA09_04_mj","QA10_04_mj","QA11_04_mj","QA12_04_mj","QA13_04_mj", "QA14_04_mj", "QA15_04_mj", "QA23_04_mj")],na.rm = T)
hbs_wage$QA_04_all_mj <- as.numeric(hbs_wage$QA_04_all_mj)
summary(hbs_wage$QA_04_all_mj)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##    0.00    0.00    0.00   21.41    0.00 4583.33
str(hbs_wage$QA_04_all_mj)
##  num [1:7702] 0 0 0 0 0 0 0 0 0 0 ...
plot(density(hbs_wage$QA_04_all_mj))

mjesecno all wage for 5th household

hbs_wage$QA01_05_mj <- (hbs_wage$QA01_IN_05_S12*hbs_wage$QA01_NM_05_S12)/12
hbs_wage$QA02_05_mj <- (hbs_wage$QA02_IN_05_S12*hbs_wage$QA02_NM_05_S12)/12
hbs_wage$QA03_05_mj <- (hbs_wage$QA03_IN_05_S12*hbs_wage$QA03_NM_05_S12)/12
hbs_wage$QA04_05_mj <- (hbs_wage$QA04_IN_05_S12*hbs_wage$QA04_NM_05_S12)/12
hbs_wage$QA05_05_mj <- (hbs_wage$QA05_IN_05_S12*hbs_wage$QA05_NM_05_S12)/12
hbs_wage$QA06_05_mj <- (hbs_wage$QA06_IN_05_S12*hbs_wage$QA06_NM_05_S12)/12
hbs_wage$QA07_05_mj <- (hbs_wage$QA07_IN_05_S12*hbs_wage$QA07_NM_05_S12)/12
hbs_wage$QA08_05_mj <- (hbs_wage$QA08_IN_05_S12*hbs_wage$QA08_NM_05_S12)/12
hbs_wage$QA09_05_mj <- (hbs_wage$QA09_IN_05_S12*hbs_wage$QA09_NM_05_S12)/12
hbs_wage$QA10_05_mj <- (hbs_wage$QA10_IN_05_S12*hbs_wage$QA10_NM_05_S12)/12
hbs_wage$QA11_05_mj <- (hbs_wage$QA11_IN_05_S12*hbs_wage$QA11_NM_05_S12)/12
hbs_wage$QA12_05_mj <- (hbs_wage$QA12_IN_05_S12*hbs_wage$QA12_NM_05_S12)/12
hbs_wage$QA13_05_mj <- (hbs_wage$QA13_IN_05_S12*hbs_wage$QA13_NM_05_S12)/12
hbs_wage$QA14_05_mj <- (hbs_wage$QA14_IN_05_S12*hbs_wage$QA14_NM_05_S12)/12
hbs_wage$QA15_05_mj <- (hbs_wage$QA15_IN_05_S12*hbs_wage$QA15_NM_05_S12)/12
hbs_wage$QA23_05_mj <- (hbs_wage$QA23_IN_05_S12*hbs_wage$QA23_NM_05_S12)/12

Mjesecno sva primanja za petog householda

hbs_wage$QA_05_all_mj <- rowSums(hbs_wage[,c("QA01_05_mj","QA02_05_mj","QA03_05_mj","QA04_05_mj","QA05_05_mj","QA06_05_mj", "QA07_05_mj", "QA08_05_mj", "QA09_05_mj","QA10_05_mj","QA11_05_mj","QA12_05_mj","QA13_05_mj", "QA14_05_mj", "QA15_05_mj", "QA23_05_mj")],na.rm = T)
hbs_wage$QA_05_all_mj <- as.numeric(hbs_wage$QA_05_all_mj)
summary(hbs_wage$QA_05_all_mj)
##     Min.  1st Qu.   Median     Mean  3rd Qu.     Max. 
##    0.000    0.000    0.000    5.061    0.000 1550.000
str(hbs_wage$QA_05_all_mj)
##  num [1:7702] 0 0 0 0 0 0 0 0 0 0 ...
plot(density(hbs_wage$QA_05_all_mj))

mjesecno all wage for 6th household

hbs_wage$QA01_06_mj <- (hbs_wage$QA01_IN_06_S12*hbs_wage$QA01_NM_06_S12)/12
hbs_wage$QA02_06_mj <- (hbs_wage$QA02_IN_06_S12*hbs_wage$QA02_NM_06_S12)/12
hbs_wage$QA03_06_mj <- (hbs_wage$QA03_IN_06_S12*hbs_wage$QA03_NM_06_S12)/12
hbs_wage$QA04_06_mj <- (hbs_wage$QA04_IN_06_S12*hbs_wage$QA04_NM_06_S12)/12
hbs_wage$QA05_06_mj <- (hbs_wage$QA05_IN_06_S12*hbs_wage$QA05_NM_06_S12)/12
hbs_wage$QA06_06_mj <- (hbs_wage$QA06_IN_06_S12*hbs_wage$QA06_NM_06_S12)/12
hbs_wage$QA07_06_mj <- (hbs_wage$QA07_IN_06_S12*hbs_wage$QA07_NM_06_S12)/12
hbs_wage$QA08_06_mj <- (hbs_wage$QA08_IN_06_S12*hbs_wage$QA08_NM_06_S12)/12
hbs_wage$QA09_06_mj <- (hbs_wage$QA09_IN_06_S12*hbs_wage$QA09_NM_06_S12)/12
hbs_wage$QA10_06_mj <- (hbs_wage$QA10_IN_06_S12*hbs_wage$QA10_NM_06_S12)/12
hbs_wage$QA11_06_mj <- (hbs_wage$QA11_IN_06_S12*hbs_wage$QA11_NM_06_S12)/12
hbs_wage$QA12_06_mj <- (hbs_wage$QA12_IN_06_S12*hbs_wage$QA12_NM_06_S12)/12
hbs_wage$QA13_06_mj <- (hbs_wage$QA13_IN_06_S12*hbs_wage$QA13_NM_06_S12)/12
hbs_wage$QA14_06_mj <- (hbs_wage$QA14_IN_06_S12*hbs_wage$QA14_NM_06_S12)/12
hbs_wage$QA15_06_mj <- (hbs_wage$QA15_IN_06_S12*hbs_wage$QA15_NM_06_S12)/12
hbs_wage$QA23_06_mj <- (hbs_wage$QA23_IN_06_S12*hbs_wage$QA23_NM_06_S12)/12

Mjesecno sva primanja za sesti householda

hbs_wage$QA_06_all_mj <- rowSums(hbs_wage[,c("QA01_06_mj","QA02_06_mj","QA03_06_mj","QA04_06_mj","QA05_06_mj","QA06_06_mj", "QA07_06_mj", "QA08_06_mj", "QA09_06_mj","QA10_06_mj","QA11_06_mj","QA12_06_mj","QA13_06_mj", "QA14_06_mj", "QA15_06_mj", "QA23_06_mj")],na.rm = T)
hbs_wage$QA_06_all_mj <- as.numeric(hbs_wage$QA_06_all_mj)
summary(hbs_wage$QA_06_all_mj)
##     Min.  1st Qu.   Median     Mean  3rd Qu.     Max. 
##    0.000    0.000    0.000    2.257    0.000 3500.000
str(hbs_wage$QA_06_all_mj)
##  num [1:7702] 0 0 0 0 0 0 0 0 0 0 ...
plot(density(hbs_wage$QA_06_all_mj))

mjesecno all wage for 7th household

hbs_wage$QA01_07_mj <- (hbs_wage$QA01_IN_07_S12*hbs_wage$QA01_NM_07_S12)/12
hbs_wage$QA02_07_mj <- (hbs_wage$QA02_IN_07_S12*hbs_wage$QA02_NM_07_S12)/12
hbs_wage$QA03_07_mj <- (hbs_wage$QA03_IN_07_S12*hbs_wage$QA03_NM_07_S12)/12
hbs_wage$QA04_07_mj <- (hbs_wage$QA04_IN_07_S12*hbs_wage$QA04_NM_07_S12)/12
hbs_wage$QA05_07_mj <- (hbs_wage$QA05_IN_07_S12*hbs_wage$QA05_NM_07_S12)/12
hbs_wage$QA06_07_mj <- (hbs_wage$QA06_IN_07_S12*hbs_wage$QA06_NM_07_S12)/12
hbs_wage$QA07_07_mj <- (hbs_wage$QA07_IN_07_S12*hbs_wage$QA07_NM_07_S12)/12
hbs_wage$QA08_07_mj <- (hbs_wage$QA08_IN_07_S12*hbs_wage$QA08_NM_07_S12)/12
hbs_wage$QA09_07_mj <- (hbs_wage$QA09_IN_07_S12*hbs_wage$QA09_NM_07_S12)/12
hbs_wage$QA10_07_mj <- (hbs_wage$QA10_IN_07_S12*hbs_wage$QA10_NM_07_S12)/12
hbs_wage$QA11_07_mj <- (hbs_wage$QA11_IN_07_S12*hbs_wage$QA11_NM_07_S12)/12
hbs_wage$QA12_07_mj <- (hbs_wage$QA12_IN_07_S12*hbs_wage$QA12_NM_07_S12)/12
hbs_wage$QA13_07_mj <- (hbs_wage$QA13_IN_07_S12*hbs_wage$QA13_NM_07_S12)/12
hbs_wage$QA14_07_mj <- (hbs_wage$QA14_IN_07_S12*hbs_wage$QA14_NM_07_S12)/12
hbs_wage$QA15_07_mj <- (hbs_wage$QA15_IN_07_S12*hbs_wage$QA15_NM_07_S12)/12
hbs_wage$QA23_07_mj <- (hbs_wage$QA23_IN_07_S12*hbs_wage$QA23_NM_07_S12)/12

Mjesecno sva primanja za sedmog householda

hbs_wage$QA_07_all_mj <- rowSums(hbs_wage[,c("QA01_07_mj","QA02_07_mj","QA03_07_mj","QA04_07_mj","QA05_07_mj","QA06_07_mj", "QA07_07_mj", "QA08_07_mj", "QA09_07_mj","QA10_07_mj","QA11_07_mj","QA12_07_mj","QA13_07_mj", "QA14_07_mj", "QA15_07_mj", "QA23_07_mj")],na.rm = T)
hbs_wage$QA_07_all_mj <- as.numeric(hbs_wage$QA_07_all_mj)
summary(hbs_wage$QA_07_all_mj)
##      Min.   1st Qu.    Median      Mean   3rd Qu.      Max. 
##    0.0000    0.0000    0.0000    0.4068    0.0000 1200.0000
str(hbs_wage$QA_07_all_mj)
##  num [1:7702] 0 0 0 0 0 0 0 0 0 0 ...
plot(density(hbs_wage$QA_07_all_mj))

mjesecno all wage for 8th household

hbs_wage$QA01_08_mj <- (hbs_wage$QA01_IN_08_S12*hbs_wage$QA01_NM_08_S12)/12
hbs_wage$QA02_08_mj <- (hbs_wage$QA02_IN_08_S12*hbs_wage$QA02_NM_08_S12)/12
hbs_wage$QA03_08_mj <- (hbs_wage$QA03_IN_08_S12*hbs_wage$QA03_NM_08_S12)/12
hbs_wage$QA04_08_mj <- (hbs_wage$QA04_IN_08_S12*hbs_wage$QA04_NM_08_S12)/12
hbs_wage$QA05_08_mj <- (hbs_wage$QA05_IN_08_S12*hbs_wage$QA05_NM_08_S12)/12
hbs_wage$QA06_08_mj <- (hbs_wage$QA06_IN_08_S12*hbs_wage$QA06_NM_08_S12)/12
hbs_wage$QA07_08_mj <- (hbs_wage$QA07_IN_08_S12*hbs_wage$QA07_NM_08_S12)/12
hbs_wage$QA08_08_mj <- (hbs_wage$QA08_IN_08_S12*hbs_wage$QA08_NM_08_S12)/12
hbs_wage$QA09_08_mj <- (hbs_wage$QA09_IN_08_S12*hbs_wage$QA09_NM_08_S12)/12
hbs_wage$QA10_08_mj <- (hbs_wage$QA10_IN_08_S12*hbs_wage$QA10_NM_08_S12)/12
hbs_wage$QA11_08_mj <- (hbs_wage$QA11_IN_08_S12*hbs_wage$QA11_NM_08_S12)/12
hbs_wage$QA12_08_mj <- (hbs_wage$QA12_IN_08_S12*hbs_wage$QA12_NM_08_S12)/12
hbs_wage$QA13_08_mj <- (hbs_wage$QA13_IN_08_S12*hbs_wage$QA13_NM_08_S12)/12
hbs_wage$QA14_08_mj <- (hbs_wage$QA14_IN_08_S12*hbs_wage$QA14_NM_08_S12)/12
hbs_wage$QA15_08_mj <- (hbs_wage$QA15_IN_08_S12*hbs_wage$QA15_NM_08_S12)/12
hbs_wage$QA23_08_mj <- (hbs_wage$QA23_IN_08_S12*hbs_wage$QA23_NM_08_S12)/12

Mjesecno sva primanja za osmog householda

hbs_wage$QA_08_all_mj <- rowSums(hbs_wage[,c("QA01_08_mj","QA02_08_mj","QA03_08_mj","QA04_08_mj","QA05_08_mj","QA06_08_mj", "QA07_08_mj", "QA08_08_mj", "QA09_08_mj","QA10_08_mj","QA11_08_mj","QA12_08_mj","QA13_08_mj", "QA14_08_mj", "QA15_08_mj", "QA23_08_mj")],na.rm = T)
hbs_wage$QA_08_all_mj <- as.numeric(hbs_wage$QA_08_all_mj)
summary(hbs_wage$QA_08_all_mj)
##      Min.   1st Qu.    Median      Mean   3rd Qu.      Max. 
##   0.00000   0.00000   0.00000   0.04328   0.00000 200.00000
str(hbs_wage$QA_08_all_mj)
##  num [1:7702] 0 0 0 0 0 0 0 0 0 0 ...
plot(density(hbs_wage$QA_08_all_mj))

NOVI FRAME SAMO SA _mj VARIJABLAMA I SOCIO-EK

hbs_wage.NEW <- hbs_wage %>% select(contains(c("SifraDom", "Entity", "naziv_Opcine", "Relat", "Age", "Activ", "Educ","Rur","Sex", "all_mj")))

FAZA 3- FROM WIDE TO LONG

to summarize specific variables - code

library(tidyr)

hbs_wage.NEW.long <- hbs_wage.NEW %>% pivot_longer(cols = c(starts_with("Age"), starts_with("Relat"), starts_with("Activ"),starts_with("Educ"),starts_with ("Sex") ,contains("_mj")), names_to = c(".value", "Relat"), names_pattern =  "(\\w+).*?(\\d)")
dim(hbs_wage.NEW.long)
## [1] 61616    11
names(hbs_wage.NEW.long)
##  [1] "SifraDom"     "Entity"       "naziv_Opcine" "RurUrb"       "Relat"       
##  [6] "Age_"         "Relat_"       "Activ_"       "Educ_"        "Sex_"        
## [11] "QA_0"

prvo izbaci godine NA i sve ispod 15 godina i preko 80

hbs_wage.NEW.long.1 <- hbs_wage.NEW.long %>% filter(14 < Age_ & Age_<80)
#18548 obseryvacija
table (hbs_wage.NEW.long.1$Activ_)
## 
##    1    2    3    4    5    6    7    8    9 
## 5676  753 1189 1600 3729 1918  433 3066  184
tapply(hbs_wage.NEW.long.1$QA_0, hbs_wage.NEW.long.1$Activ_, summary)
## $`1`
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##     0.0   250.0   600.0   656.7   920.0 18350.0 
## 
## $`2`
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##     0.0    50.0   175.0   250.9   333.3  3000.0 
## 
## $`3`
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##    0.00    0.00    0.00   69.44   25.00 2193.33 
## 
## $`4`
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##     0.0     0.0     0.0    10.3     0.0  1000.0 
## 
## $`5`
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##    0.00    0.00    0.00   11.33    0.00 3000.00 
## 
## $`6`
##     Min.  1st Qu.   Median     Mean  3rd Qu.     Max. 
##    0.000    0.000    0.000    2.678    0.000 1200.000 
## 
## $`7`
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   0.000   0.000   0.000   1.447   0.000 266.667 
## 
## $`8`
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##    0.00    0.00    0.00   13.36    0.00 3333.33 
## 
## $`9`
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##    0.00    0.00    0.00   59.46    0.00 1500.00
table (hbs_wage.NEW.long.1$QA_0>0)
## 
## FALSE  TRUE 
## 12512  6036
#6036 je vise od 0Km zaradilo u mjesec dana a ukupno je 18548 obs

#FAZA 4 SREDI QA_0 ### Remove zeros

hbs_wage.NEW.long.2 <- hbs_wage.NEW.long.1 %>% filter(QA_0>0)
summary(hbs_wage.NEW.long.2$QA_0)
##      Min.   1st Qu.    Median      Mean   3rd Qu.      Max. 
##     0.083   300.000   600.000   681.760   900.000 18350.000
#6036, samo da je vece od 0

BRISATI PERCENTILE

dim(hbs_wage.NEW.long.2)
## [1] 5908   11
hbs_wage.NEW.long.2 %>%
  select(naziv_Opcine) %>%
  group_by(naziv_Opcine) %>%
  summarise (
    n = n()
  )%>% 
  arrange (desc(n))%>%
  print(n=137) #izlistalo 27 opstina koje imaju manje od 10 obs
## # A tibble: 132 × 2
##     naziv_Opcine     n
##     <chr>        <int>
##   1 Brcko          355
##   2 Banja Luka     251
##   3 Bijeljina      247
##   4 N.G.Sarajevo   238
##   5 Grad Mostar    217
##   6 Zenica         208
##   7 Doboj          137
##   8 Travnik        137
##   9 Tuzla          113
##  10 Bugojno        110
##  11 Bihac          109
##  12 Samac           97
##  13 V.Kladusa       90
##  14 Prijedor        86
##  15 Prnjavor        86
##  16 Sanski Most     85
##  17 Cazin           83
##  18 Vitez           83
##  19 N.Travnik       82
##  20 Tesanj          82
##  21 Konjic          77
##  22 Zavidovici      76
##  23 Zivinice        75
##  24 Novi Grad       73
##  25 N.Sarajevo      70
##  26 Zvornik         70
##  27 C.Sarajevo      68
##  28 Modrica         66
##  29 Visoko          63
##  30 S.Brijeg        62
##  31 Derventa        60
##  32 Ilidza          60
##  33 Teslic          60
##  34 D.Vakuf         59
##  35 S.G.Sarajevo    53
##  36 Gracanica       52
##  37 Gradacac        52
##  38 Lopare          52
##  39 Maglaj          52
##  40 G.Vakuf         50
##  41 Trebinje        48
##  42 Kalesija        46
##  43 Foca - RS       45
##  44 Laktasi         45
##  45 Kakanj          44
##  46 Livno           44
##  47 Ljubuski        44
##  48 Gorazde         43
##  49 Lukavac         43
##  50 Brod            41
##  51 Kiseljak        40
##  52 B.Krupa         38
##  53 Grude           38
##  54 Orasje          37
##  55 Busovaca        36
##  56 Banovici        35
##  57 Capljina        34
##  58 Rudo            32
##  59 Citluk          31
##  60 Jajce           31
##  61 Ugljevik        29
##  62 Gacko           28
##  63 N.Gorazde       28
##  64 Visegrad        28
##  65 Kresevo         26
##  66 Vogosca         26
##  67 Pale            25
##  68 Drvar           24
##  69 Gradiska        24
##  70 Kladanj         24
##  71 Ilijas          23
##  72 Posusje         23
##  73 Cajnice         21
##  74 Prozor          21
##  75 Rogatica        21
##  76 Hadzici         20
##  77 Kljuc           20
##  78 Breza           19
##  79 Ribnik          19
##  80 Srbac           19
##  81 Tomislavgrad    19
##  82 B.Petrovac      18
##  83 I.Ilidza        18
##  84 Stolac          18
##  85 Vlasenica       18
##  86 Kupres          17
##  87 Bratunac        16
##  88 Buzim           16
##  89 Fojnica         16
##  90 K.Dubica        16
##  91 Kotor Varos     16
##  92 Bileca          15
##  93 Celinac         15
##  94 Knezevo         15
##  95 Glamoc          13
##  96 Nevesinje       13
##  97 Sokolac         13
##  98 Srebrenik       13
##  99 Teocak          13
## 100 Zepce           13
## 101 Olovo           12
## 102 Doboj-Jug       11
## 103 Mrkonjic        11
## 104 Srebrenica      11
## 105 Odzak           10
## 106 Doboj-Istok      9
## 107 Han Pijesak      9
## 108 B.Grahovo        8
## 109 Milici           8
## 110 Pelagicevo       8
## 111 Sekovici         8
## 112 Celic            7
## 113 Kostajnica       7
## 114 Vukosavlje       7
## 115 D-Samac          6
## 116 Petrovo          6
## 117 Trnovo           6
## 118 Usora            6
## 119 Vares            6
## 120 Ostra Luka       5
## 121 Jablanica        4
## 122 Berkovici        3
## 123 Donji Zabar      3
## 124 Kalinovik        3
## 125 Sapna            3
## 126 Sipovo           3
## 127 Neum             2
## 128 Osmaci           2
## 129 Jezero           1
## 130 Krupa na Uni     1
## 131 Ljubinje         1
## 132 Ravno            1
unique(hbs_wage$naziv_Opcine) #137 opcina
##   [1] "B.Grahovo"    "B.Krupa"      "B.Petrovac"   "Banovici"     "Banja Luka"  
##   [6] "Berkovici"    "Bihac"        "Bijeljina"    "Bileca"       "Bratunac"    
##  [11] "Brcko"        "Breza"        "Brod"         "Bugojno"      "Busovaca"    
##  [16] "Buzim"        "C.Sarajevo"   "Cajnice"      "Capljina"     "Cazin"       
##  [21] "Celic"        "Celinac"      "Citluk"       "D-Samac"      "D.Vakuf"     
##  [26] "Derventa"     "Doboj"        "Doboj-Istok"  "Doboj-Jug"    "Dobretici"   
##  [31] "Donji Zabar"  "Drvar"        "Foca"         "Foca - RS"    "Fojnica"     
##  [36] "G.Vakuf"      "Gacko"        "Glamoc"       "Gorazde"      "Gracanica"   
##  [41] "Grad Mostar"  "Gradacac"     "Gradiska"     "Grude"        "Hadzici"     
##  [46] "Han Pijesak"  "I.Ilidza"     "I.N.Sarajevo" "I.Stari Grad" "Ilidza"      
##  [51] "Ilijas"       "Jablanica"    "Jajce"        "Jezero"       "K.Dubica"    
##  [56] "Kakanj"       "Kalesija"     "Kalinovik"    "Kiseljak"     "Kladanj"     
##  [61] "Kljuc"        "Knezevo"      "Konjic"       "Kostajnica"   "Kotor Varos" 
##  [66] "Kresevo"      "Krupa na Uni" "Kupres"       "Laktasi"      "Livno"       
##  [71] "Lopare"       "Lukavac"      "Ljubinje"     "Ljubuski"     "Maglaj"      
##  [76] "Milici"       "Modrica"      "Mrkonjic"     "N.G.Sarajevo" "N.Gorazde"   
##  [81] "N.Sarajevo"   "N.Travnik"    "Neum"         "Nevesinje"    "Novi Grad"   
##  [86] "Odzak"        "Olovo"        "Orasje"       "Osmaci"       "Ostra Luka"  
##  [91] "Pale"         "Pale-FBiH"    "Pelagicevo"   "Petrovo"      "Posusje"     
##  [96] "Prijedor"     "Prnjavor"     "Prozor"       "Ravno"        "Ribnik"      
## [101] "Rogatica"     "Rudo"         "S.Brijeg"     "S.G.Sarajevo" "Samac"       
## [106] "Sanski Most"  "Sapna"        "Sekovici"     "Sipovo"       "Sokolac"     
## [111] "Srbac"        "Srebrenica"   "Srebrenik"    "Stolac"       "Teocak"      
## [116] "Tesanj"       "Teslic"       "Tomislavgrad" "Travnik"      "Trebinje"    
## [121] "Trnovo"       "Tuzla"        "Ugljevik"     "Usora"        "V.Kladusa"   
## [126] "Vares"        "Visegrad"     "Visoko"       "Vitez"        "Vlasenica"   
## [131] "Vogosca"      "Vukosavlje"   "Zavidovici"   "Zenica"       "Zepce"       
## [136] "Zivinice"     "Zvornik"
unique(hbs_wage.NEW.long.2$naziv_Opcine) #132 
##   [1] "B.Grahovo"    "B.Krupa"      "B.Petrovac"   "Banovici"     "Banja Luka"  
##   [6] "Berkovici"    "Bihac"        "Bijeljina"    "Bileca"       "Bratunac"    
##  [11] "Brcko"        "Breza"        "Brod"         "Bugojno"      "Busovaca"    
##  [16] "Buzim"        "C.Sarajevo"   "Cajnice"      "Capljina"     "Cazin"       
##  [21] "Celic"        "Celinac"      "Citluk"       "D-Samac"      "D.Vakuf"     
##  [26] "Derventa"     "Doboj"        "Doboj-Istok"  "Doboj-Jug"    "Donji Zabar" 
##  [31] "Drvar"        "Foca - RS"    "Fojnica"      "G.Vakuf"      "Gacko"       
##  [36] "Glamoc"       "Gorazde"      "Gracanica"    "Grad Mostar"  "Gradacac"    
##  [41] "Gradiska"     "Grude"        "Hadzici"      "Han Pijesak"  "I.Ilidza"    
##  [46] "Ilidza"       "Ilijas"       "Jablanica"    "Jajce"        "Jezero"      
##  [51] "K.Dubica"     "Kakanj"       "Kalesija"     "Kalinovik"    "Kiseljak"    
##  [56] "Kladanj"      "Kljuc"        "Knezevo"      "Konjic"       "Kostajnica"  
##  [61] "Kotor Varos"  "Kresevo"      "Krupa na Uni" "Kupres"       "Laktasi"     
##  [66] "Livno"        "Lopare"       "Lukavac"      "Ljubinje"     "Ljubuski"    
##  [71] "Maglaj"       "Milici"       "Modrica"      "Mrkonjic"     "N.G.Sarajevo"
##  [76] "N.Gorazde"    "N.Sarajevo"   "N.Travnik"    "Neum"         "Nevesinje"   
##  [81] "Novi Grad"    "Odzak"        "Olovo"        "Orasje"       "Osmaci"      
##  [86] "Ostra Luka"   "Pale"         "Pelagicevo"   "Petrovo"      "Posusje"     
##  [91] "Prijedor"     "Prnjavor"     "Prozor"       "Ravno"        "Ribnik"      
##  [96] "Rogatica"     "Rudo"         "S.Brijeg"     "S.G.Sarajevo" "Samac"       
## [101] "Sanski Most"  "Sapna"        "Sekovici"     "Sipovo"       "Sokolac"     
## [106] "Srbac"        "Srebrenica"   "Srebrenik"    "Stolac"       "Teocak"      
## [111] "Tesanj"       "Teslic"       "Tomislavgrad" "Travnik"      "Trebinje"    
## [116] "Trnovo"       "Tuzla"        "Ugljevik"     "Usora"        "V.Kladusa"   
## [121] "Vares"        "Visegrad"     "Visoko"       "Vitez"        "Vlasenica"   
## [126] "Vogosca"      "Vukosavlje"   "Zavidovici"   "Zenica"       "Zepce"       
## [131] "Zivinice"     "Zvornik"
#5 se ne nalaye u hbs_wage.NEW.long.2 jer vec su izbacene dakle 28+5 = 33 opstine manje

#FAZA 5 BRISATI OPSTINE SA MANJE OD 10 OBZERVACIJA

Delete low frequency obs (<10) ne mozemo ih stavljati u model

Provjeri da li su izbrisane sve ispod 10

22.12. Obrati paznju da li trebam brisati dodatno opstina jer kada napravim na ommit database u dokumentu hbs2015 average total incom… kao da trebam

hbs_wage.NEW.long.3 %>%
  select(naziv_Opcine) %>%
  group_by(naziv_Opcine) %>%
  summarise (
    n = n()
  )%>% 
  arrange (desc(n))%>%
  print(n=137) #sve su izbrisane
## # A tibble: 104 × 2
##     naziv_Opcine     n
##     <chr>        <int>
##   1 Brcko          355
##   2 Banja Luka     251
##   3 Bijeljina      247
##   4 N.G.Sarajevo   238
##   5 Grad Mostar    217
##   6 Zenica         208
##   7 Doboj          137
##   8 Travnik        137
##   9 Tuzla          113
##  10 Bugojno        110
##  11 Bihac          109
##  12 Samac           97
##  13 V.Kladusa       90
##  14 Prijedor        86
##  15 Prnjavor        86
##  16 Sanski Most     85
##  17 Cazin           83
##  18 Vitez           83
##  19 N.Travnik       82
##  20 Tesanj          82
##  21 Konjic          77
##  22 Zavidovici      76
##  23 Zivinice        75
##  24 Novi Grad       73
##  25 N.Sarajevo      70
##  26 Zvornik         70
##  27 C.Sarajevo      68
##  28 Modrica         66
##  29 Visoko          63
##  30 S.Brijeg        62
##  31 Derventa        60
##  32 Ilidza          60
##  33 Teslic          60
##  34 D.Vakuf         59
##  35 S.G.Sarajevo    53
##  36 Gracanica       52
##  37 Gradacac        52
##  38 Lopare          52
##  39 Maglaj          52
##  40 G.Vakuf         50
##  41 Trebinje        48
##  42 Kalesija        46
##  43 Foca - RS       45
##  44 Laktasi         45
##  45 Kakanj          44
##  46 Livno           44
##  47 Ljubuski        44
##  48 Gorazde         43
##  49 Lukavac         43
##  50 Brod            41
##  51 Kiseljak        40
##  52 B.Krupa         38
##  53 Grude           38
##  54 Orasje          37
##  55 Busovaca        36
##  56 Banovici        35
##  57 Capljina        34
##  58 Rudo            32
##  59 Citluk          31
##  60 Jajce           31
##  61 Ugljevik        29
##  62 Gacko           28
##  63 N.Gorazde       28
##  64 Visegrad        28
##  65 Kresevo         26
##  66 Vogosca         26
##  67 Pale            25
##  68 Drvar           24
##  69 Gradiska        24
##  70 Kladanj         24
##  71 Ilijas          23
##  72 Posusje         23
##  73 Cajnice         21
##  74 Prozor          21
##  75 Rogatica        21
##  76 Hadzici         20
##  77 Kljuc           20
##  78 Breza           19
##  79 Ribnik          19
##  80 Srbac           19
##  81 Tomislavgrad    19
##  82 B.Petrovac      18
##  83 I.Ilidza        18
##  84 Stolac          18
##  85 Vlasenica       18
##  86 Kupres          17
##  87 Bratunac        16
##  88 Buzim           16
##  89 Fojnica         16
##  90 K.Dubica        16
##  91 Kotor Varos     16
##  92 Bileca          15
##  93 Celinac         15
##  94 Knezevo         15
##  95 Glamoc          13
##  96 Nevesinje       13
##  97 Sokolac         13
##  98 Srebrenik       13
##  99 Teocak          13
## 100 Zepce           13
## 101 Olovo           12
## 102 Doboj-Jug       11
## 103 Mrkonjic        11
## 104 Srebrenica      11
unique(hbs_wage.NEW.long.3$naziv_Opcine)
##   [1] "B.Krupa"      "B.Petrovac"   "Banovici"     "Banja Luka"   "Bihac"       
##   [6] "Bijeljina"    "Bileca"       "Bratunac"     "Brcko"        "Breza"       
##  [11] "Brod"         "Bugojno"      "Busovaca"     "Buzim"        "C.Sarajevo"  
##  [16] "Cajnice"      "Capljina"     "Cazin"        "Celinac"      "Citluk"      
##  [21] "D.Vakuf"      "Derventa"     "Doboj"        "Doboj-Jug"    "Drvar"       
##  [26] "Foca - RS"    "Fojnica"      "G.Vakuf"      "Gacko"        "Glamoc"      
##  [31] "Gorazde"      "Gracanica"    "Grad Mostar"  "Gradacac"     "Gradiska"    
##  [36] "Grude"        "Hadzici"      "I.Ilidza"     "Ilidza"       "Ilijas"      
##  [41] "Jajce"        "K.Dubica"     "Kakanj"       "Kalesija"     "Kiseljak"    
##  [46] "Kladanj"      "Kljuc"        "Knezevo"      "Konjic"       "Kotor Varos" 
##  [51] "Kresevo"      "Kupres"       "Laktasi"      "Livno"        "Lopare"      
##  [56] "Lukavac"      "Ljubuski"     "Maglaj"       "Modrica"      "Mrkonjic"    
##  [61] "N.G.Sarajevo" "N.Gorazde"    "N.Sarajevo"   "N.Travnik"    "Nevesinje"   
##  [66] "Novi Grad"    "Olovo"        "Orasje"       "Pale"         "Posusje"     
##  [71] "Prijedor"     "Prnjavor"     "Prozor"       "Ribnik"       "Rogatica"    
##  [76] "Rudo"         "S.Brijeg"     "S.G.Sarajevo" "Samac"        "Sanski Most" 
##  [81] "Sokolac"      "Srbac"        "Srebrenica"   "Srebrenik"    "Stolac"      
##  [86] "Teocak"       "Tesanj"       "Teslic"       "Tomislavgrad" "Travnik"     
##  [91] "Trebinje"     "Tuzla"        "Ugljevik"     "V.Kladusa"    "Visegrad"    
##  [96] "Visoko"       "Vitez"        "Vlasenica"    "Vogosca"      "Zavidovici"  
## [101] "Zenica"       "Zepce"        "Zivinice"     "Zvornik"
#104 opcine od ukupno 137 koje su u HBS, dakle u wage- imam manje 33 opstine
unique(hbs_short$naziv_Opcine)
##   [1] "B.Grahovo"    "B.Krupa"      "B.Petrovac"   "Banovici"     "Banja Luka"  
##   [6] "Berkovici"    "Bihac"        "Bijeljina"    "Bileca"       "Bratunac"    
##  [11] "Brcko"        "Breza"        "Brod"         "Bugojno"      "Busovaca"    
##  [16] "Buzim"        "C.Sarajevo"   "Cajnice"      "Capljina"     "Cazin"       
##  [21] "Celic"        "Celinac"      "Citluk"       "D-Samac"      "D.Vakuf"     
##  [26] "Derventa"     "Doboj"        "Doboj-Istok"  "Doboj-Jug"    "Dobretici"   
##  [31] "Donji Zabar"  "Drvar"        "Foca"         "Foca - RS"    "Fojnica"     
##  [36] "G.Vakuf"      "Gacko"        "Glamoc"       "Gorazde"      "Gracanica"   
##  [41] "Grad Mostar"  "Gradacac"     "Gradiska"     "Grude"        "Hadzici"     
##  [46] "Han Pijesak"  "I.Ilidza"     "I.N.Sarajevo" "I.Stari Grad" "Ilidza"      
##  [51] "Ilijas"       "Jablanica"    "Jajce"        "Jezero"       "K.Dubica"    
##  [56] "Kakanj"       "Kalesija"     "Kalinovik"    "Kiseljak"     "Kladanj"     
##  [61] "Kljuc"        "Knezevo"      "Konjic"       "Kostajnica"   "Kotor Varos" 
##  [66] "Kresevo"      "Krupa na Uni" "Kupres"       "Laktasi"      "Livno"       
##  [71] "Lopare"       "Lukavac"      "Ljubinje"     "Ljubuski"     "Maglaj"      
##  [76] "Milici"       "Modrica"      "Mrkonjic"     "N.G.Sarajevo" "N.Gorazde"   
##  [81] "N.Sarajevo"   "N.Travnik"    "Neum"         "Nevesinje"    "Novi Grad"   
##  [86] "Odzak"        "Olovo"        "Orasje"       "Osmaci"       "Ostra Luka"  
##  [91] "Pale"         "Pale-FBiH"    "Pelagicevo"   "Petrovo"      "Posusje"     
##  [96] "Prijedor"     "Prnjavor"     "Prozor"       "Ravno"        "Ribnik"      
## [101] "Rogatica"     "Rudo"         "S.Brijeg"     "S.G.Sarajevo" "Samac"       
## [106] "Sanski Most"  "Sapna"        "Sekovici"     "Sipovo"       "Sokolac"     
## [111] "Srbac"        "Srebrenica"   "Srebrenik"    "Stolac"       "Teocak"      
## [116] "Tesanj"       "Teslic"       "Tomislavgrad" "Travnik"      "Trebinje"    
## [121] "Trnovo"       "Tuzla"        "Ugljevik"     "Usora"        "V.Kladusa"   
## [126] "Vares"        "Visegrad"     "Visoko"       "Vitez"        "Vlasenica"   
## [131] "Vogosca"      "Vukosavlje"   "Zavidovici"   "Zenica"       "Zepce"       
## [136] "Zivinice"     "Zvornik"

FAZA 6 ISPITAJ VARIJABLE

Rename varijables

library(dplyr)
WI.df <- hbs_wage.NEW.long.3
WI.df <- rename(WI.df, c(wages = QA_0, Age = Age_, Activ = Activ_, Educ = Educ_, Munic = naziv_Opcine))

wages

plot(density(WI.df$wages))

summary(WI.df$wages)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   26.67  312.00  600.00  655.80  900.00 2740.00
sd (WI.df$wages)
## [1] 458.625

Age

plot(density(WI.df$Age))

summary(WI.df$Age)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   16.00   33.00   44.00   43.29   53.00   79.00
sd (WI.df$Age)
## [1] 12.17289

Activ

Status tekuce zaposlenosti: 1. puno radno vrijeme 2. pola radnog vremena 3. nezaposlen 4 - trazi prvo zaposlenje 5 - domacica 6 - student 7 - nesposoban za rad 8 - penzioner 9 - ostalo

table(WI.df$Activ)
## 
##    1    2    3    4    5    6    7    8    9 
## 4455  576  290   88  151   24    8  149   24

Po svom nahodjenju ovu cu varijablu objediniti u 5 nivoa: puno r.v., pola r.v, nezaposlen (3,4,5,6,7),penzioner, ostalo. Ali probacu i da napravim model bez ove varijable jer mi se i nije spominjala u modelu. (probala sam i gubim na signifikantnosit)

Educ

Steceno obrazovanje: 1 - bez skole; 2- nepotpuna osnovna 8.g.skola 3 - nepotpuna osnovna 9.g. skola; 4-osnovna skola, 5-srednja skola, 6-specijalizacia poslije s.s; 7 - Visa skola; 8 - Fakultet; 9 - Master; 10 - Doktorat

table(WI.df$Educ)
## 
##    1    2    3    4    5    6    7    8    9   10 
##   58   96    6  843 3780   31  195  674   74    8

Od ove varijable napravicu bez osnovne skole (1,2,3), osnovna skola (4), srednja skola (5,6), fakultet (7,8,9,10)

WI.df <- WI.df %>% mutate(Activ.1 = case_when(Activ == 1 ~"full time", Activ == 2 ~"part time", Activ %in% c(3,4,5,6,7) ~ "unemployed", Activ == 8 ~ "pension", Activ == 9 ~ "Other"), Educ.1 = case_when(Educ %in% c(1,2,3) ~ "no elementary", Educ  == 4 ~ "elementary", Educ %in% c(5,6) ~ "high schl", Educ %in% c(7,8,9,10) ~ "faculty")) 

#check if it is ok ## Activ

table (WI.df$Activ)
## 
##    1    2    3    4    5    6    7    8    9 
## 4455  576  290   88  151   24    8  149   24
table (WI.df$Activ.1)
## 
##  full time      Other  part time    pension unemployed 
##       4455         24        576        149        561
round (prop.table(table(WI.df$Activ.1))*100,1)
## 
##  full time      Other  part time    pension unemployed 
##       77.3        0.4       10.0        2.6        9.7

##Educ

table (WI.df$Educ)
## 
##    1    2    3    4    5    6    7    8    9   10 
##   58   96    6  843 3780   31  195  674   74    8
table (WI.df$Educ.1)
## 
##    elementary       faculty     high schl no elementary 
##           843           951          3811           160
round (prop.table(table(WI.df$Educ.1))*100,1)
## 
##    elementary       faculty     high schl no elementary 
##          14.6          16.5          66.1           2.8

Relevel

Active

Sada treba relevel varijablu da full time bude referentna vrijednost

Educ

Sada treba relevel varijablu da full time bude referentna vrijednost

Sex

round (prop.table(table(WI.df$Sex_))*100,1)
## 
##    1    2 
## 65.4 34.6

#FAZA 7 BUILD UP A MODEL

Mincer earnings function log(wages)

library(texreg)
## Version:  1.39.3
## Date:     2023-11-09
## Author:   Philip Leifeld (University of Essex)
## 
## Consider submitting praise using the praise or praise_interactive functions.
## Please cite the JSS article in your publications -- see citation("texreg").
## 
## Attaching package: 'texreg'
## The following object is masked from 'package:tidyr':
## 
##     extract
WI.1 <- lm (log(wages)~ Age + as.numeric(Age^2) + Sex_ + Educ.1 + factor(Munic), data = WI.df)

WI.2 <- lm (log(wages)~ Age + as.numeric(Age^2)+ Sex_ + Educ.1 + RurUrb + Activ.1 + factor (Munic) , data = WI.df) #add Activ.1 and rural urban
#Ismirov prijedlog on 20th 11 2023

WI.3 <-  lm (log(wages)~ Age + as.numeric(Age^2)+ Sex_ + Educ.1 + Activ.1 + factor (Munic) , data = WI.df) # No rur urb THE WINNING MODEL

texreg::screenreg(list(WI.1, WI.2, WI.3))
## 
## ================================================================
##                            Model 1      Model 2      Model 3    
## ----------------------------------------------------------------
## (Intercept)                   4.03 ***     4.90 ***     4.88 ***
##                              (0.17)       (0.15)       (0.15)   
## Age                           0.08 ***     0.05 ***     0.05 ***
##                              (0.01)       (0.00)       (0.00)   
## as.numeric(Age^2)            -0.00 ***    -0.00 ***    -0.00 ***
##                              (0.00)       (0.00)       (0.00)   
## Sex_                         -0.17 ***    -0.18 ***    -0.17 ***
##                              (0.02)       (0.02)       (0.02)   
## Educ.1elementary              0.19 **      0.15 *       0.15 *  
##                              (0.07)       (0.06)       (0.06)   
## Educ.1high schl               0.66 ***     0.42 ***     0.43 ***
##                              (0.07)       (0.06)       (0.06)   
## Educ.1faculty                 1.19 ***     0.83 ***     0.86 ***
##                              (0.07)       (0.06)       (0.06)   
## factor(Munic)B.Petrovac      -0.07         0.11         0.13    
##                              (0.22)       (0.19)       (0.19)   
## factor(Munic)Banovici        -0.04         0.26         0.24    
##                              (0.18)       (0.15)       (0.15)   
## factor(Munic)Banja Luka       0.03         0.13         0.15    
##                              (0.13)       (0.11)       (0.11)   
## factor(Munic)Bihac           -0.20        -0.06        -0.05    
##                              (0.14)       (0.12)       (0.12)   
## factor(Munic)Bijeljina       -0.08        -0.07        -0.07    
##                              (0.13)       (0.11)       (0.11)   
## factor(Munic)Bileca          -0.27        -0.03         0.00    
##                              (0.23)       (0.20)       (0.20)   
## factor(Munic)Bratunac         0.03         0.16         0.18    
##                              (0.22)       (0.19)       (0.19)   
## factor(Munic)Brcko           -0.02         0.18         0.19    
##                              (0.13)       (0.11)       (0.11)   
## factor(Munic)Breza            0.12         0.21         0.20    
##                              (0.21)       (0.18)       (0.18)   
## factor(Munic)Brod            -0.58 ***    -0.53 ***    -0.52 ***
##                              (0.17)       (0.15)       (0.15)   
## factor(Munic)Bugojno         -0.38 **      0.01         0.01    
##                              (0.14)       (0.12)       (0.12)   
## factor(Munic)Busovaca        -0.01         0.21         0.21    
##                              (0.18)       (0.15)       (0.15)   
## factor(Munic)Buzim           -0.55 *      -0.50 *      -0.51 ** 
##                              (0.23)       (0.19)       (0.19)   
## factor(Munic)C.Sarajevo       0.26         0.33 *       0.36 ** 
##                              (0.15)       (0.13)       (0.13)   
## factor(Munic)Cajnice         -0.53 *      -0.20        -0.19    
##                              (0.21)       (0.18)       (0.18)   
## factor(Munic)Capljina         0.42 *       0.54 ***     0.52 ***
##                              (0.18)       (0.15)       (0.15)   
## factor(Munic)Cazin           -0.15        -0.07        -0.07    
##                              (0.15)       (0.13)       (0.13)   
## factor(Munic)Celinac         -0.42        -0.13        -0.13    
##                              (0.23)       (0.20)       (0.20)   
## factor(Munic)Citluk           0.14         0.25         0.24    
##                              (0.18)       (0.16)       (0.16)   
## factor(Munic)D.Vakuf         -0.55 ***    -0.08        -0.08    
##                              (0.16)       (0.14)       (0.14)   
## factor(Munic)Derventa        -0.52 ***    -0.42 **     -0.42 ** 
##                              (0.16)       (0.13)       (0.13)   
## factor(Munic)Doboj           -0.27         0.14         0.14    
##                              (0.14)       (0.12)       (0.12)   
## factor(Munic)Doboj-Jug       -0.19        -0.08        -0.10    
##                              (0.26)       (0.22)       (0.22)   
## factor(Munic)Drvar           -0.06         0.16         0.16    
##                              (0.20)       (0.17)       (0.17)   
## factor(Munic)Foca - RS       -0.28         0.03         0.05    
##                              (0.17)       (0.14)       (0.14)   
## factor(Munic)Fojnica          0.09         0.26         0.24    
##                              (0.22)       (0.19)       (0.19)   
## factor(Munic)G.Vakuf         -0.43 **      0.05         0.04    
##                              (0.16)       (0.14)       (0.14)   
## factor(Munic)Gacko            0.32         0.26         0.28    
##                              (0.19)       (0.16)       (0.16)   
## factor(Munic)Glamoc           0.03         0.31         0.30    
##                              (0.24)       (0.21)       (0.21)   
## factor(Munic)Gorazde          0.15         0.27         0.27    
##                              (0.17)       (0.14)       (0.14)   
## factor(Munic)Gracanica       -0.26        -0.03        -0.04    
##                              (0.16)       (0.14)       (0.14)   
## factor(Munic)Grad Mostar      0.20         0.35 **      0.36 ** 
##                              (0.13)       (0.11)       (0.11)   
## factor(Munic)Gradacac        -0.06         0.00         0.01    
##                              (0.16)       (0.14)       (0.14)   
## factor(Munic)Gradiska        -0.09         0.07         0.06    
##                              (0.20)       (0.17)       (0.17)   
## factor(Munic)Grude            0.32         0.48 **      0.49 ** 
##                              (0.17)       (0.15)       (0.15)   
## factor(Munic)Hadzici         -0.55 **     -0.08        -0.07    
##                              (0.21)       (0.18)       (0.18)   
## factor(Munic)I.Ilidza         0.06         0.03         0.06    
##                              (0.22)       (0.19)       (0.19)   
## factor(Munic)Ilidza           0.43 **      0.53 ***     0.56 ***
##                              (0.16)       (0.14)       (0.13)   
## factor(Munic)Ilijas          -0.11         0.13         0.12    
##                              (0.20)       (0.17)       (0.17)   
## factor(Munic)Jajce            0.03         0.40 *       0.41 ** 
##                              (0.18)       (0.16)       (0.16)   
## factor(Munic)K.Dubica        -0.06        -0.07        -0.06    
##                              (0.22)       (0.19)       (0.19)   
## factor(Munic)Kakanj           0.06         0.14         0.15    
##                              (0.17)       (0.14)       (0.14)   
## factor(Munic)Kalesija        -0.64 ***    -0.20        -0.21    
##                              (0.17)       (0.14)       (0.14)   
## factor(Munic)Kiseljak         0.17         0.32 *       0.31 *  
##                              (0.17)       (0.15)       (0.15)   
## factor(Munic)Kladanj         -0.49 *      -0.12        -0.11    
##                              (0.20)       (0.17)       (0.17)   
## factor(Munic)Kljuc           -0.05         0.10         0.11    
##                              (0.21)       (0.18)       (0.18)   
## factor(Munic)Knezevo         -0.26        -0.11        -0.09    
##                              (0.23)       (0.20)       (0.20)   
## factor(Munic)Konjic           0.01         0.26 *       0.26 *  
##                              (0.15)       (0.13)       (0.13)   
## factor(Munic)Kotor Varos     -0.09         0.07         0.06    
##                              (0.22)       (0.19)       (0.19)   
## factor(Munic)Kresevo          0.23         0.31         0.31    
##                              (0.19)       (0.17)       (0.17)   
## factor(Munic)Kupres           0.12         0.20         0.22    
##                              (0.22)       (0.19)       (0.19)   
## factor(Munic)Laktasi          0.11         0.07         0.06    
##                              (0.17)       (0.14)       (0.14)   
## factor(Munic)Livno            0.39 *       0.55 ***     0.56 ***
##                              (0.17)       (0.14)       (0.14)   
## factor(Munic)Lopare          -0.40 *       0.05         0.05    
##                              (0.16)       (0.14)       (0.14)   
## factor(Munic)Lukavac          0.10         0.29 *       0.28    
##                              (0.17)       (0.14)       (0.14)   
## factor(Munic)Ljubuski         0.26         0.44 **      0.43 ** 
##                              (0.17)       (0.14)       (0.14)   
## factor(Munic)Maglaj          -0.08         0.11         0.12    
##                              (0.16)       (0.14)       (0.14)   
## factor(Munic)Modrica         -0.18         0.02         0.02    
##                              (0.15)       (0.13)       (0.13)   
## factor(Munic)Mrkonjic         0.19         0.31         0.33    
##                              (0.26)       (0.22)       (0.22)   
## factor(Munic)N.G.Sarajevo     0.21         0.31 **      0.35 ** 
##                              (0.13)       (0.11)       (0.11)   
## factor(Munic)N.Gorazde       -0.73 ***    -0.27        -0.28    
##                              (0.19)       (0.16)       (0.16)   
## factor(Munic)N.Sarajevo       0.27         0.40 **      0.43 ***
##                              (0.15)       (0.13)       (0.13)   
## factor(Munic)N.Travnik       -0.26        -0.06        -0.07    
##                              (0.15)       (0.13)       (0.13)   
## factor(Munic)Nevesinje        0.02         0.11         0.11    
##                              (0.24)       (0.21)       (0.21)   
## factor(Munic)Novi Grad       -0.29        -0.11        -0.10    
##                              (0.15)       (0.13)       (0.13)   
## factor(Munic)Olovo           -0.21         0.28         0.29    
##                              (0.25)       (0.22)       (0.22)   
## factor(Munic)Orasje           0.29         0.50 ***     0.48 ** 
##                              (0.17)       (0.15)       (0.15)   
## factor(Munic)Pale             0.09         0.14         0.16    
##                              (0.19)       (0.17)       (0.17)   
## factor(Munic)Posusje          0.47 *       0.57 ***     0.56 ** 
##                              (0.20)       (0.17)       (0.17)   
## factor(Munic)Prijedor         0.08         0.16         0.17    
##                              (0.15)       (0.13)       (0.13)   
## factor(Munic)Prnjavor        -0.51 ***    -0.15        -0.16    
##                              (0.15)       (0.13)       (0.13)   
## factor(Munic)Prozor           0.01         0.35 *       0.35 *  
##                              (0.21)       (0.18)       (0.18)   
## factor(Munic)Ribnik          -0.06         0.10         0.08    
##                              (0.21)       (0.18)       (0.18)   
## factor(Munic)Rogatica         0.12         0.08         0.10    
##                              (0.21)       (0.18)       (0.18)   
## factor(Munic)Rudo            -0.32        -0.02         0.00    
##                              (0.18)       (0.16)       (0.16)   
## factor(Munic)S.Brijeg         0.68 ***     0.73 ***     0.71 ***
##                              (0.16)       (0.13)       (0.13)   
## factor(Munic)S.G.Sarajevo     0.35 *       0.38 **      0.42 ** 
##                              (0.16)       (0.14)       (0.14)   
## factor(Munic)Samac           -0.16         0.07         0.07    
##                              (0.14)       (0.12)       (0.12)   
## factor(Munic)Sanski Most      0.16         0.12         0.11    
##                              (0.15)       (0.13)       (0.13)   
## factor(Munic)Sokolac         -0.11         0.02        -0.01    
##                              (0.24)       (0.21)       (0.21)   
## factor(Munic)Srbac            0.15         0.09         0.08    
##                              (0.21)       (0.18)       (0.18)   
## factor(Munic)Srebrenica       0.38         0.26         0.29    
##                              (0.26)       (0.22)       (0.22)   
## factor(Munic)Srebrenik        0.04         0.19         0.17    
##                              (0.24)       (0.21)       (0.21)   
## factor(Munic)Stolac           0.35         0.49 **      0.48 ** 
##                              (0.22)       (0.19)       (0.19)   
## factor(Munic)Teocak          -0.56 *       0.14         0.12    
##                              (0.24)       (0.21)       (0.21)   
## factor(Munic)Tesanj          -0.13         0.00        -0.01    
##                              (0.15)       (0.13)       (0.13)   
## factor(Munic)Teslic          -0.13         0.11         0.10    
##                              (0.16)       (0.13)       (0.13)   
## factor(Munic)Tomislavgrad     0.34         0.48 **      0.46 *  
##                              (0.21)       (0.18)       (0.18)   
## factor(Munic)Travnik          0.39 **      0.37 **      0.37 ** 
##                              (0.14)       (0.12)       (0.12)   
## factor(Munic)Trebinje        -0.05         0.04         0.08    
##                              (0.16)       (0.14)       (0.14)   
## factor(Munic)Tuzla           -0.13         0.04         0.05    
##                              (0.14)       (0.12)       (0.12)   
## factor(Munic)Ugljevik        -0.03         0.25         0.23    
##                              (0.19)       (0.16)       (0.16)   
## factor(Munic)V.Kladusa       -0.38 **     -0.04        -0.05    
##                              (0.15)       (0.13)       (0.13)   
## factor(Munic)Visegrad        -0.39 *      -0.04        -0.02    
##                              (0.19)       (0.16)       (0.16)   
## factor(Munic)Visoko          -0.02         0.16         0.15    
##                              (0.16)       (0.13)       (0.13)   
## factor(Munic)Vitez           -0.17        -0.00        -0.01    
##                              (0.15)       (0.13)       (0.13)   
## factor(Munic)Vlasenica        0.17         0.12         0.14    
##                              (0.22)       (0.19)       (0.19)   
## factor(Munic)Vogosca          0.16         0.18         0.17    
##                              (0.19)       (0.17)       (0.17)   
## factor(Munic)Zavidovici      -0.05         0.08         0.08    
##                              (0.15)       (0.13)       (0.13)   
## factor(Munic)Zenica          -0.03         0.17         0.18    
##                              (0.13)       (0.11)       (0.11)   
## factor(Munic)Zepce           -0.11         0.04         0.02    
##                              (0.24)       (0.21)       (0.21)   
## factor(Munic)Zivinice        -0.29        -0.09        -0.10    
##                              (0.15)       (0.13)       (0.13)   
## factor(Munic)Zvornik         -0.38 *      -0.30 *      -0.31 *  
##                              (0.15)       (0.13)       (0.13)   
## RurUrb                                     0.06 **              
##                                           (0.02)                
## Activ.1Other                              -1.05 ***    -1.06 ***
##                                           (0.13)       (0.13)   
## Activ.1part time                          -0.86 ***    -0.86 ***
##                                           (0.03)       (0.03)   
## Activ.1pension                            -1.18 ***    -1.18 ***
##                                           (0.06)       (0.06)   
## Activ.1unemployed                         -1.10 ***    -1.11 ***
##                                           (0.03)       (0.03)   
## ----------------------------------------------------------------
## R^2                           0.28         0.47         0.47    
## Adj. R^2                      0.27         0.46         0.46    
## Num. obs.                  5765         5765         5765       
## ================================================================
## *** p < 0.001; ** p < 0.01; * p < 0.05
screenreg(WI.3)
## 
## ======================================
##                            Model 1    
## --------------------------------------
## (Intercept)                   4.88 ***
##                              (0.15)   
## Age                           0.05 ***
##                              (0.00)   
## as.numeric(Age^2)            -0.00 ***
##                              (0.00)   
## Sex_                         -0.17 ***
##                              (0.02)   
## Educ.1elementary              0.15 *  
##                              (0.06)   
## Educ.1high schl               0.43 ***
##                              (0.06)   
## Educ.1faculty                 0.86 ***
##                              (0.06)   
## Activ.1Other                 -1.06 ***
##                              (0.13)   
## Activ.1part time             -0.86 ***
##                              (0.03)   
## Activ.1pension               -1.18 ***
##                              (0.06)   
## Activ.1unemployed            -1.11 ***
##                              (0.03)   
## factor(Munic)B.Petrovac       0.13    
##                              (0.19)   
## factor(Munic)Banovici         0.24    
##                              (0.15)   
## factor(Munic)Banja Luka       0.15    
##                              (0.11)   
## factor(Munic)Bihac           -0.05    
##                              (0.12)   
## factor(Munic)Bijeljina       -0.07    
##                              (0.11)   
## factor(Munic)Bileca           0.00    
##                              (0.20)   
## factor(Munic)Bratunac         0.18    
##                              (0.19)   
## factor(Munic)Brcko            0.19    
##                              (0.11)   
## factor(Munic)Breza            0.20    
##                              (0.18)   
## factor(Munic)Brod            -0.52 ***
##                              (0.15)   
## factor(Munic)Bugojno          0.01    
##                              (0.12)   
## factor(Munic)Busovaca         0.21    
##                              (0.15)   
## factor(Munic)Buzim           -0.51 ** 
##                              (0.19)   
## factor(Munic)C.Sarajevo       0.36 ** 
##                              (0.13)   
## factor(Munic)Cajnice         -0.19    
##                              (0.18)   
## factor(Munic)Capljina         0.52 ***
##                              (0.15)   
## factor(Munic)Cazin           -0.07    
##                              (0.13)   
## factor(Munic)Celinac         -0.13    
##                              (0.20)   
## factor(Munic)Citluk           0.24    
##                              (0.16)   
## factor(Munic)D.Vakuf         -0.08    
##                              (0.14)   
## factor(Munic)Derventa        -0.42 ** 
##                              (0.13)   
## factor(Munic)Doboj            0.14    
##                              (0.12)   
## factor(Munic)Doboj-Jug       -0.10    
##                              (0.22)   
## factor(Munic)Drvar            0.16    
##                              (0.17)   
## factor(Munic)Foca - RS        0.05    
##                              (0.14)   
## factor(Munic)Fojnica          0.24    
##                              (0.19)   
## factor(Munic)G.Vakuf          0.04    
##                              (0.14)   
## factor(Munic)Gacko            0.28    
##                              (0.16)   
## factor(Munic)Glamoc           0.30    
##                              (0.21)   
## factor(Munic)Gorazde          0.27    
##                              (0.14)   
## factor(Munic)Gracanica       -0.04    
##                              (0.14)   
## factor(Munic)Grad Mostar      0.36 ** 
##                              (0.11)   
## factor(Munic)Gradacac         0.01    
##                              (0.14)   
## factor(Munic)Gradiska         0.06    
##                              (0.17)   
## factor(Munic)Grude            0.49 ** 
##                              (0.15)   
## factor(Munic)Hadzici         -0.07    
##                              (0.18)   
## factor(Munic)I.Ilidza         0.06    
##                              (0.19)   
## factor(Munic)Ilidza           0.56 ***
##                              (0.13)   
## factor(Munic)Ilijas           0.12    
##                              (0.17)   
## factor(Munic)Jajce            0.41 ** 
##                              (0.16)   
## factor(Munic)K.Dubica        -0.06    
##                              (0.19)   
## factor(Munic)Kakanj           0.15    
##                              (0.14)   
## factor(Munic)Kalesija        -0.21    
##                              (0.14)   
## factor(Munic)Kiseljak         0.31 *  
##                              (0.15)   
## factor(Munic)Kladanj         -0.11    
##                              (0.17)   
## factor(Munic)Kljuc            0.11    
##                              (0.18)   
## factor(Munic)Knezevo         -0.09    
##                              (0.20)   
## factor(Munic)Konjic           0.26 *  
##                              (0.13)   
## factor(Munic)Kotor Varos      0.06    
##                              (0.19)   
## factor(Munic)Kresevo          0.31    
##                              (0.17)   
## factor(Munic)Kupres           0.22    
##                              (0.19)   
## factor(Munic)Laktasi          0.06    
##                              (0.14)   
## factor(Munic)Livno            0.56 ***
##                              (0.14)   
## factor(Munic)Lopare           0.05    
##                              (0.14)   
## factor(Munic)Lukavac          0.28    
##                              (0.14)   
## factor(Munic)Ljubuski         0.43 ** 
##                              (0.14)   
## factor(Munic)Maglaj           0.12    
##                              (0.14)   
## factor(Munic)Modrica          0.02    
##                              (0.13)   
## factor(Munic)Mrkonjic         0.33    
##                              (0.22)   
## factor(Munic)N.G.Sarajevo     0.35 ** 
##                              (0.11)   
## factor(Munic)N.Gorazde       -0.28    
##                              (0.16)   
## factor(Munic)N.Sarajevo       0.43 ***
##                              (0.13)   
## factor(Munic)N.Travnik       -0.07    
##                              (0.13)   
## factor(Munic)Nevesinje        0.11    
##                              (0.21)   
## factor(Munic)Novi Grad       -0.10    
##                              (0.13)   
## factor(Munic)Olovo            0.29    
##                              (0.22)   
## factor(Munic)Orasje           0.48 ** 
##                              (0.15)   
## factor(Munic)Pale             0.16    
##                              (0.17)   
## factor(Munic)Posusje          0.56 ** 
##                              (0.17)   
## factor(Munic)Prijedor         0.17    
##                              (0.13)   
## factor(Munic)Prnjavor        -0.16    
##                              (0.13)   
## factor(Munic)Prozor           0.35 *  
##                              (0.18)   
## factor(Munic)Ribnik           0.08    
##                              (0.18)   
## factor(Munic)Rogatica         0.10    
##                              (0.18)   
## factor(Munic)Rudo             0.00    
##                              (0.16)   
## factor(Munic)S.Brijeg         0.71 ***
##                              (0.13)   
## factor(Munic)S.G.Sarajevo     0.42 ** 
##                              (0.14)   
## factor(Munic)Samac            0.07    
##                              (0.12)   
## factor(Munic)Sanski Most      0.11    
##                              (0.13)   
## factor(Munic)Sokolac         -0.01    
##                              (0.21)   
## factor(Munic)Srbac            0.08    
##                              (0.18)   
## factor(Munic)Srebrenica       0.29    
##                              (0.22)   
## factor(Munic)Srebrenik        0.17    
##                              (0.21)   
## factor(Munic)Stolac           0.48 ** 
##                              (0.19)   
## factor(Munic)Teocak           0.12    
##                              (0.21)   
## factor(Munic)Tesanj          -0.01    
##                              (0.13)   
## factor(Munic)Teslic           0.10    
##                              (0.13)   
## factor(Munic)Tomislavgrad     0.46 *  
##                              (0.18)   
## factor(Munic)Travnik          0.37 ** 
##                              (0.12)   
## factor(Munic)Trebinje         0.08    
##                              (0.14)   
## factor(Munic)Tuzla            0.05    
##                              (0.12)   
## factor(Munic)Ugljevik         0.23    
##                              (0.16)   
## factor(Munic)V.Kladusa       -0.05    
##                              (0.13)   
## factor(Munic)Visegrad        -0.02    
##                              (0.16)   
## factor(Munic)Visoko           0.15    
##                              (0.13)   
## factor(Munic)Vitez           -0.01    
##                              (0.13)   
## factor(Munic)Vlasenica        0.14    
##                              (0.19)   
## factor(Munic)Vogosca          0.17    
##                              (0.17)   
## factor(Munic)Zavidovici       0.08    
##                              (0.13)   
## factor(Munic)Zenica           0.18    
##                              (0.11)   
## factor(Munic)Zepce            0.02    
##                              (0.21)   
## factor(Munic)Zivinice        -0.10    
##                              (0.13)   
## factor(Munic)Zvornik         -0.31 *  
##                              (0.13)   
## --------------------------------------
## R^2                           0.47    
## Adj. R^2                      0.46    
## Num. obs.                  5765       
## ======================================
## *** p < 0.001; ** p < 0.01; * p < 0.05

FAZA 8: IZRADI MAPE ZA SVAKI MODEL POSEBNO

Mean map

open libraries

library(ggplot2)
library(ggmap)
## ℹ Google's Terms of Service: <https://mapsplatform.google.com>
## ℹ Please cite ggmap if you use it! Use `citation("ggmap")` for details.
#maping with sf and ggplot

library(sf)
## Linking to GEOS 3.11.2, GDAL 3.7.2, PROJ 9.3.0; sf_use_s2() is TRUE
library(tmap)
## Breaking News: tmap 3.x is retiring. Please test v4, e.g. with
## remotes::install_github('r-tmap/tmap')
library(maps)
## 
## Attaching package: 'maps'
## 
## The following object is masked from 'package:purrr':
## 
##     map
library(raster)
## Loading required package: sp
## 
## Attaching package: 'raster'
## 
## The following object is masked from 'package:dplyr':
## 
##     select
library(dplyr)
library(spData)
## To access larger datasets in this package, install the spDataLarge
## package with: `install.packages('spDataLarge',
## repos='https://nowosad.github.io/drat/', type='source')`
#library(spDataLarge) samo mi ova nije instalirana, probacu bez nje

Import map

library(readr)
BIH_adm3 <- read_csv("BIH_adm/BIH_adm3.csv")
## Rows: 141 Columns: 14
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (8): ISO, NAME_0, NAME_1, NAME_2, NAME_3, TYPE_3, ENGTYPE_3, VARNAME_3
## dbl (5): OBJECTID, ID_0, ID_1, ID_2, ID_3
## lgl (1): NL_NAME_3
## 
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
amraGIS <- st_read("BIH_adm/BIH_adm3.shp")
## Reading layer `BIH_adm3' from data source 
##   `C:\Users\Amra\Documents\HBS database inspecting\BIH_adm\BIH_adm3.shp' 
##   using driver `ESRI Shapefile'
## Simple feature collection with 141 features and 13 fields
## Geometry type: MULTIPOLYGON
## Dimension:     XY
## Bounding box:  xmin: 15.72739 ymin: 42.56531 xmax: 19.61471 ymax: 45.27468
## Geodetic CRS:  WGS 84

#change interpunction Nema potrebe za ovim jer cu formirati varijablu opcina koju sam prilagodial hbs bazi

amraGIS$NAME_4 <- c("Brcko", "Foca", "Gorazde", "Pale-FBiH", "B.Grahovo", "Drvar", "Glamoc", "Kupres", "Livno", "Tomislavgrad", "Bugojno", "Busovaca", "Dobretici", "D.Vakuf", "Fojnica", "G.Vakuf", "Jajce", "Kiseljak", "Kresevo", "N.Travnik", "Travnik", "Vitez", "Capljina", "Citluk", "Jablanica", "Konjic", "Grad Mostar", "Neum", "Prozor", "Ravno", "Stolac", "D-Samac", "Odzak", "Orasje", "C.Sarajevo", "Hadzici", "Ilidza", "Ilijas", "N.G.Sarajevo", "N.Sarajevo", "S.G.Sarajevo", "Trnovo", "Vogosca", "Zivinice", "Celic", "Banovici", "Doboj-Istok", "Gracanica", "Gradacac", "Kalesija", "Kladanj", "Lukavac", "Sapna", "Srebrenik", "Teocak", "Tuzla", "Bihac", "B.Krupa", "B.Petrovac", "Buzim", "Cazin", "Kljuc", "S.Most", "V.Kladusa", "S.Brijeg", "Grude", "Ljubuski", "Posusje", "Zepce", "Breza", "Doboj-Jug", "Kakanj", "Maglaj", "Olovo", "Tesanj", "Vares", "Visoko", "Zavidovici", "Zenica", "Sipovo", "Celinac", "Banja Luka", "Gradiska", "Kostajnica", "K.Dubica", "I.Drvar", "Jezero", "Kotor Varos", "Krupa na Uni", "Kupres", "Laktasi", "Mrkonjic", "Novi Grad", "Ostra Luka", "B.Petrovac", "Prijedor", "Prnjavor", "Ribnik", "Knezevo","Srbac", "Teslic", "Bijeljina", "Lopare", "Ugljevik", "Samac", "Brod", "Derventa", "Doboj", "Donji Zabar", "Modrica", "Pelagicevo", "Petrovo", "Vukosavlje", "Cajnice", "Foca - RS", "Kalinovik", "N.Gorazde", "Rudo", "Visegrad", "I.N.Sarajevo", "Han Pijesak", "I.Ilidza", "I.Stari Grad", "Pale", "Rogatica", "Sokolac", "Trnovo", "Berkovici", "Bileca", "Gacko", "Ljubinje", "I.Mostar", "Nevesinje", "Trebinje", "Sekovici", "Bratunac", "Milici", "Osmaci", "Srebrenica", "Vlasenica", "Zvornik")

Mean wages

U skladu sa preporukom Ismirovom od dana 30.10.2023. koje su se odnosile an rents, je cu da uradim mean vrijednosti za ove opstine wages i to cu mapirati

mean.wages <- WI.df %>% group_by(Munic) %>%summarise_at(vars("wages"), list(~n(), ~mean(., na.rm = TRUE), ~sd(., na.rm = TRUE)))
mean.wages
## # A tibble: 104 × 4
##    Munic          n  mean    sd
##    <chr>      <int> <dbl> <dbl>
##  1 B.Krupa       38  559.  429.
##  2 B.Petrovac    18  597.  571.
##  3 Banja Luka   251  737.  439.
##  4 Banovici      35  702.  416.
##  5 Bihac        109  594.  419.
##  6 Bijeljina    247  617.  464.
##  7 Bileca        15  531.  344.
##  8 Bratunac      16  669.  443.
##  9 Brcko        355  621.  422.
## 10 Breza         19  813.  424.
## # ℹ 94 more rows
map.wages <- merge (mean.wages, amraGIS, by.x='Munic', by.y = "NAME_4", all=T) 
#142 muncicip
g = ggplot() + geom_sf(data = map.wages, aes(geometry=geometry, fill = mean)) + scale_fill_viridis_c() + scale_x_continuous(breaks = c(18, 48))
g + labs (title = "Mean wages")

Maping coefficienst of models

Coeff and maping model WI.1

Extracting the coefficients from the first model

model.coef1 <- summary(WI.1)$coefficients
model.coef1 # vidi koliko redova su koef.za druge varijable
##                                Estimate   Std. Error      t value      Pr(>|t|)
## (Intercept)                4.0257218985 0.1691882292  23.79433793 2.372623e-119
## Age                        0.0848380691 0.0054267562  15.63329297  5.745860e-54
## as.numeric(Age^2)         -0.0009401709 0.0000626539 -15.00578486  6.092529e-50
## Sex_                      -0.1724208888 0.0215777374  -7.99068436  1.613758e-15
## Educ.1elementary           0.1905907253 0.0692756126   2.75119509  5.956734e-03
## Educ.1high schl            0.6576534903 0.0673989183   9.75762678  2.564532e-22
## Educ.1faculty              1.1946603259 0.0710736055  16.80877617  6.564151e-62
## factor(Munic)B.Petrovac   -0.0737173855 0.2161698840  -0.34101598  7.331042e-01
## factor(Munic)Banovici     -0.0355336130 0.1768391874  -0.20093744  8.407547e-01
## factor(Munic)Banja Luka    0.0291152186 0.1320007279   0.22056862  8.254363e-01
## factor(Munic)Bihac        -0.1955369552 0.1423236290  -1.37388961  1.695304e-01
## factor(Munic)Bijeljina    -0.0794277352 0.1314643612  -0.60417694  5.457502e-01
## factor(Munic)Bileca       -0.2743646169 0.2300690562  -1.19253159  2.331029e-01
## factor(Munic)Bratunac      0.0318851848 0.2244750503   0.14204334  8.870508e-01
## factor(Munic)Brcko        -0.0166596215 0.1288534219  -0.12929126  8.971318e-01
## factor(Munic)Breza         0.1187819444 0.2122016637   0.55975972  5.756655e-01
## factor(Munic)Brod         -0.5813261339 0.1698758986  -3.42206363  6.258827e-04
## factor(Munic)Bugojno      -0.3800782751 0.1420157665  -2.67631042  7.465232e-03
## factor(Munic)Busovaca     -0.0113722346 0.1754831280  -0.06480529  9.483313e-01
## factor(Munic)Buzim        -0.5533257067 0.2251762651  -2.45730031  1.402837e-02
## factor(Munic)C.Sarajevo    0.2647075427 0.1539029958   1.71996355  8.549378e-02
## factor(Munic)Cajnice      -0.5264740146 0.2052768323  -2.56470255  1.035201e-02
## factor(Munic)Capljina      0.4156761794 0.1779161918   2.33635947  1.950726e-02
## factor(Munic)Cazin        -0.1519299824 0.1474820741  -1.03015898  3.029794e-01
## factor(Munic)Celinac      -0.4162818750 0.2300586899  -1.80945947  7.043273e-02
## factor(Munic)Citluk        0.1435882088 0.1827703423   0.78562094  4.321225e-01
## factor(Munic)D.Vakuf      -0.5549446773 0.1569144626  -3.53660630  4.085523e-04
## factor(Munic)Derventa     -0.5182181011 0.1568088705  -3.30477542  9.564430e-04
## factor(Munic)Doboj        -0.2673372739 0.1389442082  -1.92406202  5.439694e-02
## factor(Munic)Doboj-Jug    -0.1945112194 0.2581978362  -0.75334179  4.512759e-01
## factor(Munic)Drvar        -0.0559718751 0.1970835687  -0.28400072  7.764202e-01
## factor(Munic)Foca - RS    -0.2819089596 0.1664764949  -1.69338596  9.043710e-02
## factor(Munic)Fojnica       0.0906048339 0.2245365331   0.40351934  6.865815e-01
## factor(Munic)G.Vakuf      -0.4278594451 0.1621915122  -2.63798912  8.362766e-03
## factor(Munic)Gacko         0.3198822243 0.1880581995   1.70097462  8.900273e-02
## factor(Munic)Glamoc        0.0310621178 0.2422368530   0.12823036  8.979712e-01
## factor(Munic)Gorazde       0.1519577273 0.1681774461   0.90355592  3.662694e-01
## factor(Munic)Gracanica    -0.2576567265 0.1610096581  -1.60025634  1.095976e-01
## factor(Munic)Grad Mostar   0.2046876935 0.1332980051   1.53556457  1.247012e-01
## factor(Munic)Gradacac     -0.0575877343 0.1607730520  -0.35819270  7.202125e-01
## factor(Munic)Gradiska     -0.0946104936 0.1966675349  -0.48106818  6.304867e-01
## factor(Munic)Grude         0.3184714407 0.1733801830   1.83683876  6.628615e-02
## factor(Munic)Hadzici      -0.5486132505 0.2083915564  -2.63260787  8.496248e-03
## factor(Munic)I.Ilidza      0.0598974789 0.2159706873   0.27734078  7.815286e-01
## factor(Munic)Ilidza        0.4301277799 0.1563940830   2.75028167  5.973343e-03
## factor(Munic)Ilijas       -0.1133163369 0.1991279365  -0.56906298  5.693360e-01
## factor(Munic)Jajce         0.0315182601 0.1823012111   0.17289112  8.627432e-01
## factor(Munic)K.Dubica     -0.0640620514 0.2247998891  -0.28497368  7.756747e-01
## factor(Munic)Kakanj        0.0593390125 0.1671024275   0.35510563  7.225237e-01
## factor(Munic)Kalesija     -0.6405542445 0.1652336155  -3.87665816  1.071008e-04
## factor(Munic)Kiseljak      0.1725244813 0.1710507910   1.00861551  3.132022e-01
## factor(Munic)Kladanj      -0.4881110509 0.1964701843  -2.48440267  1.300562e-02
## factor(Munic)Kljuc        -0.0530960672 0.2083129201  -0.25488610  7.988203e-01
## factor(Munic)Knezevo      -0.2570993566 0.2298108301  -1.11874343  2.632971e-01
## factor(Munic)Konjic        0.0147493360 0.1496709847   0.09854506  9.215030e-01
## factor(Munic)Kotor Varos  -0.0890507072 0.2245465896  -0.39658009  6.916921e-01
## factor(Munic)Kresevo       0.2302166356 0.1922752011   1.19732880  2.312286e-01
## factor(Munic)Kupres        0.1221889579 0.2198846022   0.55569584  5.784408e-01
## factor(Munic)Laktasi       0.1083763987 0.1663538107   0.65148131  5.147623e-01
## factor(Munic)Livno         0.3935108502 0.1672692281   2.35255973  1.867878e-02
## factor(Munic)Lopare       -0.4001350853 0.1608903450  -2.48700496  1.291098e-02
## factor(Munic)Lukavac       0.1032734526 0.1679524034   0.61489714  5.386474e-01
## factor(Munic)Ljubuski      0.2632026050 0.1675023283   1.57133699  1.161603e-01
## factor(Munic)Maglaj       -0.0805709740 0.1611842172  -0.49986888  6.171869e-01
## factor(Munic)Modrica      -0.1821779487 0.1537035652  -1.18525519  2.359664e-01
## factor(Munic)Mrkonjic      0.1927299978 0.2583314209   0.74605713  4.556639e-01
## factor(Munic)N.G.Sarajevo  0.2095634197 0.1323582975   1.58330398  1.134081e-01
## factor(Munic)N.Gorazde    -0.7273542709 0.1878876097  -3.87121999  1.095124e-04
## factor(Munic)N.Sarajevo    0.2685478238 0.1527720973   1.75783293  7.883004e-02
## factor(Munic)N.Travnik    -0.2640816802 0.1480214882  -1.78407665  7.446481e-02
## factor(Munic)Nevesinje     0.0203802651 0.2423425325   0.08409694  9.329823e-01
## factor(Munic)Novi Grad    -0.2875272076 0.1512172792  -1.90141768  5.729810e-02
## factor(Munic)Olovo        -0.2071346523 0.2495193386  -0.83013466  4.064977e-01
## factor(Munic)Orasje        0.2871786043 0.1744583368   1.64611568  9.979551e-02
## factor(Munic)Pale          0.0932130462 0.1944859302   0.47927912  6.317586e-01
## factor(Munic)Posusje       0.4707249763 0.1994874069   2.35967264  1.832486e-02
## factor(Munic)Prijedor      0.0833993771 0.1471773127   0.56665919  5.709682e-01
## factor(Munic)Prnjavor     -0.5126418045 0.1472225695  -3.48208706  5.012848e-04
## factor(Munic)Prozor        0.0147487247 0.2051969354   0.07187595  9.427032e-01
## factor(Munic)Ribnik       -0.0592717634 0.2119968524  -0.27958794  7.798039e-01
## factor(Munic)Rogatica      0.1152662117 0.2055113977   0.56087503  5.749050e-01
## factor(Munic)Rudo         -0.3211444127 0.1810825883  -1.77346931  7.620478e-02
## factor(Munic)S.Brijeg      0.6813370080 0.1557732672   4.37390202  1.242372e-05
## factor(Munic)S.G.Sarajevo  0.3537694833 0.1608837264   2.19891403  2.792439e-02
## factor(Munic)Samac        -0.1625315451 0.1446841708  -1.12335402  2.613349e-01
## factor(Munic)Sanski Most   0.1585563458 0.1473525220   1.07603415  2.819579e-01
## factor(Munic)Sokolac      -0.1079134269 0.2426031530  -0.44481461  6.564708e-01
## factor(Munic)Srbac         0.1451319468 0.2118520708   0.68506268  4.933324e-01
## factor(Munic)Srebrenica    0.3759660918 0.2582450649   1.45585005  1.454896e-01
## factor(Munic)Srebrenik     0.0402092624 0.2419627640   0.16617955  8.680216e-01
## factor(Munic)Stolac        0.3474171667 0.2159646785   1.60867587  1.077431e-01
## factor(Munic)Teocak       -0.5635119876 0.2422296336  -2.32635446  2.003481e-02
## factor(Munic)Tesanj       -0.1259873262 0.1481047863  -0.85066343  3.949924e-01
## factor(Munic)Teslic       -0.1289718532 0.1563361054  -0.82496524  4.094261e-01
## factor(Munic)Tomislavgrad  0.3374850733 0.2119515545   1.59227458  1.113789e-01
## factor(Munic)Travnik       0.3911258735 0.1384313676   2.82541363  4.738513e-03
## factor(Munic)Trebinje     -0.0532953434 0.1641794435  -0.32461642  7.454834e-01
## factor(Munic)Tuzla        -0.1262042661 0.1417135068  -0.89055919  3.732036e-01
## factor(Munic)Ugljevik     -0.0293755811 0.1858579629  -0.15805393  8.744199e-01
## factor(Munic)V.Kladusa    -0.3842763047 0.1457995840  -2.63564747  8.420619e-03
## factor(Munic)Visegrad     -0.3946757440 0.1879997365  -2.09934201  3.583098e-02
## factor(Munic)Visoko       -0.0232773131 0.1550891323  -0.15008990  8.806990e-01
## factor(Munic)Vitez        -0.1724003322 0.1479572292  -1.16520384  2.439856e-01
## factor(Munic)Vlasenica     0.1676723641 0.2156890876   0.77737991  4.369672e-01
## factor(Munic)Vogosca       0.1552584737 0.1921810480   0.80787609  4.191959e-01
## factor(Munic)Zavidovici   -0.0458720275 0.1501808678  -0.30544522  7.600383e-01
## factor(Munic)Zenica       -0.0257084579 0.1335184935  -0.19254605  8.473214e-01
## factor(Munic)Zepce        -0.1078641504 0.2422070050  -0.44533869  6.560921e-01
## factor(Munic)Zivinice     -0.2865965764 0.1502968376  -1.90687030  5.658801e-02
## factor(Munic)Zvornik      -0.3849162312 0.1520254391  -2.53191988  1.137084e-02
model.coef1[,c("Estimate","Pr(>|t|)")]
##                                Estimate      Pr(>|t|)
## (Intercept)                4.0257218985 2.372623e-119
## Age                        0.0848380691  5.745860e-54
## as.numeric(Age^2)         -0.0009401709  6.092529e-50
## Sex_                      -0.1724208888  1.613758e-15
## Educ.1elementary           0.1905907253  5.956734e-03
## Educ.1high schl            0.6576534903  2.564532e-22
## Educ.1faculty              1.1946603259  6.564151e-62
## factor(Munic)B.Petrovac   -0.0737173855  7.331042e-01
## factor(Munic)Banovici     -0.0355336130  8.407547e-01
## factor(Munic)Banja Luka    0.0291152186  8.254363e-01
## factor(Munic)Bihac        -0.1955369552  1.695304e-01
## factor(Munic)Bijeljina    -0.0794277352  5.457502e-01
## factor(Munic)Bileca       -0.2743646169  2.331029e-01
## factor(Munic)Bratunac      0.0318851848  8.870508e-01
## factor(Munic)Brcko        -0.0166596215  8.971318e-01
## factor(Munic)Breza         0.1187819444  5.756655e-01
## factor(Munic)Brod         -0.5813261339  6.258827e-04
## factor(Munic)Bugojno      -0.3800782751  7.465232e-03
## factor(Munic)Busovaca     -0.0113722346  9.483313e-01
## factor(Munic)Buzim        -0.5533257067  1.402837e-02
## factor(Munic)C.Sarajevo    0.2647075427  8.549378e-02
## factor(Munic)Cajnice      -0.5264740146  1.035201e-02
## factor(Munic)Capljina      0.4156761794  1.950726e-02
## factor(Munic)Cazin        -0.1519299824  3.029794e-01
## factor(Munic)Celinac      -0.4162818750  7.043273e-02
## factor(Munic)Citluk        0.1435882088  4.321225e-01
## factor(Munic)D.Vakuf      -0.5549446773  4.085523e-04
## factor(Munic)Derventa     -0.5182181011  9.564430e-04
## factor(Munic)Doboj        -0.2673372739  5.439694e-02
## factor(Munic)Doboj-Jug    -0.1945112194  4.512759e-01
## factor(Munic)Drvar        -0.0559718751  7.764202e-01
## factor(Munic)Foca - RS    -0.2819089596  9.043710e-02
## factor(Munic)Fojnica       0.0906048339  6.865815e-01
## factor(Munic)G.Vakuf      -0.4278594451  8.362766e-03
## factor(Munic)Gacko         0.3198822243  8.900273e-02
## factor(Munic)Glamoc        0.0310621178  8.979712e-01
## factor(Munic)Gorazde       0.1519577273  3.662694e-01
## factor(Munic)Gracanica    -0.2576567265  1.095976e-01
## factor(Munic)Grad Mostar   0.2046876935  1.247012e-01
## factor(Munic)Gradacac     -0.0575877343  7.202125e-01
## factor(Munic)Gradiska     -0.0946104936  6.304867e-01
## factor(Munic)Grude         0.3184714407  6.628615e-02
## factor(Munic)Hadzici      -0.5486132505  8.496248e-03
## factor(Munic)I.Ilidza      0.0598974789  7.815286e-01
## factor(Munic)Ilidza        0.4301277799  5.973343e-03
## factor(Munic)Ilijas       -0.1133163369  5.693360e-01
## factor(Munic)Jajce         0.0315182601  8.627432e-01
## factor(Munic)K.Dubica     -0.0640620514  7.756747e-01
## factor(Munic)Kakanj        0.0593390125  7.225237e-01
## factor(Munic)Kalesija     -0.6405542445  1.071008e-04
## factor(Munic)Kiseljak      0.1725244813  3.132022e-01
## factor(Munic)Kladanj      -0.4881110509  1.300562e-02
## factor(Munic)Kljuc        -0.0530960672  7.988203e-01
## factor(Munic)Knezevo      -0.2570993566  2.632971e-01
## factor(Munic)Konjic        0.0147493360  9.215030e-01
## factor(Munic)Kotor Varos  -0.0890507072  6.916921e-01
## factor(Munic)Kresevo       0.2302166356  2.312286e-01
## factor(Munic)Kupres        0.1221889579  5.784408e-01
## factor(Munic)Laktasi       0.1083763987  5.147623e-01
## factor(Munic)Livno         0.3935108502  1.867878e-02
## factor(Munic)Lopare       -0.4001350853  1.291098e-02
## factor(Munic)Lukavac       0.1032734526  5.386474e-01
## factor(Munic)Ljubuski      0.2632026050  1.161603e-01
## factor(Munic)Maglaj       -0.0805709740  6.171869e-01
## factor(Munic)Modrica      -0.1821779487  2.359664e-01
## factor(Munic)Mrkonjic      0.1927299978  4.556639e-01
## factor(Munic)N.G.Sarajevo  0.2095634197  1.134081e-01
## factor(Munic)N.Gorazde    -0.7273542709  1.095124e-04
## factor(Munic)N.Sarajevo    0.2685478238  7.883004e-02
## factor(Munic)N.Travnik    -0.2640816802  7.446481e-02
## factor(Munic)Nevesinje     0.0203802651  9.329823e-01
## factor(Munic)Novi Grad    -0.2875272076  5.729810e-02
## factor(Munic)Olovo        -0.2071346523  4.064977e-01
## factor(Munic)Orasje        0.2871786043  9.979551e-02
## factor(Munic)Pale          0.0932130462  6.317586e-01
## factor(Munic)Posusje       0.4707249763  1.832486e-02
## factor(Munic)Prijedor      0.0833993771  5.709682e-01
## factor(Munic)Prnjavor     -0.5126418045  5.012848e-04
## factor(Munic)Prozor        0.0147487247  9.427032e-01
## factor(Munic)Ribnik       -0.0592717634  7.798039e-01
## factor(Munic)Rogatica      0.1152662117  5.749050e-01
## factor(Munic)Rudo         -0.3211444127  7.620478e-02
## factor(Munic)S.Brijeg      0.6813370080  1.242372e-05
## factor(Munic)S.G.Sarajevo  0.3537694833  2.792439e-02
## factor(Munic)Samac        -0.1625315451  2.613349e-01
## factor(Munic)Sanski Most   0.1585563458  2.819579e-01
## factor(Munic)Sokolac      -0.1079134269  6.564708e-01
## factor(Munic)Srbac         0.1451319468  4.933324e-01
## factor(Munic)Srebrenica    0.3759660918  1.454896e-01
## factor(Munic)Srebrenik     0.0402092624  8.680216e-01
## factor(Munic)Stolac        0.3474171667  1.077431e-01
## factor(Munic)Teocak       -0.5635119876  2.003481e-02
## factor(Munic)Tesanj       -0.1259873262  3.949924e-01
## factor(Munic)Teslic       -0.1289718532  4.094261e-01
## factor(Munic)Tomislavgrad  0.3374850733  1.113789e-01
## factor(Munic)Travnik       0.3911258735  4.738513e-03
## factor(Munic)Trebinje     -0.0532953434  7.454834e-01
## factor(Munic)Tuzla        -0.1262042661  3.732036e-01
## factor(Munic)Ugljevik     -0.0293755811  8.744199e-01
## factor(Munic)V.Kladusa    -0.3842763047  8.420619e-03
## factor(Munic)Visegrad     -0.3946757440  3.583098e-02
## factor(Munic)Visoko       -0.0232773131  8.806990e-01
## factor(Munic)Vitez        -0.1724003322  2.439856e-01
## factor(Munic)Vlasenica     0.1676723641  4.369672e-01
## factor(Munic)Vogosca       0.1552584737  4.191959e-01
## factor(Munic)Zavidovici   -0.0458720275  7.600383e-01
## factor(Munic)Zenica       -0.0257084579  8.473214e-01
## factor(Munic)Zepce        -0.1078641504  6.560921e-01
## factor(Munic)Zivinice     -0.2865965764  5.658801e-02
## factor(Munic)Zvornik      -0.3849162312  1.137084e-02
model.coef1 <- model.coef1
model.coef1 <- as.data.frame.array(model.coef1[-c(1:7),]) # da bude dataframe a ne matrix i da mi brise prvih 11 redova koji su drugi koeficijenti
Munic <- rownames(model.coef1)
model.coef1$Munic <- Munic
rownames(model.coef1) <- 1:103 #nedostaje B.Grahovo koje je 0
head(model.coef1)
##      Estimate Std. Error    t value  Pr(>|t|)                   Munic
## 1 -0.07371739  0.2161699 -0.3410160 0.7331042 factor(Munic)B.Petrovac
## 2 -0.03553361  0.1768392 -0.2009374 0.8407547   factor(Munic)Banovici
## 3  0.02911522  0.1320007  0.2205686 0.8254363 factor(Munic)Banja Luka
## 4 -0.19553696  0.1423236 -1.3738896 0.1695304      factor(Munic)Bihac
## 5 -0.07942774  0.1314644 -0.6041769 0.5457502  factor(Munic)Bijeljina
## 6 -0.27436462  0.2300691 -1.1925316 0.2331029     factor(Munic)Bileca

Make a new variable with municipal names without factor(Munic)

Munic1 <- sapply(strsplit(Munic, split=')', fixed=TRUE), function(x) (x[2]))
Munic1
##   [1] "B.Petrovac"   "Banovici"     "Banja Luka"   "Bihac"        "Bijeljina"   
##   [6] "Bileca"       "Bratunac"     "Brcko"        "Breza"        "Brod"        
##  [11] "Bugojno"      "Busovaca"     "Buzim"        "C.Sarajevo"   "Cajnice"     
##  [16] "Capljina"     "Cazin"        "Celinac"      "Citluk"       "D.Vakuf"     
##  [21] "Derventa"     "Doboj"        "Doboj-Jug"    "Drvar"        "Foca - RS"   
##  [26] "Fojnica"      "G.Vakuf"      "Gacko"        "Glamoc"       "Gorazde"     
##  [31] "Gracanica"    "Grad Mostar"  "Gradacac"     "Gradiska"     "Grude"       
##  [36] "Hadzici"      "I.Ilidza"     "Ilidza"       "Ilijas"       "Jajce"       
##  [41] "K.Dubica"     "Kakanj"       "Kalesija"     "Kiseljak"     "Kladanj"     
##  [46] "Kljuc"        "Knezevo"      "Konjic"       "Kotor Varos"  "Kresevo"     
##  [51] "Kupres"       "Laktasi"      "Livno"        "Lopare"       "Lukavac"     
##  [56] "Ljubuski"     "Maglaj"       "Modrica"      "Mrkonjic"     "N.G.Sarajevo"
##  [61] "N.Gorazde"    "N.Sarajevo"   "N.Travnik"    "Nevesinje"    "Novi Grad"   
##  [66] "Olovo"        "Orasje"       "Pale"         "Posusje"      "Prijedor"    
##  [71] "Prnjavor"     "Prozor"       "Ribnik"       "Rogatica"     "Rudo"        
##  [76] "S.Brijeg"     "S.G.Sarajevo" "Samac"        "Sanski Most"  "Sokolac"     
##  [81] "Srbac"        "Srebrenica"   "Srebrenik"    "Stolac"       "Teocak"      
##  [86] "Tesanj"       "Teslic"       "Tomislavgrad" "Travnik"      "Trebinje"    
##  [91] "Tuzla"        "Ugljevik"     "V.Kladusa"    "Visegrad"     "Visoko"      
##  [96] "Vitez"        "Vlasenica"    "Vogosca"      "Zavidovici"   "Zenica"      
## [101] "Zepce"        "Zivinice"     "Zvornik"
model.coef1$Munic1 <- Munic1

add B.Grahovo to dataframe

model.coef1[nrow(model.coef1) + 1,] = c(0, NA, NA, NA,"B.Grahovo","B.Grahovo" )
model.coef1$Estimate <- as.numeric(model.coef1$Estimate)
top10.m1 <- model.coef1  %>%
    dplyr::select(Estimate, Munic1) %>%
    arrange (desc(Estimate))%>%
    head(10) #top ten municipalities
top10.m1
##     Estimate       Munic1
## 1  0.6813370     S.Brijeg
## 2  0.4707250      Posusje
## 3  0.4301278       Ilidza
## 4  0.4156762     Capljina
## 5  0.3935109        Livno
## 6  0.3911259      Travnik
## 7  0.3759661   Srebrenica
## 8  0.3537695 S.G.Sarajevo
## 9  0.3474172       Stolac
## 10 0.3374851 Tomislavgrad

##Make a graf

merge estimates data and map data

map.coef1 <- merge(amraGIS, model.coef1, by.y='Munic1', by.x = "NAME_4",all = TRUE)#104 munic ako nema argumenta all=T, sa njim je 144- sad stoji 142 vidi da nije usora ili slicno

now WI.1 (dependent log(wages))

WI.1 <- lm (log(wages)~ Age + as.numeric(Age^2) + Sex_ + Educ.1 + factor(Munic), data = WI.df)

library(gridExtra)# radi funkcije tableGrob
## 
## Attaching package: 'gridExtra'
## The following object is masked from 'package:dplyr':
## 
##     combine
library(patchwork) #radi spajanja mape i tabele
## 
## Attaching package: 'patchwork'
## The following object is masked from 'package:raster':
## 
##     area
library(ggplot2)
g1 = ggplot() + geom_sf(data = map.coef1, aes(geometry=geometry, fill = Estimate)) + scale_fill_viridis_c() + scale_x_continuous() 

g1 + ggtitle("WI.1 <- lm (log(wages)~ Age + as.numeric(Age^2) + Sex_ + Educ.1 + factor(Munic), data = WI.df)") + theme(plot.title = element_text(color="gray", size=12, face="italic"))

#grafikon ispod spaja mi mapu i top 10 municipalities
TABLE <- tableGrob(top10.m1, theme = ttheme_default(base_size = 5))

g1 + ggtitle("WI.1 <- lm (log(wages)~ Age + as.numeric(Age^2) + Sex_ + Educ.1 + factor(Munic), data = WI.df)") + theme(plot.title = element_text(color="gray", size=12, face="italic")) + plot_spacer() + TABLE + plot_layout(widths = c(12, -1.3 ,5)) #plot_layout prvi broj oznacava velicinu mape, drugi velicinu razmaka izmedju mape i tabele i treci oznacava prostor za tabelu

g1 + geom_sf_text(data= map.coef1, aes(geometry=geometry,label=ifelse(as.numeric(Estimate) >= 0.6,as.character(NAME_4),"")),hjust=0.5,vjust=0,cex =3, col="black") + geom_sf_text(data= map.coef1, aes(geometry=geometry,label=ifelse(as.numeric(Estimate) < -0.4,as.character(NAME_4),"")),hjust=0.5,vjust=0,cex =3, col="red")
## Warning in st_point_on_surface.sfc(sf::st_zm(x)): st_point_on_surface may not
## give correct results for longitude/latitude data

## Warning in st_point_on_surface.sfc(sf::st_zm(x)): st_point_on_surface may not
## give correct results for longitude/latitude data
## Warning: Removed 37 rows containing missing values (`geom_text()`).
## Removed 37 rows containing missing values (`geom_text()`).

Coeff and maping model WI.2

Extracting the coefficients from the second model

model.coef2 <- summary(WI.2)$coefficients
model.coef2 # vidi koliko redova su koef.za druge varijable
##                                Estimate   Std. Error      t value      Pr(>|t|)
## (Intercept)                4.8974881777 1.475394e-01  33.19444002 6.805473e-221
## Age                        0.0502491580 4.858542e-03  10.34243651  7.536450e-25
## as.numeric(Age^2)         -0.0004995228 5.678137e-05  -8.79730109  1.834748e-18
## Sex_                      -0.1788987709 1.871194e-02  -9.56067416  1.700083e-21
## Educ.1elementary           0.1498752620 5.967735e-02   2.51142626  1.205212e-02
## Educ.1high schl            0.4202047622 5.855172e-02   7.17664262  8.064699e-13
## Educ.1faculty              0.8307544635 6.239397e-02  13.31466043  7.543655e-40
## RurUrb                     0.0627681682 2.169951e-02   2.89260801  3.835174e-03
## Activ.1Other              -1.0508936850 1.340885e-01  -7.83731542  5.461775e-15
## Activ.1part time          -0.8551374858 3.125263e-02 -27.36209825 6.635537e-155
## Activ.1pension            -1.1757615342 6.035121e-02 -19.48198866  7.206432e-82
## Activ.1unemployed         -1.1013139882 3.112661e-02 -35.38175417 7.116102e-248
## factor(Munic)B.Petrovac    0.1086176041 1.861290e-01   0.58356090  5.595391e-01
## factor(Munic)Banovici      0.2587709048 1.522440e-01   1.69971182  8.924019e-02
## factor(Munic)Banja Luka    0.1318584799 1.137283e-01   1.15941629  2.463355e-01
## factor(Munic)Bihac        -0.0645054523 1.225304e-01  -0.52644438  5.986002e-01
## factor(Munic)Bijeljina    -0.0724139226 1.129952e-01  -0.64085857  5.216406e-01
## factor(Munic)Bileca       -0.0269303495 1.982685e-01  -0.13582765  8.919624e-01
## factor(Munic)Bratunac      0.1626006685 1.932563e-01   0.84137335  4.001744e-01
## factor(Munic)Brcko         0.1837364079 1.109069e-01   1.65667250  9.764123e-02
## factor(Munic)Breza         0.2105263327 1.824168e-01   1.15409490  2.485101e-01
## factor(Munic)Brod         -0.5349512092 1.461012e-01  -3.66151062  2.530241e-04
## factor(Munic)Bugojno       0.0070990452 1.225175e-01   0.05794312  9.537960e-01
## factor(Munic)Busovaca      0.2122364197 1.509568e-01   1.40594107  1.597966e-01
## factor(Munic)Buzim        -0.4990690274 1.937087e-01  -2.57638990  1.000896e-02
## factor(Munic)C.Sarajevo    0.3302131816 1.328679e-01   2.48527464  1.297386e-02
## factor(Munic)Cajnice      -0.1989152690 1.767052e-01  -1.12569022  2.603445e-01
## factor(Munic)Capljina      0.5372878611 1.530805e-01   3.50983974  4.518734e-04
## factor(Munic)Cazin        -0.0738851297 1.267798e-01  -0.58278307  5.600626e-01
## factor(Munic)Celinac      -0.1315345970 1.978500e-01  -0.66481990  5.061928e-01
## factor(Munic)Citluk        0.2477885987 1.571276e-01   1.57698969  1.148539e-01
## factor(Munic)D.Vakuf      -0.0776367331 1.356920e-01  -0.57215395  5.672404e-01
## factor(Munic)Derventa     -0.4238327184 1.349160e-01  -3.14145549  1.689789e-03
## factor(Munic)Doboj         0.1390613680 1.198503e-01   1.16029193  2.459790e-01
## factor(Munic)Doboj-Jug    -0.0793016721 2.220577e-01  -0.35712188  7.210139e-01
## factor(Munic)Drvar         0.1550634114 1.695121e-01   0.91476327  3.603550e-01
## factor(Munic)Foca - RS     0.0288509044 1.434932e-01   0.20106109  8.406580e-01
## factor(Munic)Fojnica       0.2591251778 1.931027e-01   1.34190331  1.796813e-01
## factor(Munic)G.Vakuf       0.0529134239 1.401232e-01   0.37762074  7.057265e-01
## factor(Munic)Gacko         0.2563966261 1.619203e-01   1.58347429  1.133694e-01
## factor(Munic)Glamoc        0.3101372251 2.086213e-01   1.48660406  1.371752e-01
## factor(Munic)Gorazde       0.2679142556 1.445740e-01   1.85312831  6.391607e-02
## factor(Munic)Gracanica    -0.0334700967 1.385872e-01  -0.24150924  8.091692e-01
## factor(Munic)Grad Mostar   0.3529506893 1.147051e-01   3.07702803  2.100766e-03
## factor(Munic)Gradacac      0.0047194559 1.382538e-01   0.03413616  9.727698e-01
## factor(Munic)Gradiska      0.0665785131 1.691017e-01   0.39371875  6.938036e-01
## factor(Munic)Grude         0.4820874362 1.490694e-01   3.23397963  1.227802e-03
## factor(Munic)Hadzici      -0.0833852750 1.796841e-01  -0.46406604  6.426183e-01
## factor(Munic)I.Ilidza      0.0279936638 1.858995e-01   0.15058493  8.803085e-01
## factor(Munic)Ilidza        0.5264062733 1.351409e-01   3.89524147  9.923371e-05
## factor(Munic)Ilijas        0.1326697310 1.713447e-01   0.77428560  4.387943e-01
## factor(Munic)Jajce         0.4002589550 1.569781e-01   2.54977547  1.080541e-02
## factor(Munic)K.Dubica     -0.0704719338 1.932623e-01  -0.36464402  7.153908e-01
## factor(Munic)Kakanj        0.1446363284 1.436552e-01   1.00682969  3.140597e-01
## factor(Munic)Kalesija     -0.2001991237 1.427512e-01  -1.40243408  1.608406e-01
## factor(Munic)Kiseljak      0.3216289347 1.471211e-01   2.18615035  2.884550e-02
## factor(Munic)Kladanj      -0.1155517084 1.691108e-01  -0.68328986  4.944517e-01
## factor(Munic)Kljuc         0.0959129533 1.791127e-01   0.53548953  5.923325e-01
## factor(Munic)Knezevo      -0.1051899267 1.976651e-01  -0.53216239  5.946345e-01
## factor(Munic)Konjic        0.2628085813 1.288122e-01   2.04024637  4.137219e-02
## factor(Munic)Kotor Varos   0.0731686519 1.931254e-01   0.37886604  7.048016e-01
## factor(Munic)Kresevo       0.3138418021 1.652574e-01   1.89910839  5.760111e-02
## factor(Munic)Kupres        0.2031637663 1.892608e-01   1.07345952  2.831108e-01
## factor(Munic)Laktasi       0.0675249020 1.430322e-01   0.47209565  6.368767e-01
## factor(Munic)Livno         0.5520950608 1.438925e-01   3.83685744  1.259777e-04
## factor(Munic)Lopare        0.0546753238 1.390496e-01   0.39320745  6.941811e-01
## factor(Munic)Lukavac       0.2909527124 1.444673e-01   2.01396994  4.406000e-02
## factor(Munic)Ljubuski      0.4449707380 1.441661e-01   3.08651463  2.034986e-03
## factor(Munic)Maglaj        0.1142393414 1.386455e-01   0.82396738  4.099929e-01
## factor(Munic)Modrica       0.0190732518 1.323520e-01   0.14411002  8.854187e-01
## factor(Munic)Mrkonjic      0.3068538978 2.222359e-01   1.38075732  1.674082e-01
## factor(Munic)N.G.Sarajevo  0.3146314306 1.145796e-01   2.74596327  6.052449e-03
## factor(Munic)N.Gorazde    -0.2671842521 1.620860e-01  -1.64841046  9.932407e-02
## factor(Munic)N.Sarajevo    0.3964384975 1.320064e-01   3.00317708  2.683472e-03
## factor(Munic)N.Travnik    -0.0555494843 1.275061e-01  -0.43566152  6.630990e-01
## factor(Munic)Nevesinje     0.1102687689 2.082977e-01   0.52938067  5.965622e-01
## factor(Munic)Novi Grad    -0.1102362991 1.300928e-01  -0.84736696  3.968265e-01
## factor(Munic)Olovo         0.2793889634 2.150802e-01   1.29899899  1.939973e-01
## factor(Munic)Orasje        0.4987841905 1.502315e-01   3.32010310  9.055463e-04
## factor(Munic)Pale          0.1357891608 1.673405e-01   0.81145402  4.171392e-01
## factor(Munic)Posusje       0.5720446193 1.715026e-01   3.33548581  8.569962e-04
## factor(Munic)Prijedor      0.1635617088 1.265200e-01   1.29277322  1.961424e-01
## factor(Munic)Prnjavor     -0.1454875016 1.269987e-01  -1.14558287  2.520163e-01
## factor(Munic)Prozor        0.3549442492 1.765883e-01   2.01001023  4.447755e-02
## factor(Munic)Ribnik        0.1040182930 1.824174e-01   0.57022123  5.685503e-01
## factor(Munic)Rogatica      0.0760250441 1.768414e-01   0.42990527  6.672809e-01
## factor(Munic)Rudo         -0.0242254666 1.562280e-01  -0.15506479  8.767758e-01
## factor(Munic)S.Brijeg      0.7269261741 1.339703e-01   5.42602554  6.002150e-08
## factor(Munic)S.G.Sarajevo  0.3847602962 1.388931e-01   2.77019014  5.620660e-03
## factor(Munic)Samac         0.0675015877 1.245717e-01   0.54186957  5.879297e-01
## factor(Munic)Sanski Most   0.1158605559 1.266577e-01   0.91475300  3.603603e-01
## factor(Munic)Sokolac       0.0208420835 2.087331e-01   0.09985041  9.204666e-01
## factor(Munic)Srbac         0.0885775389 1.820937e-01   0.48643932  6.266746e-01
## factor(Munic)Srebrenica    0.2569989570 2.222190e-01   1.15651213  2.475206e-01
## factor(Munic)Srebrenik     0.1863723193 2.080438e-01   0.89583202  3.703807e-01
## factor(Munic)Stolac        0.4930984974 1.857071e-01   2.65524898  7.947225e-03
## factor(Munic)Teocak        0.1398745589 2.089159e-01   0.66952553  5.031877e-01
## factor(Munic)Tesanj        0.0017195772 1.274533e-01   0.01349183  9.892359e-01
## factor(Munic)Teslic        0.1062227361 1.344749e-01   0.78990741  4.296150e-01
## factor(Munic)Tomislavgrad  0.4839548422 1.823255e-01   2.65434541  7.968512e-03
## factor(Munic)Travnik       0.3740268312 1.189772e-01   3.14368553  1.676989e-03
## factor(Munic)Trebinje      0.0448783634 1.416766e-01   0.31676613  7.514328e-01
## factor(Munic)Tuzla         0.0402644037 1.219509e-01   0.33016905  7.412845e-01
## factor(Munic)Ugljevik      0.2489343522 1.600432e-01   1.55541996  1.199021e-01
## factor(Munic)V.Kladusa    -0.0443240784 1.256143e-01  -0.35285861  7.242076e-01
## factor(Munic)Visegrad     -0.0410434313 1.620525e-01  -0.25327238  8.000670e-01
## factor(Munic)Visoko        0.1588395850 1.334109e-01   1.19060434  2.338590e-01
## factor(Munic)Vitez        -0.0027181785 1.273409e-01  -0.02134568  9.829707e-01
## factor(Munic)Vlasenica     0.1249874301 1.855062e-01   0.67376418  5.004888e-01
## factor(Munic)Vogosca       0.1846365182 1.652808e-01   1.11710785  2.639957e-01
## factor(Munic)Zavidovici    0.0769873732 1.291169e-01   0.59626121  5.510246e-01
## factor(Munic)Zenica        0.1722443534 1.149328e-01   1.49865281  1.340196e-01
## factor(Munic)Zepce         0.0428738227 2.083365e-01   0.20579117  8.369614e-01
## factor(Munic)Zivinice     -0.0884593187 1.293121e-01  -0.68407613  4.939552e-01
## factor(Munic)Zvornik      -0.3042052592 1.306744e-01  -2.32796437  1.994912e-02
model.coef2[,c("Estimate","Pr(>|t|)")]
##                                Estimate      Pr(>|t|)
## (Intercept)                4.8974881777 6.805473e-221
## Age                        0.0502491580  7.536450e-25
## as.numeric(Age^2)         -0.0004995228  1.834748e-18
## Sex_                      -0.1788987709  1.700083e-21
## Educ.1elementary           0.1498752620  1.205212e-02
## Educ.1high schl            0.4202047622  8.064699e-13
## Educ.1faculty              0.8307544635  7.543655e-40
## RurUrb                     0.0627681682  3.835174e-03
## Activ.1Other              -1.0508936850  5.461775e-15
## Activ.1part time          -0.8551374858 6.635537e-155
## Activ.1pension            -1.1757615342  7.206432e-82
## Activ.1unemployed         -1.1013139882 7.116102e-248
## factor(Munic)B.Petrovac    0.1086176041  5.595391e-01
## factor(Munic)Banovici      0.2587709048  8.924019e-02
## factor(Munic)Banja Luka    0.1318584799  2.463355e-01
## factor(Munic)Bihac        -0.0645054523  5.986002e-01
## factor(Munic)Bijeljina    -0.0724139226  5.216406e-01
## factor(Munic)Bileca       -0.0269303495  8.919624e-01
## factor(Munic)Bratunac      0.1626006685  4.001744e-01
## factor(Munic)Brcko         0.1837364079  9.764123e-02
## factor(Munic)Breza         0.2105263327  2.485101e-01
## factor(Munic)Brod         -0.5349512092  2.530241e-04
## factor(Munic)Bugojno       0.0070990452  9.537960e-01
## factor(Munic)Busovaca      0.2122364197  1.597966e-01
## factor(Munic)Buzim        -0.4990690274  1.000896e-02
## factor(Munic)C.Sarajevo    0.3302131816  1.297386e-02
## factor(Munic)Cajnice      -0.1989152690  2.603445e-01
## factor(Munic)Capljina      0.5372878611  4.518734e-04
## factor(Munic)Cazin        -0.0738851297  5.600626e-01
## factor(Munic)Celinac      -0.1315345970  5.061928e-01
## factor(Munic)Citluk        0.2477885987  1.148539e-01
## factor(Munic)D.Vakuf      -0.0776367331  5.672404e-01
## factor(Munic)Derventa     -0.4238327184  1.689789e-03
## factor(Munic)Doboj         0.1390613680  2.459790e-01
## factor(Munic)Doboj-Jug    -0.0793016721  7.210139e-01
## factor(Munic)Drvar         0.1550634114  3.603550e-01
## factor(Munic)Foca - RS     0.0288509044  8.406580e-01
## factor(Munic)Fojnica       0.2591251778  1.796813e-01
## factor(Munic)G.Vakuf       0.0529134239  7.057265e-01
## factor(Munic)Gacko         0.2563966261  1.133694e-01
## factor(Munic)Glamoc        0.3101372251  1.371752e-01
## factor(Munic)Gorazde       0.2679142556  6.391607e-02
## factor(Munic)Gracanica    -0.0334700967  8.091692e-01
## factor(Munic)Grad Mostar   0.3529506893  2.100766e-03
## factor(Munic)Gradacac      0.0047194559  9.727698e-01
## factor(Munic)Gradiska      0.0665785131  6.938036e-01
## factor(Munic)Grude         0.4820874362  1.227802e-03
## factor(Munic)Hadzici      -0.0833852750  6.426183e-01
## factor(Munic)I.Ilidza      0.0279936638  8.803085e-01
## factor(Munic)Ilidza        0.5264062733  9.923371e-05
## factor(Munic)Ilijas        0.1326697310  4.387943e-01
## factor(Munic)Jajce         0.4002589550  1.080541e-02
## factor(Munic)K.Dubica     -0.0704719338  7.153908e-01
## factor(Munic)Kakanj        0.1446363284  3.140597e-01
## factor(Munic)Kalesija     -0.2001991237  1.608406e-01
## factor(Munic)Kiseljak      0.3216289347  2.884550e-02
## factor(Munic)Kladanj      -0.1155517084  4.944517e-01
## factor(Munic)Kljuc         0.0959129533  5.923325e-01
## factor(Munic)Knezevo      -0.1051899267  5.946345e-01
## factor(Munic)Konjic        0.2628085813  4.137219e-02
## factor(Munic)Kotor Varos   0.0731686519  7.048016e-01
## factor(Munic)Kresevo       0.3138418021  5.760111e-02
## factor(Munic)Kupres        0.2031637663  2.831108e-01
## factor(Munic)Laktasi       0.0675249020  6.368767e-01
## factor(Munic)Livno         0.5520950608  1.259777e-04
## factor(Munic)Lopare        0.0546753238  6.941811e-01
## factor(Munic)Lukavac       0.2909527124  4.406000e-02
## factor(Munic)Ljubuski      0.4449707380  2.034986e-03
## factor(Munic)Maglaj        0.1142393414  4.099929e-01
## factor(Munic)Modrica       0.0190732518  8.854187e-01
## factor(Munic)Mrkonjic      0.3068538978  1.674082e-01
## factor(Munic)N.G.Sarajevo  0.3146314306  6.052449e-03
## factor(Munic)N.Gorazde    -0.2671842521  9.932407e-02
## factor(Munic)N.Sarajevo    0.3964384975  2.683472e-03
## factor(Munic)N.Travnik    -0.0555494843  6.630990e-01
## factor(Munic)Nevesinje     0.1102687689  5.965622e-01
## factor(Munic)Novi Grad    -0.1102362991  3.968265e-01
## factor(Munic)Olovo         0.2793889634  1.939973e-01
## factor(Munic)Orasje        0.4987841905  9.055463e-04
## factor(Munic)Pale          0.1357891608  4.171392e-01
## factor(Munic)Posusje       0.5720446193  8.569962e-04
## factor(Munic)Prijedor      0.1635617088  1.961424e-01
## factor(Munic)Prnjavor     -0.1454875016  2.520163e-01
## factor(Munic)Prozor        0.3549442492  4.447755e-02
## factor(Munic)Ribnik        0.1040182930  5.685503e-01
## factor(Munic)Rogatica      0.0760250441  6.672809e-01
## factor(Munic)Rudo         -0.0242254666  8.767758e-01
## factor(Munic)S.Brijeg      0.7269261741  6.002150e-08
## factor(Munic)S.G.Sarajevo  0.3847602962  5.620660e-03
## factor(Munic)Samac         0.0675015877  5.879297e-01
## factor(Munic)Sanski Most   0.1158605559  3.603603e-01
## factor(Munic)Sokolac       0.0208420835  9.204666e-01
## factor(Munic)Srbac         0.0885775389  6.266746e-01
## factor(Munic)Srebrenica    0.2569989570  2.475206e-01
## factor(Munic)Srebrenik     0.1863723193  3.703807e-01
## factor(Munic)Stolac        0.4930984974  7.947225e-03
## factor(Munic)Teocak        0.1398745589  5.031877e-01
## factor(Munic)Tesanj        0.0017195772  9.892359e-01
## factor(Munic)Teslic        0.1062227361  4.296150e-01
## factor(Munic)Tomislavgrad  0.4839548422  7.968512e-03
## factor(Munic)Travnik       0.3740268312  1.676989e-03
## factor(Munic)Trebinje      0.0448783634  7.514328e-01
## factor(Munic)Tuzla         0.0402644037  7.412845e-01
## factor(Munic)Ugljevik      0.2489343522  1.199021e-01
## factor(Munic)V.Kladusa    -0.0443240784  7.242076e-01
## factor(Munic)Visegrad     -0.0410434313  8.000670e-01
## factor(Munic)Visoko        0.1588395850  2.338590e-01
## factor(Munic)Vitez        -0.0027181785  9.829707e-01
## factor(Munic)Vlasenica     0.1249874301  5.004888e-01
## factor(Munic)Vogosca       0.1846365182  2.639957e-01
## factor(Munic)Zavidovici    0.0769873732  5.510246e-01
## factor(Munic)Zenica        0.1722443534  1.340196e-01
## factor(Munic)Zepce         0.0428738227  8.369614e-01
## factor(Munic)Zivinice     -0.0884593187  4.939552e-01
## factor(Munic)Zvornik      -0.3042052592  1.994912e-02
model.coef2 <- model.coef2
model.coef2 <- as.data.frame.array(model.coef2[-c(1:8),]) # da bude dataframe a ne matrix i da mi brise prvih 8 redova koji su drugi koeficijenti
Munic <- rownames(model.coef2)
model.coef2$Munic <- Munic

Make a new variable with municipal names without factor(Munic)

add B.Grahovo to dataframe

##Make a graf model 2

merge estimates data and map data

lm (log(wages)~ Age + as.numeric(Age^2)+ Sex_ + Educ.1 + RurUrb + factor (Munic) , data = WI.df)

now WI.2 (dependent log(wages))

WI.2 <- lm (log(wages)~ Age + as.numeric(Age^2)+ Sex_ + Educ.1 + RurUrb + factor (Munic) , data = WI.df)

Coeff and maping model WI.3

Extracting the coefficients from the THIRD - THE WINNING model

model.coef3 <- summary(WI.3)$coefficients
model.coef3 # vidi koliko redova su koef.za druge varijable
##                                Estimate   Std. Error       t value
## (Intercept)                4.8793565077 1.475023e-01  33.079878017
## Age                        0.0510515330 4.853778e-03  10.517897196
## as.numeric(Age^2)         -0.0005077991 5.674619e-05  -8.948601995
## Sex_                      -0.1727080537 1.860126e-02  -9.284750675
## Educ.1elementary           0.1528205926 5.970754e-02   2.559485485
## Educ.1high schl            0.4329804238 5.842295e-02   7.411136063
## Educ.1faculty              0.8550011344 6.186863e-02  13.819621959
## Activ.1Other              -1.0576054594 1.341558e-01  -7.883414298
## Activ.1part time          -0.8581430770 3.125570e-02 -27.455566430
## Activ.1pension            -1.1777845606 6.038648e-02 -19.504110516
## Activ.1unemployed         -1.1071285156 3.108187e-02 -35.619747345
## factor(Munic)B.Petrovac    0.1280041511 1.861295e-01   0.687715543
## factor(Munic)Banovici      0.2421404626 1.522345e-01   1.590575182
## factor(Munic)Banja Luka    0.1523090452 1.135823e-01   1.340957192
## factor(Munic)Bihac        -0.0469648316 1.224600e-01  -0.383511521
## factor(Munic)Bijeljina    -0.0718161484 1.130686e-01  -0.635155484
## factor(Munic)Bileca        0.0008572535 1.981647e-01   0.004325964
## factor(Munic)Bratunac      0.1823513469 1.932615e-01   0.943547402
## factor(Munic)Brcko         0.1911714168 1.109494e-01   1.723051088
## factor(Munic)Breza         0.2002715337 1.825012e-01   1.097370912
## factor(Munic)Brod         -0.5208437192 1.461150e-01  -3.564616023
## factor(Munic)Bugojno       0.0097514461 1.225939e-01   0.079542678
## factor(Munic)Busovaca      0.2077653786 1.510473e-01   1.375498892
## factor(Munic)Buzim        -0.5116816219 1.937858e-01  -2.640449895
## factor(Munic)C.Sarajevo    0.3648263987 1.324142e-01   2.755191268
## factor(Munic)Cajnice      -0.1872328166 1.767741e-01  -1.059164208
## factor(Munic)Capljina      0.5189477388 1.530488e-01   3.390734648
## factor(Munic)Cazin        -0.0695828225 1.268537e-01  -0.548528130
## factor(Munic)Celinac      -0.1268769074 1.979723e-01  -0.640881991
## factor(Munic)Citluk        0.2390299843 1.572008e-01   1.520539340
## factor(Munic)D.Vakuf      -0.0820118400 1.357720e-01  -0.604040808
## factor(Munic)Derventa     -0.4198947567 1.349971e-01  -3.110398865
## factor(Munic)Doboj         0.1373250943 1.199269e-01   1.145073116
## factor(Munic)Doboj-Jug    -0.1016545478 2.220678e-01  -0.457763486
## factor(Munic)Drvar         0.1593877716 1.696159e-01   0.939698127
## factor(Munic)Foca - RS     0.0487223710 1.434221e-01   0.339713166
## factor(Munic)Fojnica       0.2430657996 1.931487e-01   1.258438879
## factor(Munic)G.Vakuf       0.0441377918 1.401816e-01   0.314861443
## factor(Munic)Gacko         0.2841121900 1.617419e-01   1.756577701
## factor(Munic)Glamoc        0.3031566039 2.087432e-01   1.452294191
## factor(Munic)Gorazde       0.2692364922 1.446675e-01   1.861070615
## factor(Munic)Gracanica    -0.0380625983 1.386684e-01  -0.274486390
## factor(Munic)Grad Mostar   0.3631763638 1.147253e-01   3.165617466
## factor(Munic)Gradacac      0.0105747912 1.383291e-01   0.076446611
## factor(Munic)Gradiska      0.0550818281 1.691652e-01   0.325609776
## factor(Munic)Grude         0.4855499486 1.491617e-01   3.255190967
## factor(Munic)Hadzici      -0.0667213743 1.797087e-01  -0.371275093
## factor(Munic)I.Ilidza      0.0565667009 1.857578e-01   0.304518496
## factor(Munic)Ilidza        0.5634317041 1.346210e-01   4.185318851
## factor(Munic)Ilijas        0.1167136960 1.713675e-01   0.681072612
## factor(Munic)Jajce         0.4058622234 1.570685e-01   2.583983113
## factor(Munic)K.Dubica     -0.0596310929 1.933518e-01  -0.308407155
## factor(Munic)Kakanj        0.1518800012 1.437270e-01   1.056725784
## factor(Munic)Kalesija     -0.2129978380 1.427756e-01  -1.491836702
## factor(Munic)Kiseljak      0.3101306821 1.471633e-01   2.107391963
## factor(Munic)Kladanj      -0.1147627529 1.692208e-01  -0.678183502
## factor(Munic)Kljuc         0.1061303583 1.791945e-01   0.592263417
## factor(Munic)Knezevo      -0.0864951806 1.976881e-01  -0.437533478
## factor(Munic)Konjic        0.2591926041 1.288900e-01   2.010959019
## factor(Munic)Kotor Varos   0.0552193261 1.931515e-01   0.285886149
## factor(Munic)Kresevo       0.3125311000 1.653645e-01   1.889952664
## factor(Munic)Kupres        0.2188262661 1.893066e-01   1.155935933
## factor(Munic)Laktasi       0.0566188466 1.430757e-01   0.395726451
## factor(Munic)Livno         0.5631984075 1.439350e-01   3.912865261
## factor(Munic)Lopare        0.0532155101 1.391393e-01   0.382462236
## factor(Munic)Lukavac       0.2813384910 1.445231e-01   1.946667540
## factor(Munic)Ljubuski      0.4274560240 1.441327e-01   2.965710861
## factor(Munic)Maglaj        0.1192666456 1.387249e-01   0.859734880
## factor(Munic)Modrica       0.0213450567 1.324359e-01   0.161172703
## factor(Munic)Mrkonjic      0.3282052636 2.222581e-01   1.476685555
## factor(Munic)N.G.Sarajevo  0.3531357596 1.138779e-01   3.101002521
## factor(Munic)N.Gorazde    -0.2847611397 1.620776e-01  -1.756943197
## factor(Munic)N.Sarajevo    0.4333890433 1.314725e-01   3.296424535
## factor(Munic)N.Travnik    -0.0691507333 1.275024e-01  -0.542348645
## factor(Munic)Nevesinje     0.1104541856 2.084334e-01   0.529925526
## factor(Munic)Novi Grad    -0.1032518706 1.301551e-01  -0.793298693
## factor(Munic)Olovo         0.2880075704 2.151997e-01   1.338326992
## factor(Munic)Orasje        0.4785596403 1.501665e-01   3.186859373
## factor(Munic)Pale          0.1585170319 1.672649e-01   0.947700467
## factor(Munic)Posusje       0.5626925602 1.715839e-01   3.279401869
## factor(Munic)Prijedor      0.1653141319 1.266010e-01   1.305788261
## factor(Munic)Prnjavor     -0.1573657746 1.270150e-01  -1.238954478
## factor(Munic)Prozor        0.3467719384 1.766807e-01   1.962703740
## factor(Munic)Ribnik        0.0808886158 1.823609e-01   0.443563488
## factor(Munic)Rogatica      0.1004955071 1.767540e-01   0.568561332
## factor(Munic)Rudo          0.0041088341 1.560222e-01   0.026334925
## factor(Munic)S.Brijeg      0.7125574356 1.339654e-01   5.318966252
## factor(Munic)S.G.Sarajevo  0.4223085076 1.383753e-01   3.051906713
## factor(Munic)Samac         0.0694672382 1.246510e-01   0.557293988
## factor(Munic)Sanski Most   0.1107256027 1.267278e-01   0.873727571
## factor(Munic)Sokolac      -0.0058677910 2.086646e-01  -0.028120680
## factor(Munic)Srbac         0.0817809854 1.821972e-01   0.448859736
## factor(Munic)Srebrenica    0.2869320477 2.221226e-01   1.291773522
## factor(Munic)Srebrenik     0.1714462486 2.081153e-01   0.823803956
## factor(Munic)Stolac        0.4793458854 1.857672e-01   2.580358449
## factor(Munic)Teocak        0.1196023980 2.089344e-01   0.572439890
## factor(Munic)Tesanj       -0.0135458006 1.274269e-01  -0.106302491
## factor(Munic)Teslic        0.1006021086 1.345485e-01   0.747701444
## factor(Munic)Tomislavgrad  0.4638368904 1.823115e-01   2.544199574
## factor(Munic)Travnik       0.3717805950 1.190522e-01   3.122837586
## factor(Munic)Trebinje      0.0779443123 1.413068e-01   0.551596511
## factor(Munic)Tuzla         0.0519502088 1.219634e-01   0.425949299
## factor(Munic)Ugljevik      0.2324757086 1.600462e-01   1.452553528
## factor(Munic)V.Kladusa    -0.0533423052 1.256574e-01  -0.424505845
## factor(Munic)Visegrad     -0.0221337124 1.620261e-01  -0.136605814
## factor(Munic)Visoko        0.1537975968 1.334864e-01   1.152159033
## factor(Munic)Vitez        -0.0144934940 1.273588e-01  -0.113800518
## factor(Munic)Vlasenica     0.1445232421 1.855040e-01   0.779084167
## factor(Munic)Vogosca       0.1675970754 1.652835e-01   1.013997848
## factor(Munic)Zavidovici    0.0756983764 1.292002e-01   0.585899732
## factor(Munic)Zenica        0.1847118056 1.149268e-01   1.607212783
## factor(Munic)Zepce         0.0220297184 2.083476e-01   0.105735425
## factor(Munic)Zivinice     -0.0965594435 1.293660e-01  -0.746405006
## factor(Munic)Zvornik      -0.3056755042 1.307585e-01  -2.337709944
##                                Pr(>|t|)
## (Intercept)               1.626704e-219
## Age                        1.231135e-25
## as.numeric(Age^2)          4.801830e-19
## Sex_                       2.261333e-20
## Educ.1elementary           1.050852e-02
## Educ.1high schl            1.436656e-13
## Educ.1faculty              9.562641e-43
## Activ.1Other               3.794997e-15
## Activ.1part time          6.869253e-156
## Activ.1pension             4.800996e-82
## Activ.1unemployed         7.007796e-251
## factor(Munic)B.Petrovac    4.916602e-01
## factor(Munic)Banovici      1.117612e-01
## factor(Munic)Banja Luka    1.799882e-01
## factor(Munic)Bihac         7.013550e-01
## factor(Munic)Bijeljina     5.253527e-01
## factor(Munic)Bileca        9.965485e-01
## factor(Munic)Bratunac      3.454413e-01
## factor(Munic)Brcko         8.493399e-02
## factor(Munic)Breza         2.725260e-01
## factor(Munic)Brod          3.674000e-04
## factor(Munic)Bugojno       9.366038e-01
## factor(Munic)Busovaca      1.690313e-01
## factor(Munic)Buzim         8.302371e-03
## factor(Munic)C.Sarajevo    5.884572e-03
## factor(Munic)Cajnice       2.895703e-01
## factor(Munic)Capljina      7.018332e-04
## factor(Munic)Cazin         5.833510e-01
## factor(Munic)Celinac       5.216253e-01
## factor(Munic)Citluk        1.284314e-01
## factor(Munic)D.Vakuf       5.458408e-01
## factor(Munic)Derventa      1.877654e-03
## factor(Munic)Doboj         2.522274e-01
## factor(Munic)Doboj-Jug     6.471400e-01
## factor(Munic)Drvar         3.474126e-01
## factor(Munic)Foca - RS     7.340852e-01
## factor(Munic)Fojnica       2.082851e-01
## factor(Munic)G.Vakuf       7.528785e-01
## factor(Munic)Gacko         7.904397e-02
## factor(Munic)Glamoc        1.464753e-01
## factor(Munic)Gorazde       6.278610e-02
## factor(Munic)Gracanica     7.837209e-01
## factor(Munic)Grad Mostar   1.555765e-03
## factor(Munic)Gradacac      9.390665e-01
## factor(Munic)Gradiska      7.447317e-01
## factor(Munic)Grude         1.139836e-03
## factor(Munic)Hadzici       7.104466e-01
## factor(Munic)I.Ilidza      7.607441e-01
## factor(Munic)Ilidza        2.890883e-05
## factor(Munic)Ilijas        4.958535e-01
## factor(Munic)Jajce         9.791522e-03
## factor(Munic)K.Dubica      7.577839e-01
## factor(Munic)Kakanj        2.906819e-01
## factor(Munic)Kalesija      1.357978e-01
## factor(Munic)Kiseljak      3.512756e-02
## factor(Munic)Kladanj       4.976831e-01
## factor(Munic)Kljuc         5.536979e-01
## factor(Munic)Knezevo       6.617412e-01
## factor(Munic)Konjic        4.437719e-02
## factor(Munic)Kotor Varos   7.749758e-01
## factor(Munic)Kresevo       5.881542e-02
## factor(Munic)Kupres        2.477562e-01
## factor(Munic)Laktasi       6.923218e-01
## factor(Munic)Livno         9.227860e-05
## factor(Munic)Lopare        7.021329e-01
## factor(Munic)Lukavac       5.162409e-02
## factor(Munic)Ljubuski      3.032475e-03
## factor(Munic)Maglaj        3.899717e-01
## factor(Munic)Modrica       8.719631e-01
## factor(Munic)Mrkonjic      1.398157e-01
## factor(Munic)N.G.Sarajevo  1.938166e-03
## factor(Munic)N.Gorazde     7.898164e-02
## factor(Munic)N.Sarajevo    9.852829e-04
## factor(Munic)N.Travnik     5.875997e-01
## factor(Munic)Nevesinje     5.961844e-01
## factor(Munic)Novi Grad     4.276371e-01
## factor(Munic)Olovo         1.808437e-01
## factor(Munic)Orasje        1.446100e-03
## factor(Munic)Pale          3.433225e-01
## factor(Munic)Posusje       1.046572e-03
## factor(Munic)Prijedor      1.916777e-01
## factor(Munic)Prnjavor      2.154138e-01
## factor(Munic)Prozor        4.972960e-02
## factor(Munic)Ribnik        6.573752e-01
## factor(Munic)Rogatica      5.696765e-01
## factor(Munic)Rudo          9.789911e-01
## factor(Munic)S.Brijeg      1.083738e-07
## factor(Munic)S.G.Sarajevo  2.284490e-03
## factor(Munic)Samac         5.773487e-01
## factor(Munic)Sanski Most   3.823038e-01
## factor(Munic)Sokolac       9.775669e-01
## factor(Munic)Srbac         6.535501e-01
## factor(Munic)Srebrenica    1.964884e-01
## factor(Munic)Srebrenik     4.100857e-01
## factor(Munic)Stolac        9.894783e-03
## factor(Munic)Teocak        5.670468e-01
## factor(Munic)Tesanj        9.153461e-01
## factor(Munic)Teslic        4.546714e-01
## factor(Munic)Tomislavgrad  1.097924e-02
## factor(Munic)Travnik       1.800218e-03
## factor(Munic)Trebinje      5.812466e-01
## factor(Munic)Tuzla         6.701610e-01
## factor(Munic)Ugljevik      1.464033e-01
## factor(Munic)V.Kladusa     6.712131e-01
## factor(Munic)Visegrad      8.913472e-01
## factor(Munic)Visoko        2.493045e-01
## factor(Munic)Vitez         9.094000e-01
## factor(Munic)Vlasenica     4.359628e-01
## factor(Munic)Vogosca       3.106272e-01
## factor(Munic)Zavidovici    5.579663e-01
## factor(Munic)Zenica        1.080636e-01
## factor(Munic)Zepce         9.157960e-01
## factor(Munic)Zivinice      4.554538e-01
## factor(Munic)Zvornik       1.943702e-02
model.coef3[,c("Estimate","Pr(>|t|)")]
##                                Estimate      Pr(>|t|)
## (Intercept)                4.8793565077 1.626704e-219
## Age                        0.0510515330  1.231135e-25
## as.numeric(Age^2)         -0.0005077991  4.801830e-19
## Sex_                      -0.1727080537  2.261333e-20
## Educ.1elementary           0.1528205926  1.050852e-02
## Educ.1high schl            0.4329804238  1.436656e-13
## Educ.1faculty              0.8550011344  9.562641e-43
## Activ.1Other              -1.0576054594  3.794997e-15
## Activ.1part time          -0.8581430770 6.869253e-156
## Activ.1pension            -1.1777845606  4.800996e-82
## Activ.1unemployed         -1.1071285156 7.007796e-251
## factor(Munic)B.Petrovac    0.1280041511  4.916602e-01
## factor(Munic)Banovici      0.2421404626  1.117612e-01
## factor(Munic)Banja Luka    0.1523090452  1.799882e-01
## factor(Munic)Bihac        -0.0469648316  7.013550e-01
## factor(Munic)Bijeljina    -0.0718161484  5.253527e-01
## factor(Munic)Bileca        0.0008572535  9.965485e-01
## factor(Munic)Bratunac      0.1823513469  3.454413e-01
## factor(Munic)Brcko         0.1911714168  8.493399e-02
## factor(Munic)Breza         0.2002715337  2.725260e-01
## factor(Munic)Brod         -0.5208437192  3.674000e-04
## factor(Munic)Bugojno       0.0097514461  9.366038e-01
## factor(Munic)Busovaca      0.2077653786  1.690313e-01
## factor(Munic)Buzim        -0.5116816219  8.302371e-03
## factor(Munic)C.Sarajevo    0.3648263987  5.884572e-03
## factor(Munic)Cajnice      -0.1872328166  2.895703e-01
## factor(Munic)Capljina      0.5189477388  7.018332e-04
## factor(Munic)Cazin        -0.0695828225  5.833510e-01
## factor(Munic)Celinac      -0.1268769074  5.216253e-01
## factor(Munic)Citluk        0.2390299843  1.284314e-01
## factor(Munic)D.Vakuf      -0.0820118400  5.458408e-01
## factor(Munic)Derventa     -0.4198947567  1.877654e-03
## factor(Munic)Doboj         0.1373250943  2.522274e-01
## factor(Munic)Doboj-Jug    -0.1016545478  6.471400e-01
## factor(Munic)Drvar         0.1593877716  3.474126e-01
## factor(Munic)Foca - RS     0.0487223710  7.340852e-01
## factor(Munic)Fojnica       0.2430657996  2.082851e-01
## factor(Munic)G.Vakuf       0.0441377918  7.528785e-01
## factor(Munic)Gacko         0.2841121900  7.904397e-02
## factor(Munic)Glamoc        0.3031566039  1.464753e-01
## factor(Munic)Gorazde       0.2692364922  6.278610e-02
## factor(Munic)Gracanica    -0.0380625983  7.837209e-01
## factor(Munic)Grad Mostar   0.3631763638  1.555765e-03
## factor(Munic)Gradacac      0.0105747912  9.390665e-01
## factor(Munic)Gradiska      0.0550818281  7.447317e-01
## factor(Munic)Grude         0.4855499486  1.139836e-03
## factor(Munic)Hadzici      -0.0667213743  7.104466e-01
## factor(Munic)I.Ilidza      0.0565667009  7.607441e-01
## factor(Munic)Ilidza        0.5634317041  2.890883e-05
## factor(Munic)Ilijas        0.1167136960  4.958535e-01
## factor(Munic)Jajce         0.4058622234  9.791522e-03
## factor(Munic)K.Dubica     -0.0596310929  7.577839e-01
## factor(Munic)Kakanj        0.1518800012  2.906819e-01
## factor(Munic)Kalesija     -0.2129978380  1.357978e-01
## factor(Munic)Kiseljak      0.3101306821  3.512756e-02
## factor(Munic)Kladanj      -0.1147627529  4.976831e-01
## factor(Munic)Kljuc         0.1061303583  5.536979e-01
## factor(Munic)Knezevo      -0.0864951806  6.617412e-01
## factor(Munic)Konjic        0.2591926041  4.437719e-02
## factor(Munic)Kotor Varos   0.0552193261  7.749758e-01
## factor(Munic)Kresevo       0.3125311000  5.881542e-02
## factor(Munic)Kupres        0.2188262661  2.477562e-01
## factor(Munic)Laktasi       0.0566188466  6.923218e-01
## factor(Munic)Livno         0.5631984075  9.227860e-05
## factor(Munic)Lopare        0.0532155101  7.021329e-01
## factor(Munic)Lukavac       0.2813384910  5.162409e-02
## factor(Munic)Ljubuski      0.4274560240  3.032475e-03
## factor(Munic)Maglaj        0.1192666456  3.899717e-01
## factor(Munic)Modrica       0.0213450567  8.719631e-01
## factor(Munic)Mrkonjic      0.3282052636  1.398157e-01
## factor(Munic)N.G.Sarajevo  0.3531357596  1.938166e-03
## factor(Munic)N.Gorazde    -0.2847611397  7.898164e-02
## factor(Munic)N.Sarajevo    0.4333890433  9.852829e-04
## factor(Munic)N.Travnik    -0.0691507333  5.875997e-01
## factor(Munic)Nevesinje     0.1104541856  5.961844e-01
## factor(Munic)Novi Grad    -0.1032518706  4.276371e-01
## factor(Munic)Olovo         0.2880075704  1.808437e-01
## factor(Munic)Orasje        0.4785596403  1.446100e-03
## factor(Munic)Pale          0.1585170319  3.433225e-01
## factor(Munic)Posusje       0.5626925602  1.046572e-03
## factor(Munic)Prijedor      0.1653141319  1.916777e-01
## factor(Munic)Prnjavor     -0.1573657746  2.154138e-01
## factor(Munic)Prozor        0.3467719384  4.972960e-02
## factor(Munic)Ribnik        0.0808886158  6.573752e-01
## factor(Munic)Rogatica      0.1004955071  5.696765e-01
## factor(Munic)Rudo          0.0041088341  9.789911e-01
## factor(Munic)S.Brijeg      0.7125574356  1.083738e-07
## factor(Munic)S.G.Sarajevo  0.4223085076  2.284490e-03
## factor(Munic)Samac         0.0694672382  5.773487e-01
## factor(Munic)Sanski Most   0.1107256027  3.823038e-01
## factor(Munic)Sokolac      -0.0058677910  9.775669e-01
## factor(Munic)Srbac         0.0817809854  6.535501e-01
## factor(Munic)Srebrenica    0.2869320477  1.964884e-01
## factor(Munic)Srebrenik     0.1714462486  4.100857e-01
## factor(Munic)Stolac        0.4793458854  9.894783e-03
## factor(Munic)Teocak        0.1196023980  5.670468e-01
## factor(Munic)Tesanj       -0.0135458006  9.153461e-01
## factor(Munic)Teslic        0.1006021086  4.546714e-01
## factor(Munic)Tomislavgrad  0.4638368904  1.097924e-02
## factor(Munic)Travnik       0.3717805950  1.800218e-03
## factor(Munic)Trebinje      0.0779443123  5.812466e-01
## factor(Munic)Tuzla         0.0519502088  6.701610e-01
## factor(Munic)Ugljevik      0.2324757086  1.464033e-01
## factor(Munic)V.Kladusa    -0.0533423052  6.712131e-01
## factor(Munic)Visegrad     -0.0221337124  8.913472e-01
## factor(Munic)Visoko        0.1537975968  2.493045e-01
## factor(Munic)Vitez        -0.0144934940  9.094000e-01
## factor(Munic)Vlasenica     0.1445232421  4.359628e-01
## factor(Munic)Vogosca       0.1675970754  3.106272e-01
## factor(Munic)Zavidovici    0.0756983764  5.579663e-01
## factor(Munic)Zenica        0.1847118056  1.080636e-01
## factor(Munic)Zepce         0.0220297184  9.157960e-01
## factor(Munic)Zivinice     -0.0965594435  4.554538e-01
## factor(Munic)Zvornik      -0.3056755042  1.943702e-02
model.coef3 <- model.coef3
model.coef3 <- as.data.frame.array(model.coef3[-c(1:11),]) # da bude dataframe a ne matrix i da mi brise prvih 12 redova koji su drugi koeficijenti
Munic <- rownames(model.coef3)
model.coef3$Munic <- Munic
dim(model.coef3) #da vidim koliko redova
## [1] 103   5
rownames(model.coef3) <- 1:103 #nedostaje B.Grahovo koje je 0
head(model.coef3)
##        Estimate Std. Error      t value  Pr(>|t|)                   Munic
## 1  0.1280041511  0.1861295  0.687715543 0.4916602 factor(Munic)B.Petrovac
## 2  0.2421404626  0.1522345  1.590575182 0.1117612   factor(Munic)Banovici
## 3  0.1523090452  0.1135823  1.340957192 0.1799882 factor(Munic)Banja Luka
## 4 -0.0469648316  0.1224600 -0.383511521 0.7013550      factor(Munic)Bihac
## 5 -0.0718161484  0.1130686 -0.635155484 0.5253527  factor(Munic)Bijeljina
## 6  0.0008572535  0.1981647  0.004325964 0.9965485     factor(Munic)Bileca

Make a new variable with municipal names without factor(Munic)

Munic1 <- sapply(strsplit(Munic, split=')', fixed=TRUE), function(x) (x[2]))
Munic1
##   [1] "B.Petrovac"   "Banovici"     "Banja Luka"   "Bihac"        "Bijeljina"   
##   [6] "Bileca"       "Bratunac"     "Brcko"        "Breza"        "Brod"        
##  [11] "Bugojno"      "Busovaca"     "Buzim"        "C.Sarajevo"   "Cajnice"     
##  [16] "Capljina"     "Cazin"        "Celinac"      "Citluk"       "D.Vakuf"     
##  [21] "Derventa"     "Doboj"        "Doboj-Jug"    "Drvar"        "Foca - RS"   
##  [26] "Fojnica"      "G.Vakuf"      "Gacko"        "Glamoc"       "Gorazde"     
##  [31] "Gracanica"    "Grad Mostar"  "Gradacac"     "Gradiska"     "Grude"       
##  [36] "Hadzici"      "I.Ilidza"     "Ilidza"       "Ilijas"       "Jajce"       
##  [41] "K.Dubica"     "Kakanj"       "Kalesija"     "Kiseljak"     "Kladanj"     
##  [46] "Kljuc"        "Knezevo"      "Konjic"       "Kotor Varos"  "Kresevo"     
##  [51] "Kupres"       "Laktasi"      "Livno"        "Lopare"       "Lukavac"     
##  [56] "Ljubuski"     "Maglaj"       "Modrica"      "Mrkonjic"     "N.G.Sarajevo"
##  [61] "N.Gorazde"    "N.Sarajevo"   "N.Travnik"    "Nevesinje"    "Novi Grad"   
##  [66] "Olovo"        "Orasje"       "Pale"         "Posusje"      "Prijedor"    
##  [71] "Prnjavor"     "Prozor"       "Ribnik"       "Rogatica"     "Rudo"        
##  [76] "S.Brijeg"     "S.G.Sarajevo" "Samac"        "Sanski Most"  "Sokolac"     
##  [81] "Srbac"        "Srebrenica"   "Srebrenik"    "Stolac"       "Teocak"      
##  [86] "Tesanj"       "Teslic"       "Tomislavgrad" "Travnik"      "Trebinje"    
##  [91] "Tuzla"        "Ugljevik"     "V.Kladusa"    "Visegrad"     "Visoko"      
##  [96] "Vitez"        "Vlasenica"    "Vogosca"      "Zavidovici"   "Zenica"      
## [101] "Zepce"        "Zivinice"     "Zvornik"
model.coef3$Munic1 <- Munic1

add B.Grahovo to dataframe

model.coef3[nrow(model.coef3) + 1,] = c(0, NA, NA, NA,"B.Grahovo","B.Grahovo" )
model.coef3$Estimate <- as.numeric(model.coef3$Estimate)
top10.m3 <- model.coef3  %>%
    dplyr::select(Estimate, Munic1) %>%
    arrange (desc(Estimate))%>%
    head(10) #top ten municipalities
top10.m3
##     Estimate       Munic1
## 1  0.7125574     S.Brijeg
## 2  0.5634317       Ilidza
## 3  0.5631984        Livno
## 4  0.5626926      Posusje
## 5  0.5189477     Capljina
## 6  0.4855499        Grude
## 7  0.4793459       Stolac
## 8  0.4785596       Orasje
## 9  0.4638369 Tomislavgrad
## 10 0.4333890   N.Sarajevo

#spasiti a u excel

library(openxlsx)
wb = createWorkbook()
sh = addWorksheet(wb, "Estimates") #ovo je naziv sheeta

library(expss)
## Loading required package: maditr
## 
## To aggregate several columns with one summary: take(mtcars, mpg, hp, fun = mean, by = am)
## 
## Attaching package: 'maditr'
## The following object is masked from 'package:raster':
## 
##     shift
## The following object is masked from 'package:purrr':
## 
##     transpose
## The following object is masked from 'package:readr':
## 
##     cols
## The following objects are masked from 'package:dplyr':
## 
##     between, coalesce, first, last
## 
## Attaching package: 'expss'
## The following object is masked from 'package:raster':
## 
##     calc
## The following objects are masked from 'package:stringr':
## 
##     fixed, regex
## The following objects are masked from 'package:purrr':
## 
##     keep, modify, modify_if, when
## The following object is masked from 'package:ggplot2':
## 
##     vars
## The following objects are masked from 'package:tidyr':
## 
##     contains, nest
## The following objects are masked from 'package:dplyr':
## 
##     compute, contains, na_if, recode, vars, where
## The following objects are masked from 'package:haven':
## 
##     is.labelled, read_spss
xl_write(model.coef3, wb, sh) #shares je naziv objekta koji hocu spasiti

saveWorkbook(wb, "wages.hbs.16.12.xlsx", overwrite = T)

##Make a graf

merge estimates data and map data

WI.3 <- lm (log(wages)~ Age + as.numeric(Age^2)+ Sex_ + Educ.1 + Activ.1 + factor (Munic) , data = WI.df)

map.coef3 <- merge(amraGIS, model.coef3, by.y='Munic1', by.x = "NAME_4",all = TRUE)#104 munic ako nema argumenta all=T, sa njim je 144- sad stoji 142 vidi da nije usora ili slicno

now WI.3 (dependent log(wages))

WI.3 <- lm (log(wages)~ Age + as.numeric(Age^2)+ Sex_ + Educ.1 + Activ.1 + factor (Munic) , data = WI.df)

library(gridExtra)# radi funkcije tableGrob
library(patchwork) #radi spajanja mape i tabele
library(ggplot2)
g3 = ggplot() + geom_sf(data = map.coef3, aes(geometry=geometry, fill = Estimate)) + scale_fill_viridis_c() + scale_x_continuous() 

g3

#grafikon ispod spaja mi mapu i top 10 municipalities
TABLE <- tableGrob(top10.m3, theme = ttheme_default(base_size = 5))

g3 + ggtitle("lm (log(wages)~ Age + as.numeric(Age^2)+ Sex_ + Educ.1  \n + Activ.1 + factor (Munic)") + theme(plot.title = element_text(color="gray", size=12, face="italic")) + plot_spacer() + TABLE + plot_layout(widths = c(12, -1.3 ,5)) #plot_layout prvi broj oznacava velicinu mape, drugi velicinu razmaka izmedju mape i tabele i treci oznacava prostor za tabelu

g3 + geom_sf_text(data= map.coef3, aes(geometry=geometry,label=ifelse(as.numeric(Estimate) >= 0.6,as.character(NAME_4),"")),hjust=0.5,vjust=0,cex =3, col="black") + geom_sf_text(data= map.coef3, aes(geometry=geometry,label=ifelse(as.numeric(Estimate) < -0.4,as.character(NAME_4),"")),hjust=0.5,vjust=0,cex =3, col="red")
## Warning in st_point_on_surface.sfc(sf::st_zm(x)): st_point_on_surface may not
## give correct results for longitude/latitude data

## Warning in st_point_on_surface.sfc(sf::st_zm(x)): st_point_on_surface may not
## give correct results for longitude/latitude data
## Warning: Removed 37 rows containing missing values (`geom_text()`).
## Removed 37 rows containing missing values (`geom_text()`).