Package 'longit'

Title: High Dimensional Longitudinal Data Analysis Using MCMC
Description: High dimensional longitudinal data analysis with Markov Chain Monte Carlo(MCMC). Currently support mixed effect regression with or without missing observations by considering covariance structures. It provides estimates by missing at random and missing not at random assumptions. In this R package, we present Bayesian approaches that statisticians and clinical researchers can easily use. The functions' methodology is based on the book "Bayesian Approaches in Oncology Using R and OpenBUGS" by Bhattacharjee A (2020) <doi:10.1201/9780429329449-14>.
Authors: Atanu Bhattacharjee [aut, cre, ctb], Akash Pawar [aut, ctb], Bhrigu Kumar Rajbongshi [aut, ctb]
Maintainer: Atanu Bhattacharjee <[email protected]>
License: GPL-3
Version: 0.1.0
Built: 2024-11-08 06:38:52 UTC
Source: CRAN

Help Index


Bayesian mixed effect model with MCMC

Description

Bayesian mixed effect model with random intercepts and random slopes. Fits using MCMC on longitudinal data set.

Usage

Bysmixed(m, n, t, group, chains, n.adapt, data)

Arguments

m

Starting number of column from where repeated observations begin

n

Ending number of columns till where the repeated observations ends

t

Timepoint information on which repeadted observations were taken

group

A categorical variable either 0 or 1. i.e. Gender - 1 male and 0 female

chains

Number of MCMC chains to be performed

n.adapt

Number of iterations to run in the JAGS adaptive phase.

data

High dimensional longitudinal data

Value

Gives posterior means, standard deviation.

Author(s)

Atanu Bhattacharjee, Akash Pawar and Bhrigu Kumar Rajbongshi

References

Bhattacharjee, A. (2020). Bayesian Approaches in Oncology Using R and OpenBUGS. CRC Press.

Gelman, A., Carlin, J. B., Stern, H. S., Dunson, D. B., Vehtari, A., & Rubin, D. B. (2013). Bayesian data analysis. CRC press.

Fitzmaurice, G. M., Laird, N. M., & Ware, J. H. (2012). Applied longitudinal analysis (Vol. 998). John Wiley & Sons.

Examples

##
data(repdata)
Bysmixed(m=4,n=7,t="Age",group="Gender",chains=4,n.adapt=100,repdata)
##

Bayesian mixed effect model for high dimensional longitduinal data with deviance information criterion (DIC).

Description

Bayesian mixed effect model with random intercept and slopes provides inference with deviance information criterion (DIC). Data longitudinally measured missing value and having batched information. Fits using MCMC on longitudinal data set

Usage

BysmxDIC(m, tmax, t, group, chains, iter, out, data)

Arguments

m

Starting number of column from where repeated observations begin

tmax

Ending number of columns till where the repeated observations ends

t

Timepoint information on which repeadted observations were taken

group

A categorical variable either 0 or 1. i.e. Gender - 1 male and 0 female

chains

Number of MCMC chains to be performed

iter

Number of iterations to be performed

out

DIC/HPD outcome

data

High dimensional longitudinal data

Value

Gives posterior means, standard deviation.

Author(s)

Atanu Bhattacharjee, Akash Pawar and Bhrigu Kumar Rajbongshi

References

Bhattacharjee, A. (2020). Bayesian Approaches in Oncology Using R and OpenBUGS. CRC Press.

Gelman, A., Carlin, J. B., Stern, H. S., Dunson, D. B., Vehtari, A., & Rubin, D. B. (2013). Bayesian data analysis. CRC press.

Fitzmaurice, G. M., Laird, N. M., & Ware, J. H. (2012). Applied longitudinal analysis (Vol. 998). John Wiley & Sons.

Examples

##
data(msrep)
BysmxDIC(m=c(4,8,12),tmax=4,t="Age",group="Gender",chains=4,iter=1000,out="DIC",data=msrep)
##

Bayesian mixed effect model for high dimensional longitduinal data with highest posterior density interval (HPDI).

Description

