From a4b83153804bd97f89213a9599f9acd612eea1e1 Mon Sep 17 00:00:00 2001 From: agdamsbo Date: Mon, 29 Oct 2018 13:16:00 +0100 Subject: [PATCH] =?UTF-8?q?adding=20exp()=20to=20OR=C2=B4s=20->=20major=20?= =?UTF-8?q?fix!!?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DESCRIPTION | 2 +- R/strobe_diff_twodim.R | 8 ++++---- man/strobe_olr.Rd | 6 ++---- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 9b4eddc..7de6acf 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: daDoctoR Type: Package Title: FUNCTIONS FOR HEALTH RESEARCH -Version: 0.1.0.9016 +Version: 0.1.0.9018 Author@R: c(person("Andreas", "Gammelgaard Damsbo", email = "agdamsbo@pm.me", role = c("cre", "aut"))) Maintainer: Andreas Gammelgaard Damsbo Description: I am a Danish medical doctor involved in neuropsychiatric research. diff --git a/R/strobe_diff_twodim.R b/R/strobe_diff_twodim.R index afaaece..98ad81e 100644 --- a/R/strobe_diff_twodim.R +++ b/R/strobe_diff_twodim.R @@ -67,16 +67,16 @@ strobe_diff_twodim<-function(meas,group,adj,data,dec=2){ di<-dat mod<-glm(m~g,family=binomial(),data=di) - ci<-confint(mod) - co<-round(coef(mod)[-1],dec) + ci<-exp(confint(mod)) + co<-round(exp(coef(mod))[-1],dec) lo<-round(ci[-1,1],dec) up<-round(ci[-1,2],dec) or_ci<-c("REF",paste0(co," (",lo," to ",up,")")) amod<-glm(m~.,family=binomial(),data=di) - aci<-confint(amod) - aco<-round(coef(amod)[2:length(levels(g))],dec) + aci<-exp(confint(amod)) + aco<-round(exp(coef(amod))[2:length(levels(g))],dec) alo<-round(aci[2:length(levels(g)),1],dec) aup<-round(aci[2:length(levels(g)),2],dec) diff --git a/man/strobe_olr.Rd b/man/strobe_olr.Rd index ecdb649..11a8bec 100644 --- a/man/strobe_olr.Rd +++ b/man/strobe_olr.Rd @@ -4,14 +4,12 @@ \alias{strobe_olr} \title{Print regression results according to STROBE} \usage{ -strobe_olr(meas, var, adj, data, dec = 2) +strobe_olr(meas, vars, data, dec = 2) } \arguments{ \item{meas}{outcome meassure variable name in data-data.frame as a string. Can be numeric or factor. Result is calculated accordingly.} -\item{var}{exposure variable to compare against (active vs placebo). As string.} - -\item{adj}{variables to adjust for, as string.} +\item{vars}{variables to compare against. As vector of columnnames.} \item{data}{dataframe of data.}