Till now, you have been exploring and understanding datasets. After EDA, the analysis phase is undertaken wherein you need to look carefully at associations between the outcome and exposure variables, in other words, independent and dependent variables. There can be two variables wherein you are interested in associations such as independent sample t-tests for difference between means, or a Chi-square test, or paired test, etc depending on the variables and Research Questions.
In this session, we shall take you through some commonly used tests and their presentation tables including basics of regression models.
1.2 Inferential statistics: An overview
1.2.1 Is birth weight associated with Maternal factors?
For this question, the summary statistics should be split by birth weight categories, which can be done by using the by= argument. To compare two or more groups, include add_p() with the function call, which detects variable type and uses an appropriate statistical test.
Caution
The tbl_summary() provides outputs and inferential statistics according to computed distribution. It is important to consider which test to apply and when.. discuss!!
2 Welch Two Sample t-test; Fisher’s exact test; Pearson’s Chi-squared test
1.3 Correlation matrices
Example. As a researcher, you might be interested in knowing the correlation between maternal weight, number of preterm births, number of health visits and child birth weight.
The tbl_regression() function takes a regression model object in R and returns a formatted table of regression model results that is publication-ready. It is a simple way to summarize and present your analysis results using R! Like tbl_summary(), tbl_regression() creates highly customizable analytic tables with sensible defaults.
Code
# build logistic regression modelm1 <-glm(child_weight_cat ~ maternal_age + smoke_cat, data = df, family = binomial)# view raw model resultssummary(m1)$coefficients
In this section, we have introduced you to creating presentable tables for inferential statistics, correlation, and regression tables. Considering time, we are not dwelling deep into which test to apply and when concept. Rather we have focused on how to do them. It is strongly recommended to use these powerful tools in consultation with a Statistician/ Epidemiologist for meaningful inferences and robust methodologies. Hope you had an enjoyable learning during the sessions and we could answer your queries and show you additional resources during the workshop. Be in touch…Happy Learning!