This commit is contained in:
agdamsbo 2019-11-13 12:08:32 +01:00
parent 7652320065
commit bcdfb5e229
3 changed files with 10 additions and 4 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.9031 Version: 0.1.0.9032
Author: c(person("Andreas", "Gammelgaard Damsbo", email = "agdamsbo@pm.me", role = c("cre", "aut"))) Author: 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

@ -1,6 +1,9 @@
#' Regression model of predictors according to STROBE, bi- and multivariate. #' Regression model of predictors according to STROBE, bi- and multivariate.
#' #'
#' Printable table of regression model according to STROBE. Includes borth bivariate and multivariate in the same table. Output is a list, with the first item being the main "output" as a dataframe. Automatically uses logistic regression model for dichotomous outcome variable and linear regression model for continous outcome variable. Linear regression will give estimated adjusted true mean in list. #' Printable table of regression model according to STROBE for linear or binary outcome-variables.
#' Includes borth bivariate and multivariate in the same table.
#' Output is a list, with the first item being the main "output" as a dataframe.
#' Automatically uses logistic regression model for dichotomous outcome variable and linear regression model for continous outcome variable. Linear regression will give estimated adjusted true mean in list.
#' @param meas binary outcome meassure variable, column name in data.frame as a string. Can be numeric or factor. Result is calculated accordingly. #' @param meas binary outcome meassure variable, column name in data.frame as a string. Can be numeric or factor. Result is calculated accordingly.
#' @param adj variables to adjust for, as string. #' @param adj variables to adjust for, as string.
#' @param data dataframe of data. #' @param data dataframe of data.
@ -152,7 +155,7 @@ strobe_pred<-function(meas,adj,data,dec=2,n.by.adj=FALSE,p.val=FALSE){
coll<-left_join(left_join(namt,numb,by="names"),rest,by="names") coll<-left_join(left_join(namt,numb,by="names"),rest,by="names")
header<-data.frame(matrix("Adjusted",ncol = ncol(coll)),stringsAsFactors = F) header<-data.frame(matrix(paste0("Chance of ",meas," is ",levels(m)[-1]),ncol = ncol(coll)),stringsAsFactors = F)
names(header)<-names(coll) names(header)<-names(coll)
df<-data.frame(rbind(header,coll),stringsAsFactors = F) df<-data.frame(rbind(header,coll),stringsAsFactors = F)

View File

@ -21,6 +21,9 @@ strobe_pred(meas, adj, data, dec = 2, n.by.adj = FALSE,
\item{p.val}{flag to include p-values in table, set to FALSE as standard.} \item{p.val}{flag to include p-values in table, set to FALSE as standard.}
} }
\description{ \description{
Printable table of regression model according to STROBE. Includes borth bivariate and multivariate in the same table. Output is a list, with the first item being the main "output" as a dataframe. Automatically uses logistic regression model for dichotomous outcome variable and linear regression model for continous outcome variable. Linear regression will give estimated adjusted true mean in list. Printable table of regression model according to STROBE for linear or binary outcome-variables.
Includes borth bivariate and multivariate in the same table.
Output is a list, with the first item being the main "output" as a dataframe.
Automatically uses logistic regression model for dichotomous outcome variable and linear regression model for continous outcome variable. Linear regression will give estimated adjusted true mean in list.
} }
\keyword{logistic} \keyword{logistic}