This commit is contained in:
agdamsbo 2018-10-11 10:51:48 +02:00
parent b01fe47873
commit ed49de3b8d
3 changed files with 5 additions and 4 deletions

View File

@ -1,7 +1,7 @@
Package: daDoctoR
Type: Package
Title: FUNCTIONS FOR HEALTH RESEARCH
Version: 0.1.0.9001
Version: 0.1.0.9002
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

@ -30,7 +30,7 @@ rep_lm<-function(meas,vars,string,ci=FALSE,data){
if (ci==TRUE){
df<-data.frame(matrix(NA,ncol = 3))
names(df)<-c("pred","or_ci","pv")
names(df)<-c("pred","coef_ci","pv")
for(i in 1:ncol(x)){
dat<-cbind(dt,x[,i])
@ -40,7 +40,7 @@ rep_lm<-function(meas,vars,string,ci=FALSE,data){
l<-round(ci[-c(1:m1),1],2)
u<-round(ci[-c(1:m1),2],2)
or<-round(coef(m)[-c(1:m1)],2)
or_ci<-paste0(or," (",l," to ",u,")")
coef_ci<-paste0(or," (",l," to ",u,")")
pv<-round(tidy(m)$p.value[-c(1:m1)],3)
x1<-x[,i]
@ -49,7 +49,7 @@ rep_lm<-function(meas,vars,string,ci=FALSE,data){
else {pred<-names(x)[i]}
df<-rbind(df,cbind(pred,or_ci,pv))}}
df<-rbind(df,cbind(pred,coef_ci,pv))}}
else {

View File

@ -64,6 +64,7 @@ strobe_diff_twodim<-function(meas,group,adj,data,dec=2){
}
if(is.factor(m)){
di<-dat
mod<-glm(m~g,family=binomial(),data=di)
ci<-confint(mod)