From 5505baae5a812954819a9de7f21f00c216531b99 Mon Sep 17 00:00:00 2001 From: agdamsbo Date: Thu, 4 Oct 2018 10:35:05 +0200 Subject: [PATCH] adding example data --- R/rep_glm.R | 11 ++++++++++- man/rep_glm.Rd | 10 +++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/R/rep_glm.R b/R/rep_glm.R index 1cd5225..850a27d 100644 --- a/R/rep_glm.R +++ b/R/rep_glm.R @@ -9,7 +9,15 @@ #' @keywords logistic regression #' @export #' @examples -#' rep_glm() +#' l<-5 +#' y<-factor(rep(c("a","b"),l)) +#' x<-rnorm(length(y), mean=50, sd=10) +#' v1<-factor(rep(c("r","s"),length(y)/2)) +#' v2<-sample(1:100, length(y), replace=FALSE) +#' v3<-as.numeric(1:length(y)) +#' d<-data.frame(y,x,v1,v2,v3) +#' preds<-dput(names(d)[3:ncol(d)]) +#' rep_glm(meas="y",vars="x",string=preds,ci=FALSE,data=df) rep_glm<-function(meas,vars,string,ci=FALSE,data){ ## x is data.frame of predictors, y is vector of an aoutcome as a factor @@ -88,3 +96,4 @@ rep_glm<-function(meas,vars,string,ci=FALSE,data){ return(r) } + diff --git a/man/rep_glm.Rd b/man/rep_glm.Rd index aacf28d..e4832ed 100644 --- a/man/rep_glm.Rd +++ b/man/rep_glm.Rd @@ -21,7 +21,15 @@ rep_glm(meas, vars, string, ci = FALSE, data) For bivariate analyses. The confint() function is rather slow, causing the whole function to hang when including many predictors and calculating the ORs with CI. } \examples{ -rep_glm() +l<-5 +y<-factor(rep(c("a","b"),l)) +x<-rnorm(length(y), mean=50, sd=10) +v1<-factor(rep(c("r","s"),length(y)/2)) +v2<-sample(1:100, length(y), replace=FALSE) +v3<-as.numeric(1:length(y)) +d<-data.frame(y,x,v1,v2,v3) +preds<-dput(names(d)[3:ncol(d)]) +rep_glm(meas="y",vars="x",string=preds,ci=FALSE,data=df) } \keyword{logistic} \keyword{regression}