Description Usage Arguments Details Value Examples

This function estimates a split-population duration model and returns a
object of class `spdur`

.

1 2 3 |

`duration` |
A formula of the form Y ~ X1 + X2 ..., where Y is duration until failure or censoring. |

`atrisk` |
A formula of the form C ~ Z1 + Z2 ..., where C is a binary indicator of risk (1 - cure). |

`data` |
A data frame containing the variables in formula and formula2. |

`last` |
A string identifying the vector in |

`t.0` |
The starting point for time-varying covariate intervals, by
default |

`fail` |
Name of the variable indicating that a spell ended in failure. |

`distr` |
The type of distribution to use in the hazard rate. Valid options are “weibull” or “loglog”; defaults to “weibull”. |

`max.iter` |
Maximum number of iterations to use in the likelihood maximization. |

`na.action` |
a function which indicates what should happen when the data
contain NAs. The default is set by the |

`silent` |
Suppress optimization output, |

`...` |
Optional arguments, see details. |

See `summary.spdur`

, `predict.spdur`

,
and `plot.spdur`

for post-estimation options.

Optional arguments:

- base.inits
Initial values for the base duration model that is estimated to get initial values for the full split-population model. This needs to be a vector with starting values for the constant, coefficients in the duration equation, and an additional value for the shape parameter of the density used, e.g. Weibull. By default they are 0 for all coefficients and 0 or 1 for the Weibull and LogLog shape parameters respectively.

Returns an object of class `spdur`

, with attributes:

`coefficients ` |
A named vector of coefficient point estimates. |

`vcv ` |
Estimated covariance matrix. |

`se ` |
Standard error estimates. |

`zstat ` |
Z-statistic values. |

`pval ` |
P-values. |

`mf.dur ` |
Model frame for the duration equation. |

`mf.risk ` |
Model frame for the risk equation. |

`Y ` |
Matrix of duration variables: risk, duration, end of spell, and t.0. |

`na.action ` |
What action was taken for missing values in |

`call ` |
The original, unevaluated |

`distr ` |
Distribution used for the hazard rate. |

1 2 3 4 5 6 7 8 9 | ```
# Prepare data
data(coups)
dur.coups <- add_duration(coups, "succ.coup", unitID="gwcode", tID="year",
freq="year")
# Estimate model
model.coups <- spdur(duration ~ polity2, atrisk ~ polity2, data=dur.coups)
model.coups <- spdur(duration ~ polity2, atrisk ~ polity2, data=dur.coups,
distr="loglog")
``` |

spduration documentation built on May 1, 2019, 6:32 p.m.

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.