# MEDseq v1.2.0

Monthly downloads

## Mixtures of Exponential-Distance Models with Covariates

Implements a model-based clustering method for categorical life-course sequences relying on mixtures of exponential-distance models introduced by Murphy et al. (2019) <arXiv:1908.07963>. A range of flexible precision parameter settings corresponding to weighted generalisations of the Hamming distance metric are considered, along with the potential inclusion of a noise component. Gating covariates can be supplied in order to relate sequences to baseline characteristics. Sampling weights are also accommodated. The models are fitted using the EM algorithm and tools for visualising the results are also provided.

## Readme

# MEDseq R Package

## Mixtures of Exponential-Distance Models

## for Clustering Longitudinal Life-Course Sequences

## with Gating Covariates and Sampling Weights

### Written by Keefe Murphy

## Description

Fits *MEDseq* models introduced by Murphy et al. (2019) [arXiv:1908.07963](https://arxiv.org/abs/1908.07963), i.e. fits mixtures of exponential-distance models for clustering longitudinal/categorical life-course sequence data via the EM/CEM algorithm. A family of parsimonious precision parameter constraints are accommodated. So too are sampling weights. Gating covariates can be supplied via formula interfaces. Visualisation of the results of such models is also facilitated.

The most important function in the **MEDseq** package is: `MEDseq_fit`

, for fitting the models via EM/CEM. `MEDseq_control`

allows supplying additional arguments which govern, among other things, controls on the initialisation of the allocations for the EM/CEM algorithm and the various model selection options. `MEDseq_compare`

is provided for conducting model selection between different results from using different covariate combinations &/or initialisation strategies, etc. `MEDseq_stderr`

is provided for computing the standard errors of the coefficients for the covariates in the gating network.

A dedicated plotting function exists for visualising various aspects of the results, using new methods as well as some existing methods from the **TraMineR** package. Finally, the package also contains two data sets: `biofam`

and `mvad`

.

## Installation

You can install the latest stable official release of the `MEDseq`

package from CRAN:

```
install.packages("MEDseq")
```

or the development version from GitHub:

```
# If required install devtools:
# install.packages('devtools')
devtools::install_github('Keefe-Murphy/MEDseq')
```

In either case, you can then explore the package with:

```
library(MEDseq)
help(MEDseq_fit) # Help on the main modelling function
```

For a more thorough intro, the vignette document is available as follows:

```
vignette("MEDseq", package="MEDseq")
```

However, if the package is installed from GitHub the vignette is not automatically created. It can be accessed when installing from GitHub with the code:

```
devtools::install_github('Keefe-Murphy/MEDseq', build_vignettes = TRUE)
```

Alternatively, the vignette is available on the package's CRAN page.

### References

Murphy, K., Murphy, T. B., Piccarreta, R., and Gormley, I. C. (2019). Clustering longitudinal life-course sequences using mixtures of exponential-distance models. *To appear*. [arXiv:1908.07963](https://arxiv.org/abs/1908.07963)

## Functions in MEDseq

Name | Description | |

MEDseq_news | Show the NEWS file | |

dbs | Compute the Density-based Silhouette | |

MEDseq_control | Set control values for use with MEDseq_fit | |

MEDseq_meantime | Compute the mean time spent in each sequence category | |

get_MEDseq_results | Extract results from a MEDseq model | |

MEDseq-package | MEDseq: Mixtures of Exponential-Distance Models with Covariates | |

MEDseq_fit | MEDseq: Mixtures of Exponential-Distance Models with Covariates | |

MEDseq_stderr | MEDseq gating network standard errors | |

MEDseq_compare | Choose the best MEDseq model | |

biofam | Family life states from the Swiss Household Panel biographical survey | |

mvad | MVAD: Transition from school to work | |

plot.MEDseq | Plot MEDseq results | |

No Results! |

## Vignettes of MEDseq

Name | ||

BIO_Clusters.png | ||

MEDseq.Rmd | ||

MVAD_Clusters.png | ||

MVAD_Mean.png | ||

mvad_mod1.rda | ||

mvad_mod2.rda | ||

mvad_mod3.rda | ||

No Results! |

## Last month downloads

## Details

Type | Package |

Date | 2020-11-20 |

License | GPL (>= 2) |

Encoding | UTF-8 |

URL | https://cran.r-project.org/package=MEDseq |

BugReports | https://github.com/Keefe-Murphy/MEDseq |

LazyData | true |

RoxygenNote | 7.1.1 |

VignetteBuilder | knitr |

NeedsCompilation | no |

Packaged | 2020-11-20 22:45:59 UTC; Keefe |

Repository | CRAN |

Date/Publication | 2020-11-21 14:20:02 UTC |

imports | cluster , matrixStats (>= 0.53.1) , nnet , seriation , stringdist , TraMineR (>= 1.6) , WeightedCluster |

suggests | klaR (>= 0.6-13) , knitr , rmarkdown , viridisLite (>= 0.2.0) |

depends | R (>= 4.0.0) |

Contributors | Claire Gormley, Thomas Brendan Murphy, Raffaella Piccarreta |

#### Include our badge in your README

```
[![Rdoc](http://www.rdocumentation.org/badges/version/MEDseq)](http://www.rdocumentation.org/packages/MEDseq)
```