Skip to contents

A "skeleton" is a data frame containing "nicely spaced" values for the explanatory variables in a model.

Usage

model_skeleton(mod, data = NULL, ncont = 3, nfirstcont = 50)

Arguments

mod

A fitted model or a tilde expression describing a model structure, e.g. outcome ~ vara+varb.

data

a data frame. Relevant only when mod is a tilde expression

ncont

minimum number of levels at which to represent continuous variables. (More levels may be added to "prettify" the choices. See pretty().)

nfirstcont

Like ncont, but for the first explanatory variable if it is categorical. This variable is mapped to the horizontal axis and so should have many levels to produce a smooth graph. (Default: 50)

Value

a data frame

Examples

Model <- FEV |> model_train(FEV ~ sex + age + height)
Model |> model_skeleton()
#>    sex age height
#> 1    F   0     40
#> 2    M   0     40
#> 3    F  10     40
#> 4    M  10     40
#> 5    F  20     40
#> 6    M  20     40
#> 7    F   0     50
#> 8    M   0     50
#> 9    F  10     50
#> 10   M  10     50
#> 11   F  20     50
#> 12   M  20     50
#> 13   F   0     60
#> 14   M   0     60
#> 15   F  10     60
#> 16   M  10     60
#> 17   F  20     60
#> 18   M  20     60
#> 19   F   0     70
#> 20   M   0     70
#> 21   F  10     70
#> 22   M  10     70
#> 23   F  20     70
#> 24   M  20     70
#> 25   F   0     80
#> 26   M   0     80
#> 27   F  10     80
#> 28   M  10     80
#> 29   F  20     80
#> 30   M  20     80