Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

expand.nested

Expand nested factors


Description

Expand out the data frame for a nested factor such as (1| a/b). This is used by the variance function routines of coxme.

Usage

expand.nested(x)

Arguments

x

A data frame containing the nesting variables

Details

The initialize function of a coxme variance family is passed, as one of its arguments, a data frame G containing the grouping variables, each of which is a factor.. Assume a nested factor (1| a/b) in the model formula and a data set whose first few rows are:

a    b
    1    1
    1    2
    2    1

The function will replace the second column with a variable named a/b and values of 1/1, 1/2, 2/1, etc.

Value

an updated data frame

Author(s)

Terry Therneau

See Also


coxme

Mixed Effects Cox Models

v2.2-16
LGPL-2
Authors
Terry M. Therneau [aut, cre]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.