Description Usage Arguments Value Examples

View source: R/untangle.specials.R

Given a `terms`

structure and a desired special name, this returns an
index appropriate for subscripting the `terms`

structure and another
appropriate for the data frame.

1 | ```
untangle.specials(tt, special, order=1)
``` |

`tt` |
a |

`special` |
the name of a special function, presumably used in the terms object. |

`order` |
the order of the desired terms. If set to 2, interactions with the special function will be included. |

a list with two components:

`vars` |
a vector of variable names, as would be found in the data frame, of the specials. |

`terms` |
a numeric vector, suitable for subscripting the terms structure, that indexes the terms in the expanded model formula which involve the special. |

1 2 3 4 5 6 7 8 | ```
formula <- Surv(tt,ss) ~ x + z*strata(id)
tms <- terms(formula, specials="strata")
## the specials attribute
attr(tms, "specials")
## main effects
untangle.specials(tms, "strata")
## and interactions
untangle.specials(tms, "strata", order=1:2)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.