Bayesian mixed effect model with random intercept and slopes provides inference with highest posterior density interval (HPDI). Data longitudinally measured missing value and having batched information. Fits using MCMC on longitudinal data set

Usage

BysmxHPD(m, tmax, t, group, chains, iter, out, data)

Arguments

m

Starting number of column from where repeated observations begin

tmax

Ending number of columns till where the repeated observations ends

t

Timepoint information on which repeadted observations were taken

group

A categorical variable either 0 or 1. i.e. Gender - 1 male and 0 female

chains

Number of MCMC chains to be performed

iter

Number of iterations to be performed

out

DIC/HPD outcome

data

High dimensional longitudinal data

Value

Gives posterior means, standard deviation.

Author(s)

Atanu Bhattacharjee, Akash Pawar and Bhrigu Kumar Rajbongshi

References

Bhattacharjee, A. (2020). Bayesian Approaches in Oncology Using R and OpenBUGS. CRC Press.

Gelman, A., Carlin, J. B., Stern, H. S., Dunson, D. B., Vehtari, A., & Rubin, D. B. (2013). Bayesian data analysis. CRC press.

Fitzmaurice, G. M., Laird, N. M., & Ware, J. H. (2012). Applied longitudinal analysis (Vol. 998). John Wiley & Sons.

Examples

##
data(msrep)
BysmxHPD(m=c(4,8,12),tmax=4,t="Age",group="Gender",chains=4,iter=1000,out="hpD",data=msrep)
##

Bayesian mixed model with random intercepts and random slopes for high dimensional longitudinal data

Description

Bayesian mixed effect model with random intercepts and slopes with longitudinally measured missing data. Fits using MCMC on longitudinal data set

Usage

Bysmxms(m, n, time, group, chains, n.adapt, data)

Arguments

m

Starting number of column from where repeated observations begin

n

Ending number of columns till where the repeated observations ends

time

Timepoint information on which repeadted observations were taken

group

A categorical variable either 0 or 1. i.e. Gender - 1 male and 0 female

chains

Number of MCMC chains to be performed

n.adapt

Number of iterations to run in the JAGS adaptive phase.

data

High dimensional longitudinal data

Value

Gives posterior means, standard deviation.

Author(s)

Atanu Bhattacharjee, Akash Pawar and Bhrigu Kumar Rajbongshi

References

Bhattacharjee, A. (2020). Bayesian Approaches in Oncology Using R and OpenBUGS. CRC Press.

Gelman, A., Carlin, J. B., Stern, H. S., Dunson, D. B., Vehtari, A., & Rubin, D. B. (2013). Bayesian data analysis. CRC press.

Fitzmaurice, G. M., Laird, N. M., & Ware, J. H. (2012). Applied longitudinal analysis (Vol. 998). John Wiley & Sons.

Examples

##
data(mesrep)
Bysmxms(m=4,n=7,time="Age",group="Gender",chains=4,n.adapt=100,data=msrep)
##

Bayesian mixed model with random intercepts and random slopes for high dimensional longitudinal data with batch size.

Description

Bayesian mixed effect model with random intercept and slopes. Data longitudinally measured missing value and having batched information. Fits using MCMC on longitudinal data set

Usage

Bysmxmss(m, tmax, timepoints, group, chains, iter, data)

Arguments

m

Starting number of column from where repeated observations begin

tmax

Maximum batch of visits considered as repeated measurements

timepoints

Timepoint information on which repeadted observations were taken

group

A categorical variable either 0 or 1. i.e. Gender - 1 male and 0 female

chains

Number of MCMC chains to be performed

iter

Number of iterations to be performed

data

High dimensional longitudinal data

Value

Gives posterior means, standard deviation.

Author(s)

Atanu Bhattacharjee and Akash Pawar

References

Bhattacharjee, A. (2020). Bayesian Approaches in Oncology Using R and OpenBUGS. CRC Press.

Gelman, A., Carlin, J. B., Stern, H. S., Dunson, D. B., Vehtari, A., & Rubin, D. B. (2013). Bayesian data analysis. CRC press.

