# HW 07: Bivariate Modeling

# Purpose

We’ve been visually exploring relationships between two variables by creating appropriate plots to assess how the distribution of a primary outcome (response/dependent) variable changes according to the level of a predictor (explanatory/independent/covariate) variable. We can learn a lot by conducting exploratory data analysis, and if description is the goal then this is where your work can stop.

However, if you want to make conclusions or **inference** about a relationship, then formal statistical analysis techniques are needed. We start here by formally testing if relationships or associations between *two* measures exist, then later will see how additional third variables can potentially disrupt or enhance any association that you may find.

# Submission instructions

- Use the QMD template answer the questions.
- This is a big assignment, so it will be broken into two stages.
- First draft will be on analyses 1-2, to make sure you are making correct progress.
- The final version will Second draft will be on analyses 3-4.
- upload
**PDFs**of your work to the assignment in Canvas

Before you upload your final version check for comments on your prior analyses and make any suggested/recommended adjustments.

# Instructions

In this assignment you will practice **FOUR(4)** different types of bivariate analysis:

- (Q~B) Quantitative Outcome ~ Binary Categorical Explanatory == Two-sample t-tests for a difference in means
- (Q~C) Quantitative Outcome ~ Categorical Explanatory == ANOVA
- (B~C) Binary Outcome ~ Categorical (or Binary) Explanatory == \(\chi^{2}\) test of Association.
- (Q~Q) Quantitative Outcome ~ Quantitative Explanatory == Linear regression analysis

For each analysis you will do the following steps:

State which variable (including the variable name from your codebook) will be your explanatory variable and which will be your response variable.

- Remember, you have some variables in your codebook that can act as both categorical and quantitative.
- Decide which of those variables makes sense to “explain” the other. Don’t just blindly pick a bunch of variables.
- Think about the relationship among your variables, keeping in mind your original research questions. You may use gender as your categorical explanatory variable if you are struggling to find an explanatory and response relationship that makes sense.

Create an appropriate bivariate plot to visualize the relationship you are exploring. Calculate appropriate summary statistics. Summarize the relationship between the explanatory and outcome variables in short paragraph form.

Write the relationship you want to examine in the form of a research question.

- State the null and alternative hypotheses as sentences.

Perform an appropriate statistical analysis using the full

**four step**method as outlined in class and described below.**a.**Define the parameters being tested. (\(\rho\), \(p_{1}\), \(\mu_{1}\), \(\beta_{1}\) etc)**b.**Translate the null and alternative hypotheses into \(H_{0}\) and \(H_{A}\) with symbols.**c.**State and verify assumptions of the test. Even if these assumptions are potentially violated, for the purposes of this assignment, acknowledge this limitation and continue with the prescribed analysis. (If a non-parametric test is appropriate, state it here.)**d.**Conduct the analysis using your software program of choice. Make a decision whether or not to reject the null hypothesis and state your justification.

Write a conclusion in context of the problem that includes a point estimate, confidence interval, and p-value.