Description Usage Arguments Value

Use logistic regression or GLMM with LASSO regularity to model missingness for time-varying correlated data. Output weights and full observation rows for each time-varying varaible.

1 2 3 4 5 6 7 8 | ```
calWeights(
data,
lcolnames,
ID,
w = c("peri", "perij"),
timevar,
method = "param"
)
``` |

`data` |
Original data (numerical variables only) with missing values. |

`lcolnames` |
A vector of longitudinal variables names. |

`w` |
Type of sampling weights or missingness level. "peri" is to consider weights on subject level, which means any subjects with partial missing would be excluded from complete cases. "perij" is to consider weights on subject and time level. Only subjects with all time points missing would be excluded from complete cases. |

`timevar` |
The time variable or cluster varaible name. |

`method` |
Missingness model. If method = "param", the function utilize logistic regression ("peri") or GLMM ("perij") for missingness model. If method = "nonparam", the function utilize random forest ("peri") for missingness model. |

A list contains two elements.

Element 1 - Inversed probability of being observed.

Element 2 - Row numbers of complete records in the original data.

#' @import dplyr glmmLasso glmnet doParallel lme4 missForest REEMtree MASS nlme

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.