Fitzmaurice, G. M., Laird, N. M., & Ware, J. H. (2012). Applied longitudinal analysis (Vol. 998). John Wiley & Sons.

Examples

##
data(repdat)

Bayesian multivariate regression with unstructured covariance matrix for high dimensional longitudinal data.

Description

Multivariate Regression with unstructured covariance matrix in longitudinal datasetup with high dimensional.

Usage

creg(m, n, chains, n.adapt, data)

Arguments

m

Starting number of column from where repeated observations begin

n

Ending number of columns till where the repeated observations ends

chains

Number of MCMC chains to be performed

n.adapt

Number of iterations to be performed

data

High dimensional longitudinal data

Value

Results of posterior means and standard deviation.

Author(s)

Atanu Bhattacharjee, Akash Pawar and Bhrigu Kumar Rajbongshi

References

Bhattacharjee, A. (2020). Bayesian Approaches in Oncology Using R and OpenBUGS. CRC Press.

Gelman, A., Carlin, J. B., Stern, H. S., Dunson, D. B., Vehtari, A., & Rubin, D. B. (2013). Bayesian data analysis. CRC press.

Fitzmaurice, G. M., Laird, N. M., & Ware, J. H. (2012). Applied longitudinal analysis (Vol. 998). John Wiley & Sons.

Examples

##
data(repdata)
creg(m=4,n=7,chains=4,n.adapt=100,data=repdata)
##

gh

Description

High dimensional data on three consecutive measurements for and treatment arm information column.

Usage

data(gh)

Format

A tibble with 4 columns which are :

y1

Observation on first timepoint

y2

Observation on second timepoint

y3

Observation on first timepoint

Treatment

Treatment arm of the patient


Missing at ranom by MCMC

Description

Missing at ranom by MCMC

Usage

hdmarjg(m, n, treatment, n.chains, n.iter, dat)

Arguments

m

Starting column number of the Y observations

n

Ending column number of the Y observations

treatment

Variable/column name containing the Treatment observations

n.chains

Number of MCMC chains

n.iter

Number of MCMC iterations

dat

Data set containing treatment column and repeated observations arrange by columns observations

Value

A data table listing the posterior mean and sigma results

Author(s)

Atanu Bhattacharjee, Akash Pawar and Bhrigu Kumar Rajbongshi

References

Bhattacharjee, A. (2020). Bayesian Approaches in Oncology Using R and OpenBUGS. CRC Press.

Gelman, A., Carlin, J. B., Stern, H. S., Dunson, D. B., Vehtari, A., & Rubin, D. B. (2013). Bayesian data analysis. CRC press.

Fitzmaurice, G. M., Laird, N. M., & Ware, J. H. (2012). Applied longitudinal analysis (Vol. 998). John Wiley & Sons.

Examples

##
data(gh)
hdmarjg(m=1,n=3,treatment="Treatment",n.chains=2,n.iter=10,dat=gh)
##

Missing not at random by MCMC

Description

Missing not at random by MCMC

Usage

hdmnarjg(m, n, treatment, n.chains, n.iter, dat)

Arguments

m

Starting column number of repeated observations

n

Ending column number of the repeated observations

treatment

Variable/column name containing the Treatment observations

n.chains

Number of MCMC chains

n.iter

Number of MCMC iterations

dat

Data set containing treatment column and repeated observations

Value

Results containing a data table listing the means and sigma results

Author(s)

Atanu Bhattacharjee, Akash Pawar and Bhrigu Kumar Rajbongshi

References

Bhattacharjee, A. (2020). Bayesian Approaches in Oncology Using R and OpenBUGS. CRC Press.

Gelman, A., Carlin, J. B., Stern, H. S., Dunson, D. B., Vehtari, A., & Rubin, D. B. (2013). Bayesian data analysis. CRC press.

Fitzmaurice, G. M., Laird, N. M., & Ware, J. H. (2012). Applied longitudinal analysis (Vol. 998). John Wiley & Sons.

Examples

