Regression Models & Hypothesis Testing
- 49Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
What is regression analysis?
49 questions
- 1
What is regression analysis?
Model answer
Regression analysis is a group of statistical techniques that use existing data to estimate the relationship between a single dependent variable and one or more independent variables.
Explanation
This definition is explicitly given in the content, establishing the core concept of regression models.
- 2
What is the difference between a dependent variable and an independent variable?
Model answer
The dependent variable (Y) is the variable a model estimates, also called the response or outcome variable. Independent variables (X) are the variables whose trends are associated with the dependent variable, also called explanatory or predictor variables.
Explanation
The content clarifies these terms with examples (e.g., cake sales and coffee purchases).
- 3
Define slope and intercept in the context of linear regression.
Model answer
The slope is the expected change in the dependent variable Y per one-unit increase in the independent variable X. The intercept is the value of Y when X equals zero.
Explanation
These definitions are provided with the cake shop example: slope = slices per cup, intercept = slices when zero coffee sold.
- 4
What is the difference between positive and negative correlation?
Model answer
Positive correlation means two variables tend to increase or decrease together. Negative correlation means one variable increases while the other decreases (inverse relationship).
Explanation
Examples: coffee and cake sales (positive), hot coffee and iced coffee sales (negative).
- 5
Why is it important to remember that correlation does not imply causation?
Model answer
Correlation does not mean one variable causes the other to change. Proving causation requires more rigorous methods and data collection. Data professionals must be careful not to overstate claims when presenting results.
Explanation
The content stresses this ethical point with examples like age and travel.
- 6
What are the four stages of the PACE framework?
Model answer
Plan, Analyze, Construct, Execute.
Explanation
PACE is introduced as the guiding framework for regression analysis in this course.
- 7
What is the purpose of the Plan stage in regression analysis?
Model answer
To understand the data in the problem context, consider data collection methods and business needs, so that the other stages can be strategically executed.
Explanation
The plan stage involves gathering knowledge and defining the problem before analysis.
- 8
What activities occur in the Analyze stage of PACE for regression?
Model answer
Examine data closely via EDA to choose appropriate models and check model assumptions.
Explanation
Assumptions must be verified to justify the use of particular techniques.
- 9
What happens during the Construct stage of regression modeling?
Model answer
Build the model in Python or another language: select variables, transform data, write code, recheck assumptions, and evaluate model results.
Explanation
The construct phase includes both building and refining the model.
- 10
What is the goal of the Execute stage in PACE?
Model answer
Interpret results, prepare formal results and visualizations, and share the data story with stakeholders.
Explanation
The execute phase focuses on communication and actionable insights.
- 11
What is a residual in linear regression?
Model answer
A residual is the difference between an observed value (actual data) and the predicted value from the model: residual = observed – predicted.
Explanation
Each data point has one residual, and the sum of residuals is zero for OLS.
- 12
What is the sum of squared residuals (SSR)?
Model answer
The sum of the squared differences between each observed value and its associated predicted value.
Explanation
SSR is a measure of total error that OLS minimizes.
- 13
How does ordinary least squares (OLS) choose the best-fit line?
Model answer
OLS minimizes the sum of squared residuals to estimate the regression coefficients (slope and intercept).
Explanation
OLS finds the line that best fits the data by reducing error.
- 14
What are the four key assumptions of simple linear regression?
Model answer
Linearity, normality of residuals, independent observations, and homoscedasticity.
Explanation
These assumptions must be met for the model to be valid.
- 15
How is the linearity assumption checked in simple linear regression?
Model answer
By examining a scatter plot of the dependent variable against the independent variable; points should appear to fall along a straight line.
Explanation
If the plot shows a curve or random cloud, the assumption is violated.
- 16
What plot is used to check the normality assumption in linear regression?
Model answer
A Q-Q plot (quantile-quantile plot) of the residuals; points should form a straight diagonal line.
Explanation
Normality is checked after model construction because it involves residuals.
- 17
What does the homoscedasticity assumption mean?
Model answer
The variance of the residuals should be constant across all values of the dependent variable. A scatter plot of fitted values vs. residuals should show no clear pattern (random cloud).
Explanation
Heteroscedasticity (e.g., cone-shaped pattern) violates the assumption.
- 18
What is R-squared and what does it measure?
Model answer
R-squared, or the coefficient of determination, measures the proportion of variation in the dependent variable Y that is explained by the independent variable(s) X.
Explanation
R-squared ranges from 0 to 1; higher values indicate more variance explained.
- 19
How is R-squared interpreted in the penguin example?
Model answer
With R-squared = 0.769, bill length explains about 77% of the variance in body mass; 23% remains unexplained.
Explanation
This example from the content shows practical interpretation.
- 20
What is a holdout sample and why is it used?
Model answer
A holdout sample is a random subset of data not used to fit the model. It is used to evaluate how well the model performs on unseen data.
Explanation
Holdout samples help assess generalizability and prevent overfitting.
- 21
What does the P-value for a regression coefficient test?
Model answer
It tests the null hypothesis that the coefficient is zero. A small P-value indicates the coefficient is statistically significant, meaning there is a strong relationship between the independent variable and the dependent variable.
Explanation
P-values are used to determine if the observed relationship is likely not due to chance.
- 22
What is a confidence band in linear regression?
Model answer
A confidence band is the area surrounding the regression line that describes the uncertainty around predicted outcomes at every value of X, typically shown as a shaded region.
Explanation
Confidence bands are based on confidence intervals for the coefficients.
- 23
What is multiple linear regression?
Model answer
Multiple linear regression estimates the linear relationship between one continuous dependent variable and two or more independent variables.
Explanation
It extends simple linear regression by allowing multiple X variables.
- 24
What is one-hot encoding and why is it used in multiple regression?
Model answer
One-hot encoding is a data transformation that turns a categorical variable into several binary (0/1) variables. It allows categorical independent variables to be used in regression models.
Explanation
Example: ad platform (A, B, C) becomes two binary variables, with the third category as the baseline.
- 25
What is an interaction term in multiple regression?
Model answer
An interaction term represents how the relationship between two independent variables is associated with changes in the mean of the dependent variable. It is typically the product of the two variables.
Explanation
Interaction terms allow the effect of one X to depend on another X.
- 26
What is the no multicollinearity assumption?
Model answer
No two independent variables should be highly correlated with each other. Multicollinearity makes it difficult to determine the individual effect of each variable.
Explanation
This assumption is specific to multiple regression, not simple linear regression.
- 27
What is VIF and how is it used?
Model answer
VIF (Variance Inflation Factor) quantifies how correlated each independent variable is with all other independent variables. A high VIF indicates multicollinearity.
Explanation
VIF can help decide which variables to drop or combine.
- 28
What is overfitting in regression?
Model answer
Overfitting occurs when a model fits the training data too specifically and fails to generalize to new data. It often happens when the model is too complex or includes too many variables.
Explanation
Overfitting leads to poor predictions on unseen data.
- 29
How does adjusted R-squared differ from R-squared?
Model answer
Adjusted R-squared penalizes unnecessary explanatory variables, so it does not automatically increase when adding variables. It is used to compare models of varying complexity.
Explanation
R-squared always increases with more variables, while adjusted R-squared may decrease if the variable adds little value.
- 30
What is forward selection in variable selection?
Model answer
Forward selection begins with a null model (no independent variables) and adds the variable that contributes the most explanatory power one at a time until no more variables can be added based on a chosen metric.
Explanation
It is a stepwise method to choose a subset of variables.
- 31
What is backward elimination in variable selection?
Model answer
Backward elimination starts with the full model (all possible independent variables) and removes the variable that adds the least explanatory power one at a time until no more variables can be removed.
Explanation
It works opposite to forward selection.
- 32
What is the bias-variance tradeoff?
Model answer
It balances two model qualities: bias (simplifying assumptions that may underfit) and variance (flexibility that may overfit). The goal is to minimize total error for unseen data.
Explanation
High bias underfits, high variance overfits.
- 33
Name three regularization techniques and their key difference.
Model answer
Lasso regression (removes unimportant variables by shrinking coefficients to zero), ridge regression (minimizes impact of less relevant variables but does not remove them), and elastic-net regression (combines lasso and ridge).
Explanation
Regularization adds bias to reduce variance and prevent overfitting.
- 34
What is the logit (log-odds) function?
Model answer
The logit of probability P is lnleft(rac{P}{1-P} ight), the natural logarithm of the odds.
Explanation
Logit is the link function that linearly relates the independent variables to the probability in logistic regression.
- 35
What assumption about linearity is made in binomial logistic regression?
Model answer
There should be a linear relationship between each independent variable X and the logit of the probability that Y=1.
Explanation
Unlike linear regression, the linearity assumption is on the logit scale.
- 36
What is maximum likelihood estimation (MLE) in logistic regression?
Model answer
MLE is a technique that estimates beta parameters to maximize the likelihood of observing the sample data given the model.
Explanation
MLE is the counterpart of OLS in linear regression.
- 37
What is a confusion matrix?
Model answer
A confusion matrix is a table that shows true positives, true negatives, false positives, and false negatives for a classifier's predictions.
Explanation
It provides a quick overview of classification accuracy.
- 38
Define precision, recall, and accuracy in the context of logistic regression.
Model answer
Precision = true positives / (true positives + false positives). Recall = true positives / (true positives + false negatives). Accuracy = (true positives + true negatives) / total predictions.
Explanation
These metrics summarize confusion matrix results.
- 39
How is the coefficient in logistic regression interpreted after exponentiating?
Model answer
Exponentiating the coefficient (e^{eta}) gives the multiplicative change in odds for a one-unit increase in the independent variable. For example, e−0.118=0.89 means a one-unit increase in vertical acceleration reduces the odds of lying down by 11%.
Explanation
Coefficients represent change in log-odds; exponentiating converts to odds ratios.
- 40
What is the chi-squared goodness-of-fit test?
Model answer
It determines whether an observed categorical variable follows an expected distribution. The null hypothesis is that the variable follows the expected distribution.
Explanation
Example: popcorn size sales compared to expected 25% each.
- 41
What is the chi-squared test of independence?
Model answer
It determines whether two categorical variables are associated. The null hypothesis is that they are independent.
Explanation
Example: weather (rain/no rain) and popcorn sales (high/low).
- 42
Write the formula for the chi-squared statistic.
Model answer
chi^2 = sum rac{(O_i - E_i)^2}{E_i}, where Oi is observed count and Ei is expected count.
Explanation
This formula is used for both goodness-of-fit and test of independence.
- 43
What is one-way ANOVA?
Model answer
One-way ANOVA compares the means of one continuous dependent variable across three or more groups defined by one categorical independent variable.
Explanation
ANOVA tests whether group means are all equal.
- 44
What is the null hypothesis in a one-way ANOVA?
Model answer
The means of the dependent variable are equal across all groups.
Explanation
Rejecting the null means at least one group mean is different.
- 45
What is two-way ANOVA?
Model answer
Two-way ANOVA compares the means of one continuous dependent variable based on two categorical independent variables, including possible interaction effects.
Explanation
It extends one-way ANOVA by adding a second factor.
- 46
What is the purpose of a post hoc test like Tukey's HSD after ANOVA?
Model answer
It performs pairwise comparisons between all groups while controlling the error rate, identifying which specific groups differ from each other.
Explanation
ANOVA only tells if at least one group differs; post hoc tests specify which ones.
- 47
What is ANCOVA?
Model answer
ANCOVA (analysis of covariance) tests differences in means among groups while controlling for the effect of covariates (continuous variables not of primary interest).
Explanation
It isolates the effect of the categorical variable by accounting for other influences.
- 48
What is MANOVA?
Model answer
MANOVA (multivariate analysis of variance) compares two or more continuous dependent variables across groups defined by categorical independent variables.
Explanation
It extends ANOVA to multiple outcome variables.
- 49
What is MANCOVA?
Model answer
MANCOVA (multivariate analysis of covariance) extends ANCOVA to multiple dependent variables while controlling for covariates.
Explanation
It combines MANOVA and ANCOVA.

Ask anything
We've read this whole study set, so questions about it get the best answers.