logisticrr
Deriving adjusted relative risk from logistic regression
Science Score: 20.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
○codemeta.json file
-
○.zenodo.json file
-
○DOI references
-
✓Academic publication links
Links to: zenodo.org -
✓Committers with academic emails
1 of 2 committers (50.0%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (10.2%) to scientific vocabulary
Keywords
Repository
Deriving adjusted relative risk from logistic regression
Basic Info
Statistics
- Stars: 3
- Watchers: 0
- Forks: 0
- Open Issues: 0
- Releases: 0
Topics
Metadata Files
README.md
Overview
Package information
- Version: 0.3.0
- Maintainer : Youjin Lee (youjin.lee@pennmedicine.upenn.edu)
- Imports : stats, nnet
Installation
You can download the package by:
install.packages("logisticRR")
library(logisticRR)
or you can directly download the development version from author's Github
install.packages("devtools")
library(devtools)
install_github("youjin1207/logisticRR")
Usage
Here is a R vignettes for guidance. Or you can access to vignettes via:
install_github("youjin1207/logisticRR", build_vignettes = TRUE)
library(logisticRR)
vignette("logisticRR", package = "logisticRR")
Example
generate hypothetical data
n <- 500
set.seed(1234)
X <- rbinom(n, 1, 0.3)
W <- rbinom(n, 1, 0.3); W[sample(1:n, n/3)] = 2
Z <- rep(0, n)
Z[sample(1:n, n/2)] <- "female"; Z <- ifelse(Z == 0, "male", Z)
dummyZ <- ifelse(Z == "female", 1, 0)
Y <- rbinom(n, 1, plogis(X - W + 2*dummyZ))
dat <- as.data.frame(cbind(Y, X, W, Z))
dat$X <- as.numeric(dat$X); dat$X <- ifelse(dat$X == 2, 1, 0)
dat$Y <- as.numeric(dat$Y); dat$Y <- ifelse(dat$Y == 2, 1, 0)
dat$W <- as.factor(dat$W)
dat$Z <- as.factor(dat$Z)
``` simresult <- logisticRR(Y ~ X + W + Z, data = dat, boot = TRUE, n.boot = 200) var(simresult$boot.rr) simresult$delta.var
simresult$RR ```
``` nominalresult <- logisticRR(Y ~ W + X + Z, data = dat, boot = TRUE, n.boot = 200) var(nominalresult$boot.rr) nominalresult$delta.var
nominalresult$RR ```
multivariate logistic regression
When reponse variable takes more than two values, multinomial logistic regression is widely used to reveal association between the response variable and exposure variable. In that case, relative risk of each category compared to the reference category can be considered, conditional on other fixed covariates. Other than (adjusted) relative risk, relative risks ratio (RRR) is often of interest in multinomial logistic regression.
``` dat$multiY <- ifelse(dat$X == 1, rbinom(n, 1, 0.8) + dat$Y, rbinom(n, 1, 0.2) + dat$Y) multiresult <- multiRR(multiY ~ X + W + Z, data = dat, boot = TRUE, n.boot = 1000) apply(multiresult$boot.rr, 2, sd) sqrt(multiresult$delta.var)
multiresult$RRR multiresult$RR ```
Similar to the binary reponse, in multinomial logistic regression model, categorical exposure variable can be introduced; in this case, baseline value and comparative value of exposure variable should be specified.
``` multinresult <- multinRR(multiY ~ W + X + Z, data = dat, basecov = 0, comparecov = 1, boot = TRUE, n.boot = 1000) apply(multinresult$boot.rr, 2, sd) sqrt(multinresult$delta.var)
multinresult$RRR multinresult$RR ```
Owner
- Name: Youjin Lee
- Login: youjin1207
- Kind: user
- Company: Brown University
- Website: http://www.youjinleeylee.com
- Repositories: 3
- Profile: https://github.com/youjin1207
GitHub Events
Total
Last Year
Committers
Last synced: over 3 years ago
All Time
- Total Commits: 19
- Total Committers: 2
- Avg Commits per committer: 9.5
- Development Distribution Score (DDS): 0.053
Top Committers
| Name | Commits | |
|---|---|---|
| youjin1207 | y****0@j****u | 18 |
| youjin1207 | y****2@g****m | 1 |
Committer Domains (Top 20 + Academic)
Packages
- Total packages: 1
-
Total downloads:
- cran 215 last-month
- Total docker downloads: 25
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 3
- Total maintainers: 1
cran.r-project.org: logisticRR
Adjusted Relative Risk from Logistic Regression
- Homepage: https://github.com/youjin1207/logisticRR
- Documentation: http://cran.r-project.org/web/packages/logisticRR/logisticRR.pdf
- License: GPL (≥ 3) | file LICENSE
-
Latest release: 0.3.0
published over 6 years ago
Rankings
Maintainers (1)
Dependencies
- nnet * imports
- rmarkdown * imports
- stats * imports
- knitr * suggests
- testthat * suggests