adding exp() to OR´s -> major fix!!

This commit is contained in:
agdamsbo 2018-10-29 13:16:00 +01:00
parent fc2dea7f18
commit a4b8315380
3 changed files with 7 additions and 9 deletions

View File

@ -1,7 +1,7 @@
Package: daDoctoR Package: daDoctoR
Type: Package Type: Package
Title: FUNCTIONS FOR HEALTH RESEARCH 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"))) Author@R: c(person("Andreas", "Gammelgaard Damsbo", email = "agdamsbo@pm.me", role = c("cre", "aut")))
Maintainer: Andreas Gammelgaard Damsbo <agdamsbo@pm.me> Maintainer: Andreas Gammelgaard Damsbo <agdamsbo@pm.me>
Description: I am a Danish medical doctor involved in neuropsychiatric research. Description: I am a Danish medical doctor involved in neuropsychiatric research.

View File

@ -67,16 +67,16 @@ strobe_diff_twodim<-function(meas,group,adj,data,dec=2){
di<-dat di<-dat
mod<-glm(m~g,family=binomial(),data=di) mod<-glm(m~g,family=binomial(),data=di)
ci<-confint(mod) ci<-exp(confint(mod))
co<-round(coef(mod)[-1],dec) co<-round(exp(coef(mod))[-1],dec)
lo<-round(ci[-1,1],dec) lo<-round(ci[-1,1],dec)
up<-round(ci[-1,2],dec) up<-round(ci[-1,2],dec)
or_ci<-c("REF",paste0(co," (",lo," to ",up,")")) or_ci<-c("REF",paste0(co," (",lo," to ",up,")"))
amod<-glm(m~.,family=binomial(),data=di) amod<-glm(m~.,family=binomial(),data=di)
aci<-confint(amod) aci<-exp(confint(amod))
aco<-round(coef(amod)[2:length(levels(g))],dec) aco<-round(exp(coef(amod))[2:length(levels(g))],dec)
alo<-round(aci[2:length(levels(g)),1],dec) alo<-round(aci[2:length(levels(g)),1],dec)
aup<-round(aci[2:length(levels(g)),2],dec) aup<-round(aci[2:length(levels(g)),2],dec)

View File

@ -4,14 +4,12 @@
\alias{strobe_olr} \alias{strobe_olr}
\title{Print regression results according to STROBE} \title{Print regression results according to STROBE}
\usage{ \usage{
strobe_olr(meas, var, adj, data, dec = 2) strobe_olr(meas, vars, data, dec = 2)
} }
\arguments{ \arguments{
\item{meas}{outcome meassure variable name in data-data.frame as a string. Can be numeric or factor. Result is calculated accordingly.} \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{vars}{variables to compare against. As vector of columnnames.}
\item{adj}{variables to adjust for, as string.}
\item{data}{dataframe of data.} \item{data}{dataframe of data.}