##
data(gh)
hdmnarjg(m=1,n=3,treatment="Treatment",n.chains=2,n.iter=10,dat=gh)
##

Repeatedly measured protein expression data

Description

Longitudinal observation on single variable from different observations. Observations arranged in a column as the patient with corresponding column of ID.

Usage

data(longitdata)

Format

A tibble with 2 columns which are :

ID

Patient ID

y

Repeated observations on the patient arranged in a row as per a subject


longitudinal data

Description

Longitudinal observation on single variable at different timepoints. Observations arranged in a column as the patient with corresponding column of ID.

Usage

data(msrep)

Format

A tibble with 7 columns which are :

Subject

Patient ID

Gender

Categorical numeric variable, 1 if Males and 0 if female

Age

Time or age at which observations were taken from every subjects

x1,...,x4

Columns stating number of observations at age 18,10,12 and 14


Bayesian multivariate regression with independent covariance matrix for high dimensional longitudinal data.

Description

Multivariate Regression with independent covariance matrix in longitudinal datasetup with high dimensional.

Usage

mvncovar1(m, n, time, group, chains, iter, data)

Arguments

m

Starting number of column from where repeated observations begin

n

Ending number of columns till where the repeated observations ends

time

Timepoint information on which repeadted observations were taken

group

A categorical variable either 0 or 1. i.e. Gender - 1 male and 0 female

chains

Number of MCMC chains to be performed

iter

Number of iterations to be performed

data

High dimensional longitudinal data

Value

mvncovarout lists posterior omega and sigma values.

Author(s)

Atanu Bhattacharjee, Akash Pawar and Bhrigu Kumar Rajbongshi

References

Bhattacharjee, A. (2020). Bayesian Approaches in Oncology Using R and OpenBUGS. CRC Press.

Gelman, A., Carlin, J. B., Stern, H. S., Dunson, D. B., Vehtari, A., & Rubin, D. B. (2013). Bayesian data analysis. CRC press.

Fitzmaurice, G. M., Laird, N. M., & Ware, J. H. (2012). Applied longitudinal analysis (Vol. 998). John Wiley & Sons.

Examples

##
data(repdata)
mvncovar1(m=4,n=7,time="Age",group="Gender",chains=10,iter=100,repdata)
##

Bayesian multivariate normal regression with unstructured covariance matrix for high dimensional longitudinal data.

Description

Multivariate normal regression with group covaraites and unstructured covariance matrix.

Usage

mvncovar2(m, n, time, group, chains, iter, data)

Arguments

m

Starting number of column from where repeated observations begin

n

Ending number of columns till where the repeated observations ends

time

Timepoint information on which repeadted observations were taken

group

A categorical variable either 0 or 1. i.e. Gender - 1 male and 0 female

chains

Number of MCMC chains to be performed

iter

Number of iterations to be performed

data

High dimensional longitudinal data

Value

mvncovarout

Author(s)

Atanu Bhattacharjee, Akash Pawar and Bhrigu Kumar Rajbongshi

References

Bhattacharjee, A. (2020). Bayesian Approaches in Oncology Using R and OpenBUGS. CRC Press.

Gelman, A., Carlin, J. B., Stern, H. S., Dunson, D. B., Vehtari, A., & Rubin, D. B. (2013). Bayesian data analysis. CRC press.

Fitzmaurice, G. M., Laird, N. M., & Ware, J. H. (2012). Applied longitudinal analysis (Vol. 998). John Wiley & Sons.

Examples

##
data(repdata)
mvncovar2(m=4,n=7,time="Age",group="Gender",chains=4,iter=100,data=repdata)
##

longitudinal data

Description

Longitudinal observation on single variable at different timepoints. Observations arranged in a column as the patient with corresponding column of ID.

Usage

data(repdata)

Format

A tibble with 7 columns which are :

Subject

Patient ID

Gender

Categorical numeric variable, 1 if Males and 0 if female

Age

Time or age at which observations were taken from every subjects

x1,...,x4

Columns stating number of observations at age 18,10,12 and 14