{"id":18238711,"url":"https://github.com/tengfei-emory/timereglc","last_synced_at":"2025-04-08T16:16:00.936Z","repository":{"id":201877256,"uuid":"185022570","full_name":"tengfei-emory/timeregLC","owner":"tengfei-emory","description":"A Time-Dependent Structural Model Between Latent Classes and Competing Risks Outcomes","archived":false,"fork":false,"pushed_at":"2021-09-23T03:57:14.000Z","size":48,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-02-14T12:49:12.942Z","etag":null,"topics":["competing-risks","latent-class-analysis"],"latest_commit_sha":null,"homepage":"","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tengfei-emory.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2019-05-05T11:31:45.000Z","updated_at":"2024-06-13T11:58:41.000Z","dependencies_parsed_at":null,"dependency_job_id":"64d43984-f3ff-4266-936a-7034b9745a5c","html_url":"https://github.com/tengfei-emory/timeregLC","commit_stats":null,"previous_names":["tengfei-emory/timereglc"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tengfei-emory%2FtimeregLC","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tengfei-emory%2FtimeregLC/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tengfei-emory%2FtimeregLC/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tengfei-emory%2FtimeregLC/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tengfei-emory","download_url":"https://codeload.github.com/tengfei-emory/timeregLC/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247878015,"owners_count":21011158,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["competing-risks","latent-class-analysis"],"created_at":"2024-11-05T03:42:03.800Z","updated_at":"2025-04-08T16:16:00.911Z","avatar_url":"https://github.com/tengfei-emory.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"# timeregLC\nA Time-Dependent Structural Model Between Latent Classes and Competing Risks Outcomes\n\n# Installation Guide\n```{r}\n# install.packages(\"devtools\")\ndevtools::install_github(\"tengfei-emory/timeregLC\")\nlibrary(timeregLC)\n```\nCurrently `timeregLC` supports R version \u003e= 3.5.0.\n\n# Example: analyze a simulated dataset\n\n## Data simulation\n\nFunction `simulation` can be used to generate a dataset with baseline covariates and competing risks.\n\n```{r}\n# The following example specifies all required parameters and generate a dataset with three latent classes.\n\n# Regression parameter of latent class effect in the structural competing risks model\nlambda \u003c- c(0.5,0.5,-1)\n\n# Latent class proportion\npi = c(0.3,0.35,0.35)\n\n# Mean vectors for the three classes: (1,1), (2.5,2.5) and (4,4)\nmu = matrix(c(1,1,2.5,2.5,4,4),nrow=2,ncol=3)\n\n# Covariance matrices for the three classes (as a list)\nsigma1 = matrix(c(0.36,0.27,0.27,0.81),2,2)\nsigma2 = matrix(c(0.49,0.504,0.504,0.64),2,2)\nsigma3 = matrix(c(0.25,0.225,0.225,0.25),2,2)\nsigma = list(sigma1,sigma2,sigma3)\n\n# Parameter associated with competing risks distribution\np.cif = 0.66\n\n# Lower bound and upper bound for uniformly distributed censoring time\ncl=0.19\ncu=1.09\n\n# Main function of simulation. Here sample size is set as 500.\ndat=simulation(500,pi,mu,sigma,lambda,p.cif,cl,cu)\n```\nSpecifically, it returns a data frame of 3 latent classes with 2 baseline covariates (`Y.1` and `Y.2`), time of competing risks (`ftime`), and failure types (`fstatus`). Failure types include type `1`, `2`, censored `0`, or missing `NA`. \n\n## Model fitting\n\nThe analysis for the dataset `dat` can be conducted by running `timereg` function:\n\n```{r}\nlibrary(timereg)\n# create an event object \nevent = Event(0,dat$ftime,dat$fstatus)\n\n# specify the baseline covariate matrix\ncovariates=cbind(dat$Y.1,dat$Y.2)\n\n# run main algorithm\nfit.timeregLC \u003c- timeregLC(event,covariates,inference=T,C=3,d=1,timepoints=NULL,\n                    control.optim=list(reltol=.00001,strategy=2,itermax=1000,trace=F),\n                    verbose=T)\n```                   \n\nThe output list `fit.timeregLC` contains the following information:\n\n`lambda`: time-dependent point estimates at specified time points\n\n`Sigma`: time-dependent estimates for the asymptotic covariance estimates\n\nPlease refer to the documentation associated with the package for more details. Please report issues under this GitHub repository (tengfei-emory/timeregLC).\n\n# References\n\nFei, T, Hanfelt, J, Peng, L. Evaluating the association between latent classes and competing risks outcomes with multi-phenotype data. Biometrics. 2021. https://doi.org/10.1111/biom.13563\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftengfei-emory%2Ftimereglc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftengfei-emory%2Ftimereglc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftengfei-emory%2Ftimereglc/lists"}