From 91f3c0a48342284e91d1d17fdce546ead34950ab Mon Sep 17 00:00:00 2001 From: agdamsbo Date: Wed, 13 Nov 2019 10:43:25 +0100 Subject: [PATCH] u --- DESCRIPTION | 2 +- R/strobe_pred.R | 23 ++++++++++------------- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 940bfaa..f4962c5 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: daDoctoR Type: Package Title: FUNCTIONS FOR HEALTH RESEARCH -Version: 0.1.0.9027 +Version: 0.1.0.9028 Author: 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_pred.R b/R/strobe_pred.R index d77d8f6..f61d9dc 100644 --- a/R/strobe_pred.R +++ b/R/strobe_pred.R @@ -135,15 +135,13 @@ strobe_pred<-function(meas,adj,data,dec=2,n.by.adj=FALSE,p.val=FALSE){ nq<-rbind(nq,cbind(nl,rt)) }}} - rnames<-c() - - for (i in 1:length(ads)){ - if (is.factor(ads[,i])){ - rnames<-c(rnames,names(ads[i]),levels(ads[,i])) + for (i in 1:ncol(dat2)){ + if (is.factor(dat2[,i])){ + rnames<-c(rnames,names(dat2)[i],paste0(names(dat2)[i],levels(dat2[,i]))) } - if (!is.factor(ads[,i])){ - rnames<-c(rnames,names(ads[i]),"Per unit increase") + if (!is.factor(dat2[,i])){ + rnames<-c(rnames,paste0(names(dat2)[i],".all"),names(dat2)[i]) } } res<-cbind(aor_ci,apv) @@ -296,13 +294,12 @@ strobe_pred<-function(meas,adj,data,dec=2,n.by.adj=FALSE,p.val=FALSE){ rnames<-c() - - for (i in 1:length(ads)){ - if (is.factor(ads[,i])){ - rnames<-c(rnames,names(ads[i]),levels(ads[,i])) + for (i in 1:ncol(dat2)){ + if (is.factor(dat2[,i])){ + rnames<-c(rnames,names(dat2)[i],paste0(names(dat2)[i],levels(dat2[,i]))) } - if (!is.factor(ads[,i])){ - rnames<-c(rnames,names(ads[i]),"Per unit increase") + if (!is.factor(dat2[,i])){ + rnames<-c(rnames,paste0(names(dat2)[i],".all"),names(dat2)[i]) } } res<-cbind(amean_ci,apv)