Data

Data yang diberikan sejumlah 42994 responden yang valid, digunakan 6 variabel dari 21 variabel yang ada.

Kesehatan organisasi kita bagi dua kategori yang sehat dan kurang sehat dengan cut off (median dari datanya)

Berikut penggalan datanya

## 'data.frame':    42994 obs. of  21 variables:
##  $ ID            : int  35262 38325 37526 17042 21125 271 292 734 1699 1791 ...
##  $ Eselon1       : int  3 3 3 3 5 6 1 6 1 5 ...
##  $ Eselon2       : int  140 126 119 137 161 105 6 105 8 157 ...
##  $ Satker        : int  653 411 334 596 950 193 1098 193 1100 901 ...
##  $ TipeUnit      : int  2 2 2 2 2 2 1 2 1 2 ...
##  $ LevelSatker   : int  4 3 3 3 2 3 2 3 2 3 ...
##  $ Usia          : int  55 32 24 44 57 28 40 42 32 57 ...
##  $ JenisKelamin  : int  2 2 2 1 2 2 1 2 1 2 ...
##  $ Agama         : int  3 3 1 1 1 1 2 1 1 1 ...
##  $ StatusNikah   : int  2 2 1 1 2 2 2 2 2 2 ...
##  $ JumlahAnak    : int  1 0 0 0 2 0 1 1 1 1 ...
##  $ Jabatan       : int  4 7 7 7 7 7 7 7 7 7 ...
##  $ GolonganRuang : int  9 5 2 6 9 5 5 5 5 7 ...
##  $ Golongan      : int  3 2 2 3 3 2 2 2 2 3 ...
##  $ Pendidikan    : int  8 8 4 8 8 11 3 3 6 3 ...
##  $ MasaKerja     : int  33 13 4 20 32 7 16 23 10 32 ...
##  $ ProvinsiKantor: int  25 6 18 14 13 11 6 11 6 9 ...
##  $ HomeBase      : int  1 1 3 2 1 1 3 3 1 1 ...
##  $ LolosUji      : int  1 1 1 1 1 1 1 1 1 1 ...
##  $ TOMO          : num  125 125 120 115 115 ...
##  $ MOFIN         : num  92.2 60.8 50 96.2 100 ...
##   y JenKel HomeBase  TOMO MasaKerja Usia
## 1 0      2        1 125.0        33   55
## 2 0      2        1 125.0        13   32
## 3 0      2        3 120.0         4   24
## 4 1      1        2 115.0        20   44
## 5 1      2        1 115.0        32   57
## 6 0      2        1 112.5         7   28

Proses perhitungan dengan General Linier Model

Hasil Perhitungan

## 
## Call:
## glm(formula = y ~ ., family = binomial(link = "logit"), data = df)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -2.4903  -1.0064   0.4554   1.0014   2.2192  
## 
## Coefficients:
##               Estimate Std. Error z value Pr(>|z|)    
## (Intercept) -3.1217333  0.1408741 -22.160   <2e-16 ***
## JenKel2      0.0483742  0.0242452   1.995   0.0460 *  
## HomeBase1   -0.0825755  0.1078258  -0.766   0.4438    
## HomeBase2   -0.0244977  0.1149229  -0.213   0.8312    
## HomeBase3   -0.2082582  0.1090555  -1.910   0.0562 .  
## TOMO         0.0276633  0.0004422  62.559   <2e-16 ***
## MasaKerja    0.0081350  0.0037613   2.163   0.0306 *  
## Usia         0.0451701  0.0035475  12.733   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 59570  on 42972  degrees of freedom
## Residual deviance: 51696  on 42965  degrees of freedom
##   (21 observations deleted due to missingness)
## AIC: 51712
## 
## Number of Fisher Scoring iterations: 4

Membuat Plotting estimates untuk generalized linear models

sjp.glm(fit)
## Waiting for profiling to be done...

Membuat Plotting Continuous values pada Axis

sjp.glm(fit, trns.ticks = FALSE)
## Waiting for profiling to be done...

Susunan Estimasi

sjp.glm(fit, sort.est = FALSE)
## Waiting for profiling to be done...

Koefisien Prediksi

Keseluruhan

sjp.glm(fit, type = "slope")

Contoh untuk Usia

sjp.glm(fit, type = "slope", facet.grid = FALSE, show.ci = TRUE, vars = "Usia")

Marginal effects

The binary outcome

sjp.glm(fit, type = "eff")

Semua di Plot

p <- sjp.glm(fit, type = "eff", facet.grid = FALSE, 
             show.ci = TRUE, prnt.plot = FALSE)$plot.list
# plot all marginal effects, as grid, proper x-axes
# also, set margins for this example
plot_grid(p, margin = c(0.3, 0.3, 0.3, 0.3))

Plot Prediksi Masing-Masing Variabel

sjp.glm(fit, type = "pred", vars = "Usia")

sjp.glm(fit, type = "pred", vars = "TOMO")

sjp.glm(fit, type = "pred", vars = "HomeBase")

sjp.glm(fit, type = "pred", vars = "JenKel")

sjp.glm(fit, type = "pred", vars = "MasaKerja")

Heru Wiryanto, 25 September 2017