Skip to contents

summary method for targeter object

Usage

# S3 method for class 'targeter'
summary(
  object,
  extra_stats = FALSE,
  criteria = c("IV", "index.max.index", "chisquare", "pvalue", "index.max.count",
    "index.max.props"),
  ...
)

Arguments

object

an object of class targeter

extra_stats

boolean - whether function returns some additional associations statistics (default: FALSE)

criteria

which criteria is used to sort the summary table (default: IV)

...

additional parameters (currently not used)

Value

a data.table summary table

Details

summary method invoked on a targeter object loops over all individual profiles/crossvar/associations and derive statistics (cf summary.crossvar). Returned table contains thus one row per explanatory variable analyzed in targeter and columns for associations measures / metrics.

See also

Examples

data(adult)
t <- targeter(adult,target ="ABOVE50K",analysis_name="Analyse")
#> 
#> INFO:target ABOVE50K detected as type: binary
#> INFO:binary target contains number, automatic chosen level: 1; override using `target_reference_level`
summary(t)
#>           varname targetname     vartype          IV   highest_impact
#>            <char>     <char>      <char>       <num>           <char>
#>  1:  RELATIONSHIP   ABOVE50K categorical 1.535552684 [-] under-target
#>  2: MARITALSTATUS   ABOVE50K categorical 1.338798794 [-] under-target
#>  3:           AGE   ABOVE50K     numeric 1.218431611 [-] under-target
#>  4:    OCCUPATION   ABOVE50K categorical 0.776133730 [-] under-target
#>  5:     EDUCATION   ABOVE50K categorical 0.753711252 [-] under-target
#>  6:  EDUCATIONNUM   ABOVE50K     numeric 0.662037705 [-] under-target
#>  7:  HOURSPERWEEK   ABOVE50K     numeric 0.462278840 [-] under-target
#>  8:           SEX   ABOVE50K categorical 0.303286785  [+] over-target
#>  9:     WORKCLASS   ABOVE50K categorical 0.166503774 [-] under-target
#> 10: NATIVECOUNTRY   ABOVE50K categorical 0.081462883 [-] under-target
#> 11:          RACE   ABOVE50K categorical 0.069292112 [-] under-target
#> 12:        FNLWGT   ABOVE50K     numeric 0.009781068  [+] over-target
#>               index.max.level index.max.count index.max.index index.max.props
#>                        <char>           <num>           <num>           <num>
#>  1:                      Wife             745        1.973043       0.4751276
#>  2:        Married-civ-spouse            6692        1.855609       0.4468483
#>  3:         [j] from 48 to 52             926        1.659630       0.3996547
#>  4:           Exec-managerial            1968        2.009944       0.4840138
#>  5:                 Doctorate             306        3.076789       0.7409201
#>  6:         [f] from 13 to 16            3909        2.012241       0.4845668
#>  7:         [f] from 50 to 56            1670        1.859233       0.4477212
#>  8:                      Male            6662        1.269620       0.3057366
#>  9:              Self-emp-inc             622        2.314475       0.5573477
#> 10:                      Iran              18        1.738322       0.4186047
#> 11:        Asian-Pac-Islander             276        1.103113       0.2656400
#> 12: [e] from 141067 to 162343             721        1.104007       0.2658555
#>               index.min.level index.min.count index.min.index index.min.props
#>                        <char>           <num>           <num>           <num>
#>  1:                 Own-child              67      0.05489901    0.0132202052
#>  2:             Never-married             491      0.19085984    0.0459608724
#>  3:         [a] from 17 to 21               2      0.00344619    0.0008298755
#>  4:           Priv-house-serv               1      0.02787020    0.0067114094
#>  5:                 Preschool               0      0.00000000    0.0000000000
#>  6:           [a] from 1 to 7             151      0.23707052    0.0570888469
#>  7:         [b] from 20 to 32             236      0.27637551    0.0665538635
#>  8:                    Female            1179      0.45455251    0.1094605886
#>  9:              Never-worked               0      0.00000000    0.0000000000
#> 10:        Holand-Netherlands               0      0.00000000    0.0000000000
#> 11:                     Other              25      0.38308663    0.0922509225
#> 12: [j] from 237051 to 279465             578      0.88439092    0.2129697863
#>     which_minmax.level
#>                 <char>
#>  1:                  1
#>  2:                  1
#>  3:                  1
#>  4:                  1
#>  5:                  1
#>  6:                  1
#>  7:                  1
#>  8:                  1
#>  9:                  1
#> 10:                  1
#> 11:                  1
#> 12:                  1
summary(t, extra_stats = TRUE)
#>           varname targetname     vartype          IV   highest_impact
#>            <char>     <char>      <char>       <num>           <char>
#>  1:  RELATIONSHIP   ABOVE50K categorical 1.535552684 [-] under-target
#>  2: MARITALSTATUS   ABOVE50K categorical 1.338798794 [-] under-target
#>  3:           AGE   ABOVE50K     numeric 1.218431611 [-] under-target
#>  4:    OCCUPATION   ABOVE50K categorical 0.776133730 [-] under-target
#>  5:     EDUCATION   ABOVE50K categorical 0.753711252 [-] under-target
#>  6:  EDUCATIONNUM   ABOVE50K     numeric 0.662037705 [-] under-target
#>  7:  HOURSPERWEEK   ABOVE50K     numeric 0.462278840 [-] under-target
#>  8:           SEX   ABOVE50K categorical 0.303286785  [+] over-target
#>  9:     WORKCLASS   ABOVE50K categorical 0.166503774 [-] under-target
#> 10: NATIVECOUNTRY   ABOVE50K categorical 0.081462883 [-] under-target
#> 11:          RACE   ABOVE50K categorical 0.069292112 [-] under-target
#> 12:        FNLWGT   ABOVE50K     numeric 0.009781068  [+] over-target
#>               index.max.level index.max.count index.max.index index.max.props
#>                        <char>           <num>           <num>           <num>
#>  1:                      Wife             745        1.973043       0.4751276
#>  2:        Married-civ-spouse            6692        1.855609       0.4468483
#>  3:         [j] from 48 to 52             926        1.659630       0.3996547
#>  4:           Exec-managerial            1968        2.009944       0.4840138
#>  5:                 Doctorate             306        3.076789       0.7409201
#>  6:         [f] from 13 to 16            3909        2.012241       0.4845668
#>  7:         [f] from 50 to 56            1670        1.859233       0.4477212
#>  8:                      Male            6662        1.269620       0.3057366
#>  9:              Self-emp-inc             622        2.314475       0.5573477
#> 10:                      Iran              18        1.738322       0.4186047
#> 11:        Asian-Pac-Islander             276        1.103113       0.2656400
#> 12: [e] from 141067 to 162343             721        1.104007       0.2658555
#>               index.min.level index.min.count index.min.index index.min.props
#>                        <char>           <num>           <num>           <num>
#>  1:                 Own-child              67      0.05489901    0.0132202052
#>  2:             Never-married             491      0.19085984    0.0459608724
#>  3:         [a] from 17 to 21               2      0.00344619    0.0008298755
#>  4:           Priv-house-serv               1      0.02787020    0.0067114094
#>  5:                 Preschool               0      0.00000000    0.0000000000
#>  6:           [a] from 1 to 7             151      0.23707052    0.0570888469
#>  7:         [b] from 20 to 32             236      0.27637551    0.0665538635
#>  8:                    Female            1179      0.45455251    0.1094605886
#>  9:              Never-worked               0      0.00000000    0.0000000000
#> 10:        Holand-Netherlands               0      0.00000000    0.0000000000
#> 11:                     Other              25      0.38308663    0.0922509225
#> 12: [j] from 237051 to 279465             578      0.88439092    0.2129697863
#>     which_minmax.level  chisquare
#>                 <char>      <num>
#>  1:                  1 6699.07690
#>  2:                  1 6517.74165
#>  3:                  1 3366.30499
#>  4:                  1 4031.97428
#>  5:                  1 4429.65330
#>  6:                  1 3857.75431
#>  7:                  1 2478.36213
#>  8:                  1 1518.88682
#>  9:                  1 1045.70860
#> 10:                  1  317.23039
#> 11:                  1  330.92043
#> 12:                  1   57.99311
#>                                                                                                                                                                                                                                   pvalue
#>                                                                                                                                                                                                                                    <num>
#>  1: 0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
#>  2: 0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
#>  3: 0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
#>  4: 0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
#>  5: 0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
#>  6: 0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
#>  7: 0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
#>  8: 0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
#>  9: 0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002026505
#> 10: 0.0000000000000000000000000000000000000000000221138588525424976511938010166802611417335793515203323661115941899988500187617797270315598676266077216710266442958876531577061541611328721046447753906250000000000000000000000000000000
#> 11: 0.0000000000000000000000000000000000000000000000000000000000000000000002305960610161479735524263333804010276692672228229452220438015877207669663348305719732504059509641490767301561000373105508403323054220398195714608057590367730
#> 12: 0.0000000218236033418946681366694639305978120624729399423813447356224060058593750000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000