daDoctoR/R/rep_biv.R

30 lines
834 B
R
Raw Normal View History

2018-10-02 21:19:32 +02:00
#' A repeated function for bivariate analyses
2018-10-02 21:07:43 +02:00
#'
#' For bivariate analyses, for gating by p-value or change-in-estimate.
#' @param y Effect meassure.
#' @param v1 Main variable in model
2018-10-02 21:19:32 +02:00
#' @param string String of columnnames to include. Obtained with dput(). Input as c().
#' @param data dataframe of data to analyse
2018-10-02 21:07:43 +02:00
#' @keywords logistic regression
#' @export
#' @examples
#' rep_biv()
rep_biv<-function(y,v1,string,data,method="pval",logistic=FALSE,ci=FALSE,cut=0.1,v2=NULL,v3=NULL){
require(rep_lm)
require(rep_glm)
require(cie_test)
2018-10-02 21:19:32 +02:00
2018-10-02 21:07:43 +02:00
if (method=="pval"&logistic==FALSE){
rep_lm(y=y,v1=v1,string=string,data=data,ci=ci)
}
if (method=="pval"&logistic==TRUE){
rep_lm(y=y,v1=v1,string=string,data=data,ci=ci)
}
if (method=="cie"){
cie_test(y=y,v1=v1,string=string,data=data,logistic=logistic,cut=cut,v2=v2,v3=v3)
}
return(df)
}