knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
library(rotsurpackage)
This vignette is an introduction to the rotsurpackage. This package is used with the main goal of conducting a multiple logistic regression. The package includes each step of a typical data analysis, including: assessing data distribution of continuous variables, summarizing data using descriptive statistics and uni-variate tests, conducting a forward step-wise section of predictors, and performing the multiple logistic regression and outputting results.
The functions in this package are flexible to be used with other types of data-sets.
For this vignette the examples will be using the glow.data a publicly available data set.
download_data(urlfile=)
This functions allows us to read in a public data set file from website. In this example, the URL file is where the user would add the github repository link where the CSV file of the data-set is located. It would return a tibble with variable names, type, and observations.
download_data(urlfile='https://raw.githubusercontent.com/RotanaRad/rotsurpackage/main/GLOW.csv')
To continue using the data set for the rest of this example. We will create a path for it here.
# glow.data<-download_data(urlfile='https://raw.githubusercontent.com/RotanaRad/rotsurpackage/main/GLOW.csv')
assess_normality (x, ...)
This function creates a customized histogram figure. The x is a vector of values for which the histogram is desired. While the break, otherwise presented as "...", could be one of the following as the user desires: -a vector giving the breakpoints between histogram cells, -a function to compute the vector of breakpoints, -a single number giving the number of cells for the histogram, -a character string naming an algorithm to compute the number of cells, -a function to compute the number of cells.
assess_normality (glow.data$HEIGHT, xlab = "Height", main = "Assessing height's data distribution")
create_journaltable(data,y)
This function creates a customized summary table with journal article aesthetics The data is where the user specifies the data frame of interest. The y would be to specify a categorical variable name in the data. The summary statistic of this categorical variable will be calculated separately for each level of the variable.The output will include an image of summary table with journal article aesthetic for all variables in data-set.
create_journaltable(data=glow.data,y = 'FRACTURE')
stepwise_selection(data, formula)
The function will select predictors that lead to the best fit model using forward selection methods. Predictors will enter the model at a significance level of 0.05. The data is where users would specify the data frame of interest. The formula would be where users would specify dependent and independent variables for glm formula (e.g., y\~(x1+x2+x3)). Running the function would return a list of candidate variables, list of added variables, and a step-wise summary table that shows changes in AIC.
stepwise_selection(glow.data, FRACTURE ~ PRIORFRAC+ AGE + HEIGHT + MOMFRAC + ARMASSIST+ FRACSCORE)
summary_finalmodel(data, formula)
The function create a summary table with results of a glm model. The data is where users would specify the data frame of interest. The formula is where the user would specify the dependent and independent variables for glm formula. In other words, it is an object of class "formula" which is a symbolic description of the model to be fitted. Once the function is run, it would return a summary of the glm results.
summary_finalmodel(glow.data,(substitute(FRACTURE ~ HEIGHT + factor(MOMFRAC) + factor(PRIORFRAC) + FRACSCORE)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.