Description Usage Arguments Value Author(s) References Examples

Main function for estimating the LM model for continuous outcomes with covariates in the latent model.

**The function is no longer maintained. Please look at** `lmestCont`

**function**.

1 2 3 4 |

`Y` |
array of continuous outcomes (n x TT x r) |

`X1` |
matrix of covariates affecting the initial probabilities (n x nc1) |

`X2` |
array of covariates affecting the transition probabilities (n x TT-1 x nc2) |

`yv` |
vector of frequencies of the available configurations |

`k` |
number of latent states |

`start` |
type of starting values (0 = deterministic, 1 = random, 2 = initial values in input) |

`tol` |
tolerance level for checking convergence of the algorithm |

`maxit` |
maximum number of iterations of the algorithm |

`param` |
type of parametrization for the transition probabilities ("multilogit" = standard multinomial logit for every row of the transition matrix, "difflogit" = multinomial logit based on the difference between two sets of parameters) |

`Mu` |
initial value of the conditional means (r x k) (if start=2) |

`Si` |
initial value of the var-cov matrix common to all states (r x r) (if start=2) |

`Be` |
intial value of the parameters affecting the logit for the initial probabilities (if start=2) |

`Ga` |
intial value of the parametes affecting the logit for the transition probabilities (if start=2) |

`output` |
to return additional output (V,PI,Piv,Ul) |

`out_se` |
to compute the information matrix and standard errors |

`lk ` |
maximum log-likelihood |

`Be ` |
estimated array of the parameters affecting the logit for the initial probabilities |

`Ga ` |
estimated array of the parameters affecting the logit for the transition probabilities |

`Mu ` |
estimate of conditional means of the response variables |

`Si ` |
estimate of var-cov matrix common to all states |

`np ` |
number of free parameters |

`aic ` |
value of AIC for model selection |

`bic ` |
value of BIC for model selection |

`lkv ` |
log-likelihood trace at every step |

`Piv ` |
estimate of initial probability matrix |

`PI ` |
estimate of transition probability matrices |

`Ul ` |
matrix containing the predicted sequence of latent states by the local decoding method |

`call` |
command used to call the function |

Francesco Bartolucci, Silvia Pandolfi, University of Perugia, http://www.stat.unipg.it/bartolucci

Bartolucci, F., Farcomeni, A. and Pennoni, F. (2013) *Latent Markov Models for Longitudinal Data*, Chapman and Hall/CRC press.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | ```
## Not run:
# Example based on multivariate longitudinal continuous data
data(data_long_cont)
TT <- 5
res <- long2matrices(data_long_cont$id, X = cbind(data_long_cont$X1, data_long_cont$X2),
Y = cbind(data_long_cont$Y1, data_long_cont$Y2, data_long_cont$Y3))
Y <- res$YY
X1 <- res$XX[,1,]
X2 <- res$XX[,2:TT,]
# estimate the model
est <- est_lm_cov_latent_cont(Y, X1, X2, k = 3, output = TRUE)
summary(est)
# average transition probability matrix
PI <- round(apply(est$PI[,,,2:TT], c(1,2), mean), 4)
PI
## End(Not run)
``` |

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.