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
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 <agdamsbo@pm.me>
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
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)

View File

@ -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.}