Skip to contents

mid.extract() returns a component of a MID model.

Usage

mid.extract(object, component, ...)

mid.encoding.scheme(object, ...)

mid.frames(object, ...)

mid.terms(
  object,
  main.effect = TRUE,
  interaction = TRUE,
  require = NULL,
  remove = NULL,
  ...
)

# S3 method for class 'mid'
terms(x, ...)

# S3 method for class 'mid.importance'
terms(x, ...)

# S3 method for class 'mid'
formula(x, ...)

# S3 method for class 'mid'
model.frame(object, ...)

Arguments

object

a "mid" object.

component

a literal character string or name. The name of the component to extract, such as "frames", "encoding.scheme" and "terms".

...

optional parameters to be passed to the function used to extract the component.

main.effect

logical. If FALSE, the main effect terms are excluded.

interaction

logical. If FALSE, the interaction terms are excluded.

require

a character vector of variable names. The terms that are not related to any of the specified names are excluded.

remove

a character vector of variable names. The terms that are related to at least one of the specified names are excluded.

x

a "mid" or "mid.importance" object.

Value

mid.extract() returns the component extracted from the object, mid.encoding.scheme() returns a data frame containing the information about encoding schemes, mid.frames() returns a list of the encoding frames, mid.terms() returns a character vector of the term labels, and

Examples

data(trees, package = "datasets")
mid <- interpret(Volume ~ .^2, trees, k = 10)
#> 'model' not passed: response variable in 'data' is used
mid.extract(mid, encoding.scheme)
#>        main.effect interaction
#> Girth   linear(10)   linear(4)
#> Height  linear(10)   linear(4)
mid.extract(mid, frames)
#> $`|Girth`
#>    Girth Girth_min Girth_max
#> 1    8.3      8.30      9.40
#> 2   10.5      9.40     10.75
#> 3   11.0     10.75     11.15
#> 4   11.3     11.15     11.50
#> 5   11.7     11.50     12.50
#> 6   13.3     12.50     13.65
#> 7   14.0     13.65     15.15
#> 8   16.3     15.15     17.10
#> 9   17.9     17.10     19.25
#> 10  20.6     19.25     20.60
#> 
#> $`:Girth`
#>   Girth Girth_min Girth_max
#> 1   8.3      8.30      9.80
#> 2  11.3      9.80     12.65
#> 3  14.0     12.65     17.30
#> 4  20.6     17.30     20.60
#> 
#> $`|Height`
#>    Height Height_min Height_max
#> 1      63       63.0       64.5
#> 2      66       64.5       68.5
#> 3      71       68.5       72.5
#> 4      74       72.5       74.5
#> 5      75       74.5       76.5
#> 6      78       76.5       79.0
#> 7      80       79.0       80.5
#> 8      81       80.5       82.0
#> 9      83       82.0       85.0
#> 10     87       85.0       87.0
#> 
#> $`:Height`
#>   Height Height_min Height_max
#> 1     63       63.0       68.5
#> 2     74       68.5       77.0
#> 3     80       77.0       83.5
#> 4     87       83.5       87.0
#> 
mid.extract(mid, Girth)
#>    Girth Girth_min Girth_max    density         mid
#> 1    8.3      8.30      9.40 0.08506452  -21.003604
#> 2   10.5      9.40     10.75 0.07622581   -6.108702
#> 3   11.0     10.75     11.15 0.12903226    1.782576
#> 4   11.3     11.15     11.50 0.11290323    4.368677
#> 5   11.7     11.50     12.50 0.09070968    2.595397
#> 6   13.3     12.50     13.65 0.10977419  -18.178493
#> 7   14.0     13.65     15.15 0.13261290   -5.837210
#> 8   16.3     15.15     17.10 0.09029032   31.919879
#> 9   17.9     17.10     19.25 0.13874194   42.242478
#> 10  20.6     19.25     20.60 0.03464516 -135.072647
mid.extract(mid, intercept)
#> [1] 30.17097