dynamichazard (version 0.3.1)

ddFixed: Auxiliary functions for fixed effects

Description

Functions used in formula of ddhazard for time-invariant effects. ddFixed_intercept is only used for the intercept.

Usage

ddFixed(object)

ddFixed_intercept(n)

Arguments

object

Expression that would be used in formula. E.g. x or poly(x, degree = 3)

n

Number of rows in the data frame the data for estimation

Examples

Run this code
# All these call with give the same result where
# 'data' is a hypothetical data frame. We can get a
# time-invariant estimate for x1 by:

ddhazard(Surv(stop, event) ~ ddFixed(x1), data)


# All of the calls below will yield the same result
# with a time-invariant intercept:

ddhazard(Surv(stop, event)
    ~ ddFixed(1) + x1, data)
ddhazard(Surv(stop, event)
    ~ -1 + ddFixed(1) + x1, data)
ddhazard(Surv(stop, event)
    ~ ddFixed(rep(1, nrow(data))) + x1, data)
ddhazard(Surv(stop, event)
    ~ -1 + ddFixed(rep(1, nrow(data))) + x1, data)
ddhazard(Surv(stop, event)
    ~ ddFixed_intercept(nrow(data)) + x1, data)
ddhazard(Surv(stop, event)
    ~ -1 + ddFixed_intercept(nrow(data)) + x1, data)

Run the code above in your browser using DataCamp Workspace