fx_model_logistic: A function to create a summary of a logistic regression...

Description Usage Arguments Details Examples

View source: R/Table1_functions.R

Description

A function to create a summary of a logistic regression model.

Usage

1

Arguments

y

outcome variable of interest to be pasted in formula, in quotation marks.

x

a single explanatory variable, or multiple variables separated by +, in quotation marks.

data

a data frame containing the variables listed in x and y.

Details

Table with estimates, CIs and p-values.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
iris$sepal_di<-as.factor((iris$Sepal.Length<5)*1)
#set factor levels
levels(iris$sepal_di)=c("<5",'>=5')
levels(iris$Species)=c('Setosa','Versicolor','Virginica')
#Set Labels
label(iris$Species)='Species'
label(iris$sepal_di)='Sepal Length'
label(iris$Sepal.Length)="Sepal Length"
label(iris$Sepal.Width)='Sepal Width'
label(iris$Petal.Length)='Petal Length'
label(iris$Petal.Width)='Petal Width'
mod_tab<-fx_model_logistic('sepal_di',c('Petal.Length','Petal.Width'),iris)

palmercl/Table1 documentation built on May 14, 2019, 8:55 a.m.