Description Usage Arguments Details Examples
View source: R/Table1_functions.R
A function to create a summary of a linear regression model.
1 | fx_model_linear(y, x, data)
|
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. |
Table with estimates, CIs and p-values.
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_linear('Sepal.Length',c('Species','Petal.Length'),iris)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.