R code for fitting a model to unbalanced longitudinal data with a copula

In my previous blog post I showed how to fit a model to longitudinal data with a copula.

Remember that the focus in my previous post was on balanced longitudinal data. However, the following R code demonstrates how to fit a copula when dealing with unbalanced longitudinal data. Continue reading R code for fitting a model to unbalanced longitudinal data with a copula

R code for fitting a model to longitudinal data with a copula

The R code below demonstrates how to fit a model to longitudinal data by means of a copula. Longitudinal data is also referred to as panel, or repeated measures data.

The R code also shows how to create forecasts for longitudinal data, and how to compute prediction intervals for these forecasts. Continue reading R code for fitting a model to longitudinal data with a copula

R code for fitting a quantile regression model to censored data by means of a copula

In my previous blog post I showed how to fit a copula to censored data. For the ease of use, I’m going to call these fitted copulas censored copulas.

The following R code demonstrates how these censored copulas in turn can be used for fitting a quantile regression model to censored data.

A more detailed description of the method employed for fitting the quantile regression model can be found in this blog post. Continue reading R code for fitting a quantile regression model to censored data by means of a copula

R code for fitting a copula to censored data

The following R code fits a bivariate (Archimedean or elliptical) copula to data where one of the variables contains censored observations. The censored observations can be left, right or interval censored.

copula-censored-data

Two-stage parametric ML method
The copula is fitted using the two-stage parametric ML approach (also referred to as the Inference Functions for Margins [IFM] method). This method fits a copula in two steps:

  1. Estimate the parameters of the marginals
  2. Fix the marginal parameters to the values estimated in first step, and subsequently estimate the copula parameters.

Continue reading R code for fitting a copula to censored data