mirror of
https://github.com/agdamsbo/daDoctoR.git
synced 2024-11-25 05:01:54 +01:00
37 lines
1.1 KiB
R
37 lines
1.1 KiB
R
% Generated by roxygen2: do not edit by hand
|
|
% Please edit documentation in R/rep_glm.R
|
|
\name{rep_glm}
|
|
\alias{rep_glm}
|
|
\title{A repeated logistic regression function}
|
|
\usage{
|
|
rep_glm(meas, vars, string, ci = FALSE, data)
|
|
}
|
|
\arguments{
|
|
\item{meas}{Effect meassure. Input as c() of columnnames, use dput().}
|
|
|
|
\item{vars}{variables in model. Input as c() of columnnames, use dput().}
|
|
|
|
\item{string}{variables to test. Input as c() of columnnames, use dput().}
|
|
|
|
\item{ci}{flag to get results as OR with 95% confidence interval.}
|
|
|
|
\item{data}{data frame to pull variables from.}
|
|
}
|
|
\description{
|
|
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{
|
|
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}
|