logisticrr

Deriving adjusted relative risk from logistic regression

https://github.com/youjin1207/logisticrr

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

logistic-regression odds-ratio relative-risk
Last synced: 10 months ago · JSON representation

Repository

Deriving adjusted relative risk from logistic regression

Basic Info
  • Host: GitHub
  • Owner: youjin1207
  • License: gpl-3.0
  • Language: R
  • Default Branch: master
  • Homepage:
  • Size: 86.9 KB
Statistics
  • Stars: 3
  • Watchers: 0
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Topics
logistic-regression odds-ratio relative-risk
Created almost 8 years ago · Last pushed over 6 years ago
Metadata Files
Readme License

README.md

Travis-CI Build Status DOI ![Downloads badge](http://cranlogs.r-pkg.org/badges/logisticRR) ![version badge](http://www.r-pkg.org/badges/version-last-release/logisticRR)

Overview

Package information

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

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 Email Commits
youjin1207 y****0@j****u 18
youjin1207 y****2@g****m 1
Committer Domains (Top 20 + Academic)
jhu.edu: 1

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

  • Versions: 3
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 215 Last month
  • Docker Downloads: 25
Rankings
Stargazers count: 28.5%
Forks count: 28.8%
Dependent packages count: 29.8%
Dependent repos count: 35.5%
Average: 35.5%
Downloads: 55.0%
Last synced: 11 months ago

Dependencies

DESCRIPTION cran
  • nnet * imports
  • rmarkdown * imports
  • stats * imports
  • knitr * suggests
  • testthat * suggests