\documentclass[11pt]{article}
\usepackage{mathnotes}
\discipline{UCLA-ALIGNED COURSE FIELD NOTES}
\course{STATS 100C}{Linear Models}{Matrix regression, projection, general hypotheses, diagnostics, selection, and principal-component regression}

\begin{document}
\makemathcover
\coursefrontmatter{
\begin{curriculumtable}
\unitline{1}{The linear model in matrix form}{Reconstruct the model, work an application, test its assumptions, and explain the result in ordinary language.}
\unitline{2}{Least squares as orthogonal projection}{Reconstruct the model, work an application, test its assumptions, and explain the result in ordinary language.}
\unitline{3}{Distribution theory and Gauss-Markov}{Reconstruct the model, work an application, test its assumptions, and explain the result in ordinary language.}
\unitline{4}{General linear hypotheses and extra sums of squares}{Reconstruct the model, work an application, test its assumptions, and explain the result in ordinary language.}
\unitline{5}{Residuals, leverage, and influence}{Reconstruct the model, work an application, test its assumptions, and explain the result in ordinary language.}
\unitline{6}{Categorical predictors, interactions, and polynomial structure}{Reconstruct the model, work an application, test its assumptions, and explain the result in ordinary language.}
\unitline{7}{Model selection and validation}{Reconstruct the model, work an application, test its assumptions, and explain the result in ordinary language.}
\unitline{8}{Principal-component regression and stabilized fitting}{Reconstruct the model, work an application, test its assumptions, and explain the result in ordinary language.}
\unitline{9}{Integration studio}{Combine several chapters in one case, preserve their assumptions, and reconcile the result across representations.}
\unitline{10}{Cumulative review}{Retrieve the full course map from memory and solve mixed problems without chapter labels.}
\end{curriculumtable}
}{\curriculumsource{https://catalog.registrar.ucla.edu/course/2024/stats100c}}

\section{The linear model in matrix form}

\begin{idea}
The model y=X beta plus error describes a mean vector in the column space of X. Rank, identifiability, estimability, coding, and the geometry of projection determine what coefficients can be learned.
\end{idea}
% MASTERCLASS EXPANSION
\subsection{Rebuild the chapter from first principles}
The claim I need to own is this: The model y=X beta plus error describes a mean vector in the column space of X. Rank, identifiability, estimability, coding, and the geometry of projection determine what coefficients can be learned. I do not count that as learned just because the sentence looks familiar. I should be able to name the objects, state what changes and what stays fixed, recover the rule from the definitions, and explain why the result is allowed.

\begin{move}
\textbf{My working sequence}
\begin{enumerate}
  \item \textbf{Translate.} Rewrite the prompt in the language of the linear model in matrix form. List the known quantities, the unknown, the units or types, and any hidden constraint.
  \item \textbf{Choose.} State the theorem, model, algorithm, accounting rule, or physical law before substituting values. This is where I make the assumption visible.
  \item \textbf{Execute.} Work one justified step at a time and keep intermediate state readable enough that I can audit it later.
  \item \textbf{Verify.} Check a boundary case, sign, unit, invariant, order of magnitude, or alternative derivation. Then translate the result back into an ordinary sentence.
\end{enumerate}
\end{move}

\subsection{Details I would refuse to skip}
\begin{itemize}
  \item \textbf{Definitions:} I should be able to define every technical noun in the chapter without using that same noun in the definition.
  \item \textbf{Assumptions:} I write the condition that makes the method legal beside the method itself. A correct procedure under the wrong assumptions is still a wrong answer.
  \item \textbf{Representation:} I move freely among words, equations or code, a diagram, and a small numerical example. If one representation disagrees with another, that disagreement is useful evidence.
  \item \textbf{Failure modes:} I keep the nearest counterexample in mind: the boundary where the rule changes, the invariant breaks, or the model stops matching reality.
  \item \textbf{Communication:} My final answer names what the result means and what it does not establish. I do not let notation do the explanatory work for me.
\end{itemize}

\begin{sanitybox}
\textbf{Closed-note check.} Can I teach the linear model in matrix form on a blank page, derive or reconstruct its main rule, work a fresh example, and diagnose a deliberately broken solution? If I can only recognize the finished work, I am not done.
\end{sanitybox}

\subsection{How this chapter connects}
I read this chapter as the bridge from the course foundations to least squares as orthogonal projection. The earlier material supplies the language and constraints; this chapter adds a new reasoning move; the later material asks me to use that move without being told its name. That connection matters because exams and real projects mix chapters on purpose.


\subsection{The full working model}
\begin{itemize}
  \item \textbf{Core claim.} The model y=X beta plus error describes a mean vector in the column space of X.
  \item \textbf{What moves.} Rank, identifiability, estimability, coding, and the geometry of projection determine what coefficients can be learned.
  \item \textbf{What keeps the answer honest.} The model becomes useful only when I can apply the linear model in matrix form to an unfamiliar case and defend the assumptions.
  \item \textbf{Mastery standard.} I can define the objects, rebuild the rule, work a fresh case, compare alternatives, and diagnose a broken solution without relying on recognition.
\end{itemize}

\begin{studenttake}
I check the design matrix before interpreting coefficients; the model is hiding there in plain sight.
\end{studenttake}

\begin{plainbox}
The model y=X beta plus error describes a mean vector in the column space of X.
\end{plainbox}

\begin{examplebox}
\textbf{Question.} What fails if one column of X is an exact linear combination of others?

\textbf{Walkthrough.} X lacks full column rank, beta is not uniquely identified, and X-transpose-X is singular. Reparameterize or remove redundant columns.
\end{examplebox}

\begin{warningbox}
The fastest way to get this chapter wrong is to use the visible procedure without naming its assumption, units, time period, reference group, or boundary. I put that condition beside the work and verify the result independently.
\end{warningbox}

\begin{chapterpractice}
\textbf{Practice 1.} What fails if one column of X is an exact linear combination of others?

\textbf{Solution.} X lacks full column rank, beta is not uniquely identified, and X-transpose-X is singular. Reparameterize or remove redundant columns.

\medskip
\textbf{Practice 2.} Explain the linear model in matrix form to a classmate using one definition, one concrete example, one assumption, and one failure mode.

\textbf{Solution.} Begin with the core claim above, use the worked case as the concrete example, state the condition highlighted by the warning, and choose a failure where that condition does not hold. A complete explanation connects all four pieces instead of listing them.

\medskip
\textbf{Mastery practice A.} Reconstruct the linear model in matrix form from a blank page. Include the central definition, the governing rule, one required assumption, and one boundary case.

\textbf{Solution.} Start from the blue idea box, but rewrite it in my own words. Identify the objects and state, name the rule before using it, copy the relevant assumption from the details audit, and choose a boundary where that assumption becomes equality or fails. A complete solution explains why each part belongs; a list of vocabulary is not enough.

\medskip
\textbf{Mastery practice B.} A classmate gets a polished-looking answer to a the linear model in matrix form problem but never states a model or checks the result. Write the shortest useful review of that solution.

\textbf{Solution.} I would ask four concrete questions: What exactly are the inputs and desired output? Which rule licenses the main step? Which assumption could invalidate it? Which independent check supports the conclusion? If the answer cannot survive those four questions, I treat the numerical or verbal result as unverified.

\end{chapterpractice}

\section{Least squares as orthogonal projection}

\begin{idea}
OLS projects y onto the column space of X. Normal equations make residuals orthogonal to every regressor; hat and residual-maker matrices describe fitted values, leverage, and decomposition.
\end{idea}
% MASTERCLASS EXPANSION
\subsection{Rebuild the chapter from first principles}
The claim I need to own is this: OLS projects y onto the column space of X. Normal equations make residuals orthogonal to every regressor; hat and residual-maker matrices describe fitted values, leverage, and decomposition. I do not count that as learned just because the sentence looks familiar. I should be able to name the objects, state what changes and what stays fixed, recover the rule from the definitions, and explain why the result is allowed.

\begin{move}
\textbf{My working sequence}
\begin{enumerate}
  \item \textbf{Translate.} Rewrite the prompt in the language of least squares as orthogonal projection. List the known quantities, the unknown, the units or types, and any hidden constraint.
  \item \textbf{Choose.} State the theorem, model, algorithm, accounting rule, or physical law before substituting values. This is where I make the assumption visible.
  \item \textbf{Execute.} Work one justified step at a time and keep intermediate state readable enough that I can audit it later.
  \item \textbf{Verify.} Check a boundary case, sign, unit, invariant, order of magnitude, or alternative derivation. Then translate the result back into an ordinary sentence.
\end{enumerate}
\end{move}

\subsection{Details I would refuse to skip}
\begin{itemize}
  \item \textbf{Definitions:} I should be able to define every technical noun in the chapter without using that same noun in the definition.
  \item \textbf{Assumptions:} I write the condition that makes the method legal beside the method itself. A correct procedure under the wrong assumptions is still a wrong answer.
  \item \textbf{Representation:} I move freely among words, equations or code, a diagram, and a small numerical example. If one representation disagrees with another, that disagreement is useful evidence.
  \item \textbf{Failure modes:} I keep the nearest counterexample in mind: the boundary where the rule changes, the invariant breaks, or the model stops matching reality.
  \item \textbf{Communication:} My final answer names what the result means and what it does not establish. I do not let notation do the explanatory work for me.
\end{itemize}

\begin{sanitybox}
\textbf{Closed-note check.} Can I teach least squares as orthogonal projection on a blank page, derive or reconstruct its main rule, work a fresh example, and diagnose a deliberately broken solution? If I can only recognize the finished work, I am not done.
\end{sanitybox}

\subsection{How this chapter connects}
I read this chapter as the bridge from the linear model in matrix form to distribution theory and gauss-markov. The earlier material supplies the language and constraints; this chapter adds a new reasoning move; the later material asks me to use that move without being told its name. That connection matters because exams and real projects mix chapters on purpose.


\subsection{The full working model}
\begin{itemize}
  \item \textbf{Core claim.} OLS projects y onto the column space of X.
  \item \textbf{What moves.} Normal equations make residuals orthogonal to every regressor; hat and residual-maker matrices describe fitted values, leverage, and decomposition.
  \item \textbf{What keeps the answer honest.} The model becomes useful only when I can apply least squares as orthogonal projection to an unfamiliar case and defend the assumptions.
  \item \textbf{Mastery standard.} I can define the objects, rebuild the rule, work a fresh case, compare alternatives, and diagnose a broken solution without relying on recognition.
\end{itemize}

\begin{studenttake}
My shorthand for this chapter is: my shorthand for this chapter is: the geometry makes the algebra believable: fitted plus residual are perpendicular pieces of the same data vector.
\end{studenttake}

\begin{plainbox}
OLS projects y onto the column space of X.
\end{plainbox}

\begin{examplebox}
\textbf{Question.} State the normal equations.

\textbf{Walkthrough.} X-transpose times (y-X beta-hat)=0. Equivalently, X-transpose residual equals zero.
\end{examplebox}

\begin{warningbox}
The fastest way to get this chapter wrong is to use the visible procedure without naming its assumption, units, time period, reference group, or boundary. I put that condition beside the work and verify the result independently.
\end{warningbox}

\begin{chapterpractice}
\textbf{Practice 1.} State the normal equations.

\textbf{Solution.} X-transpose times (y-X beta-hat)=0. Equivalently, X-transpose residual equals zero.

\medskip
\textbf{Practice 2.} Explain least squares as orthogonal projection to a classmate using one definition, one concrete example, one assumption, and one failure mode.

\textbf{Solution.} Begin with the core claim above, use the worked case as the concrete example, state the condition highlighted by the warning, and choose a failure where that condition does not hold. A complete explanation connects all four pieces instead of listing them.

\medskip
\textbf{Mastery practice A.} Reconstruct least squares as orthogonal projection from a blank page. Include the central definition, the governing rule, one required assumption, and one boundary case.

\textbf{Solution.} Start from the blue idea box, but rewrite it in my own words. Identify the objects and state, name the rule before using it, copy the relevant assumption from the details audit, and choose a boundary where that assumption becomes equality or fails. A complete solution explains why each part belongs; a list of vocabulary is not enough.

\medskip
\textbf{Mastery practice B.} A classmate gets a polished-looking answer to a least squares as orthogonal projection problem but never states a model or checks the result. Write the shortest useful review of that solution.

\textbf{Solution.} I would ask four concrete questions: What exactly are the inputs and desired output? Which rule licenses the main step? Which assumption could invalidate it? Which independent check supports the conclusion? If the answer cannot survive those four questions, I treat the numerical or verbal result as unverified.

\end{chapterpractice}

\section{Distribution theory and Gauss-Markov}

\begin{idea}
Under zero-mean spherical errors OLS is best linear unbiased; normal errors add exact t and F distributions. Estimated variance, degrees of freedom, covariance of coefficients, and prediction uncertainty follow from projection geometry.
\end{idea}
% MASTERCLASS EXPANSION
\subsection{Rebuild the chapter from first principles}
The claim I need to own is this: Under zero-mean spherical errors OLS is best linear unbiased; normal errors add exact t and F distributions. Estimated variance, degrees of freedom, covariance of coefficients, and prediction uncertainty follow from projection geometry. I do not count that as learned just because the sentence looks familiar. I should be able to name the objects, state what changes and what stays fixed, recover the rule from the definitions, and explain why the result is allowed.

\begin{move}
\textbf{My working sequence}
\begin{enumerate}
  \item \textbf{Translate.} Rewrite the prompt in the language of distribution theory and gauss-markov. List the known quantities, the unknown, the units or types, and any hidden constraint.
  \item \textbf{Choose.} State the theorem, model, algorithm, accounting rule, or physical law before substituting values. This is where I make the assumption visible.
  \item \textbf{Execute.} Work one justified step at a time and keep intermediate state readable enough that I can audit it later.
  \item \textbf{Verify.} Check a boundary case, sign, unit, invariant, order of magnitude, or alternative derivation. Then translate the result back into an ordinary sentence.
\end{enumerate}
\end{move}

\subsection{Details I would refuse to skip}
\begin{itemize}
  \item \textbf{Definitions:} I should be able to define every technical noun in the chapter without using that same noun in the definition.
  \item \textbf{Assumptions:} I write the condition that makes the method legal beside the method itself. A correct procedure under the wrong assumptions is still a wrong answer.
  \item \textbf{Representation:} I move freely among words, equations or code, a diagram, and a small numerical example. If one representation disagrees with another, that disagreement is useful evidence.
  \item \textbf{Failure modes:} I keep the nearest counterexample in mind: the boundary where the rule changes, the invariant breaks, or the model stops matching reality.
  \item \textbf{Communication:} My final answer names what the result means and what it does not establish. I do not let notation do the explanatory work for me.
\end{itemize}

\begin{sanitybox}
\textbf{Closed-note check.} Can I teach distribution theory and gauss-markov on a blank page, derive or reconstruct its main rule, work a fresh example, and diagnose a deliberately broken solution? If I can only recognize the finished work, I am not done.
\end{sanitybox}

\subsection{How this chapter connects}
I read this chapter as the bridge from least squares as orthogonal projection to general linear hypotheses and extra sums of squares. The earlier material supplies the language and constraints; this chapter adds a new reasoning move; the later material asks me to use that move without being told its name. That connection matters because exams and real projects mix chapters on purpose.


\subsection{The full working model}
\begin{itemize}
  \item \textbf{Core claim.} Under zero-mean spherical errors OLS is best linear unbiased; normal errors add exact t and F distributions.
  \item \textbf{What moves.} Estimated variance, degrees of freedom, covariance of coefficients, and prediction uncertainty follow from projection geometry.
  \item \textbf{What keeps the answer honest.} The model becomes useful only when I can apply distribution theory and gauss-markov to an unfamiliar case and defend the assumptions.
  \item \textbf{Mastery standard.} I can define the objects, rebuild the rule, work a fresh case, compare alternatives, and diagnose a broken solution without relying on recognition.
\end{itemize}

\begin{studenttake}
My shorthand for this chapter is: my shorthand for this chapter is: bLUE is a precise conditional claim, not a slogan that OLS is always best.
\end{studenttake}

\begin{plainbox}
Under zero-mean spherical errors OLS is best linear unbiased; normal errors add exact t and F distributions.
\end{plainbox}

\begin{examplebox}
\textbf{Question.} What is Var(beta-hat) under homoskedastic independent errors?

\textbf{Walkthrough.} Sigma squared times (X-transpose-X) inverse, assuming full column rank.
\end{examplebox}

\begin{warningbox}
The fastest way to get this chapter wrong is to use the visible procedure without naming its assumption, units, time period, reference group, or boundary. I put that condition beside the work and verify the result independently.
\end{warningbox}

\begin{chapterpractice}
\textbf{Practice 1.} What is Var(beta-hat) under homoskedastic independent errors?

\textbf{Solution.} Sigma squared times (X-transpose-X) inverse, assuming full column rank.

\medskip
\textbf{Practice 2.} Explain distribution theory and gauss-markov to a classmate using one definition, one concrete example, one assumption, and one failure mode.

\textbf{Solution.} Begin with the core claim above, use the worked case as the concrete example, state the condition highlighted by the warning, and choose a failure where that condition does not hold. A complete explanation connects all four pieces instead of listing them.

\medskip
\textbf{Mastery practice A.} Reconstruct distribution theory and gauss-markov from a blank page. Include the central definition, the governing rule, one required assumption, and one boundary case.

\textbf{Solution.} Start from the blue idea box, but rewrite it in my own words. Identify the objects and state, name the rule before using it, copy the relevant assumption from the details audit, and choose a boundary where that assumption becomes equality or fails. A complete solution explains why each part belongs; a list of vocabulary is not enough.

\medskip
\textbf{Mastery practice B.} A classmate gets a polished-looking answer to a distribution theory and gauss-markov problem but never states a model or checks the result. Write the shortest useful review of that solution.

\textbf{Solution.} I would ask four concrete questions: What exactly are the inputs and desired output? Which rule licenses the main step? Which assumption could invalidate it? Which independent check supports the conclusion? If the answer cannot survive those four questions, I treat the numerical or verbal result as unverified.

\end{chapterpractice}

\section{General linear hypotheses and extra sums of squares}

\begin{idea}
A general hypothesis R beta=r can test one or many coefficient restrictions. Full and reduced models produce extra sums of squares; t, F, confidence regions, and partial tests are different views of the same comparison.
\end{idea}
% MASTERCLASS EXPANSION
\subsection{Rebuild the chapter from first principles}
The claim I need to own is this: A general hypothesis R beta=r can test one or many coefficient restrictions. Full and reduced models produce extra sums of squares; t, F, confidence regions, and partial tests are different views of the same comparison. I do not count that as learned just because the sentence looks familiar. I should be able to name the objects, state what changes and what stays fixed, recover the rule from the definitions, and explain why the result is allowed.

\begin{move}
\textbf{My working sequence}
\begin{enumerate}
  \item \textbf{Translate.} Rewrite the prompt in the language of general linear hypotheses and extra sums of squares. List the known quantities, the unknown, the units or types, and any hidden constraint.
  \item \textbf{Choose.} State the theorem, model, algorithm, accounting rule, or physical law before substituting values. This is where I make the assumption visible.
  \item \textbf{Execute.} Work one justified step at a time and keep intermediate state readable enough that I can audit it later.
  \item \textbf{Verify.} Check a boundary case, sign, unit, invariant, order of magnitude, or alternative derivation. Then translate the result back into an ordinary sentence.
\end{enumerate}
\end{move}

\subsection{Details I would refuse to skip}
\begin{itemize}
  \item \textbf{Definitions:} I should be able to define every technical noun in the chapter without using that same noun in the definition.
  \item \textbf{Assumptions:} I write the condition that makes the method legal beside the method itself. A correct procedure under the wrong assumptions is still a wrong answer.
  \item \textbf{Representation:} I move freely among words, equations or code, a diagram, and a small numerical example. If one representation disagrees with another, that disagreement is useful evidence.
  \item \textbf{Failure modes:} I keep the nearest counterexample in mind: the boundary where the rule changes, the invariant breaks, or the model stops matching reality.
  \item \textbf{Communication:} My final answer names what the result means and what it does not establish. I do not let notation do the explanatory work for me.
\end{itemize}

\begin{sanitybox}
\textbf{Closed-note check.} Can I teach general linear hypotheses and extra sums of squares on a blank page, derive or reconstruct its main rule, work a fresh example, and diagnose a deliberately broken solution? If I can only recognize the finished work, I am not done.
\end{sanitybox}

\subsection{How this chapter connects}
I read this chapter as the bridge from distribution theory and gauss-markov to residuals, leverage, and influence. The earlier material supplies the language and constraints; this chapter adds a new reasoning move; the later material asks me to use that move without being told its name. That connection matters because exams and real projects mix chapters on purpose.


\subsection{The full working model}
\begin{itemize}
  \item \textbf{Core claim.} A general hypothesis R beta=r can test one or many coefficient restrictions.
  \item \textbf{What moves.} Full and reduced models produce extra sums of squares; t, F, confidence regions, and partial tests are different views of the same comparison.
  \item \textbf{What keeps the answer honest.} The model becomes useful only when I can apply general linear hypotheses and extra sums of squares to an unfamiliar case and defend the assumptions.
  \item \textbf{Mastery standard.} I can define the objects, rebuild the rule, work a fresh case, compare alternatives, and diagnose a broken solution without relying on recognition.
\end{itemize}

\begin{studenttake}
I write the restriction matrix before fitting models so the test matches the scientific question.
\end{studenttake}

\begin{plainbox}
A general hypothesis R beta=r can test one or many coefficient restrictions.
\end{plainbox}

\begin{examplebox}
\textbf{Question.} How does a one-restriction F test relate to a t test?

\textbf{Walkthrough.} For the same two-sided linear restriction, F equals t squared and yields the same p-value.
\end{examplebox}

\begin{warningbox}
The fastest way to get this chapter wrong is to use the visible procedure without naming its assumption, units, time period, reference group, or boundary. I put that condition beside the work and verify the result independently.
\end{warningbox}

\begin{chapterpractice}
\textbf{Practice 1.} How does a one-restriction F test relate to a t test?

\textbf{Solution.} For the same two-sided linear restriction, F equals t squared and yields the same p-value.

\medskip
\textbf{Practice 2.} Explain general linear hypotheses and extra sums of squares to a classmate using one definition, one concrete example, one assumption, and one failure mode.

\textbf{Solution.} Begin with the core claim above, use the worked case as the concrete example, state the condition highlighted by the warning, and choose a failure where that condition does not hold. A complete explanation connects all four pieces instead of listing them.

\medskip
\textbf{Mastery practice A.} Reconstruct general linear hypotheses and extra sums of squares from a blank page. Include the central definition, the governing rule, one required assumption, and one boundary case.

\textbf{Solution.} Start from the blue idea box, but rewrite it in my own words. Identify the objects and state, name the rule before using it, copy the relevant assumption from the details audit, and choose a boundary where that assumption becomes equality or fails. A complete solution explains why each part belongs; a list of vocabulary is not enough.

\medskip
\textbf{Mastery practice B.} A classmate gets a polished-looking answer to a general linear hypotheses and extra sums of squares problem but never states a model or checks the result. Write the shortest useful review of that solution.

\textbf{Solution.} I would ask four concrete questions: What exactly are the inputs and desired output? Which rule licenses the main step? Which assumption could invalidate it? Which independent check supports the conclusion? If the answer cannot survive those four questions, I treat the numerical or verbal result as unverified.

\end{chapterpractice}

\section{Residuals, leverage, and influence}

\begin{idea}
Residual diagnostics examine nonlinearity, unequal variance, dependence, outliers, leverage, and influence. Studentized residuals, hat values, Cook's distance, and case-deletion sensitivity reveal different failure modes.
\end{idea}
% MASTERCLASS EXPANSION
\subsection{Rebuild the chapter from first principles}
The claim I need to own is this: Residual diagnostics examine nonlinearity, unequal variance, dependence, outliers, leverage, and influence. Studentized residuals, hat values, Cook's distance, and case-deletion sensitivity reveal different failure modes. I do not count that as learned just because the sentence looks familiar. I should be able to name the objects, state what changes and what stays fixed, recover the rule from the definitions, and explain why the result is allowed.

\begin{move}
\textbf{My working sequence}
\begin{enumerate}
  \item \textbf{Translate.} Rewrite the prompt in the language of residuals, leverage, and influence. List the known quantities, the unknown, the units or types, and any hidden constraint.
  \item \textbf{Choose.} State the theorem, model, algorithm, accounting rule, or physical law before substituting values. This is where I make the assumption visible.
  \item \textbf{Execute.} Work one justified step at a time and keep intermediate state readable enough that I can audit it later.
  \item \textbf{Verify.} Check a boundary case, sign, unit, invariant, order of magnitude, or alternative derivation. Then translate the result back into an ordinary sentence.
\end{enumerate}
\end{move}

\subsection{Details I would refuse to skip}
\begin{itemize}
  \item \textbf{Definitions:} I should be able to define every technical noun in the chapter without using that same noun in the definition.
  \item \textbf{Assumptions:} I write the condition that makes the method legal beside the method itself. A correct procedure under the wrong assumptions is still a wrong answer.
  \item \textbf{Representation:} I move freely among words, equations or code, a diagram, and a small numerical example. If one representation disagrees with another, that disagreement is useful evidence.
  \item \textbf{Failure modes:} I keep the nearest counterexample in mind: the boundary where the rule changes, the invariant breaks, or the model stops matching reality.
  \item \textbf{Communication:} My final answer names what the result means and what it does not establish. I do not let notation do the explanatory work for me.
\end{itemize}

\begin{sanitybox}
\textbf{Closed-note check.} Can I teach residuals, leverage, and influence on a blank page, derive or reconstruct its main rule, work a fresh example, and diagnose a deliberately broken solution? If I can only recognize the finished work, I am not done.
\end{sanitybox}

\subsection{How this chapter connects}
I read this chapter as the bridge from general linear hypotheses and extra sums of squares to categorical predictors, interactions, and polynomial structure. The earlier material supplies the language and constraints; this chapter adds a new reasoning move; the later material asks me to use that move without being told its name. That connection matters because exams and real projects mix chapters on purpose.


\subsection{The full working model}
\begin{itemize}
  \item \textbf{Core claim.} Residual diagnostics examine nonlinearity, unequal variance, dependence, outliers, leverage, and influence.
  \item \textbf{What moves.} Studentized residuals, hat values, Cook's distance, and case-deletion sensitivity reveal different failure modes.
  \item \textbf{What keeps the answer honest.} The model becomes useful only when I can apply residuals, leverage, and influence to an unfamiliar case and defend the assumptions.
  \item \textbf{Mastery standard.} I can define the objects, rebuild the rule, work a fresh case, compare alternatives, and diagnose a broken solution without relying on recognition.
\end{itemize}

\begin{studenttake}
An unusual x value is leverage; an unusual y after fitting is residual. I need both to understand influence.
\end{studenttake}

\begin{plainbox}
Residual diagnostics examine nonlinearity, unequal variance, dependence, outliers, leverage, and influence.
\end{plainbox}

\begin{examplebox}
\textbf{Question.} Can a high-leverage point have low influence?

\textbf{Walkthrough.} Yes. If it lies close to the fitted pattern, deleting it may barely change coefficients despite unusual predictors.
\end{examplebox}

\begin{warningbox}
The fastest way to get this chapter wrong is to use the visible procedure without naming its assumption, units, time period, reference group, or boundary. I put that condition beside the work and verify the result independently.
\end{warningbox}

\begin{chapterpractice}
\textbf{Practice 1.} Can a high-leverage point have low influence?

\textbf{Solution.} Yes. If it lies close to the fitted pattern, deleting it may barely change coefficients despite unusual predictors.

\medskip
\textbf{Practice 2.} Explain residuals, leverage, and influence to a classmate using one definition, one concrete example, one assumption, and one failure mode.

\textbf{Solution.} Begin with the core claim above, use the worked case as the concrete example, state the condition highlighted by the warning, and choose a failure where that condition does not hold. A complete explanation connects all four pieces instead of listing them.

\medskip
\textbf{Mastery practice A.} Reconstruct residuals, leverage, and influence from a blank page. Include the central definition, the governing rule, one required assumption, and one boundary case.

\textbf{Solution.} Start from the blue idea box, but rewrite it in my own words. Identify the objects and state, name the rule before using it, copy the relevant assumption from the details audit, and choose a boundary where that assumption becomes equality or fails. A complete solution explains why each part belongs; a list of vocabulary is not enough.

\medskip
\textbf{Mastery practice B.} A classmate gets a polished-looking answer to a residuals, leverage, and influence problem but never states a model or checks the result. Write the shortest useful review of that solution.

\textbf{Solution.} I would ask four concrete questions: What exactly are the inputs and desired output? Which rule licenses the main step? Which assumption could invalidate it? Which independent check supports the conclusion? If the answer cannot survive those four questions, I treat the numerical or verbal result as unverified.

\end{chapterpractice}

\section{Categorical predictors, interactions, and polynomial structure}

\begin{idea}
Indicator coding chooses reference comparisons; interactions make one effect depend on another variable; polynomial and basis expansions model curvature while remaining linear in coefficients.
\end{idea}
% MASTERCLASS EXPANSION
\subsection{Rebuild the chapter from first principles}
The claim I need to own is this: Indicator coding chooses reference comparisons; interactions make one effect depend on another variable; polynomial and basis expansions model curvature while remaining linear in coefficients. I do not count that as learned just because the sentence looks familiar. I should be able to name the objects, state what changes and what stays fixed, recover the rule from the definitions, and explain why the result is allowed.

\begin{move}
\textbf{My working sequence}
\begin{enumerate}
  \item \textbf{Translate.} Rewrite the prompt in the language of categorical predictors, interactions, and polynomial structure. List the known quantities, the unknown, the units or types, and any hidden constraint.
  \item \textbf{Choose.} State the theorem, model, algorithm, accounting rule, or physical law before substituting values. This is where I make the assumption visible.
  \item \textbf{Execute.} Work one justified step at a time and keep intermediate state readable enough that I can audit it later.
  \item \textbf{Verify.} Check a boundary case, sign, unit, invariant, order of magnitude, or alternative derivation. Then translate the result back into an ordinary sentence.
\end{enumerate}
\end{move}

\subsection{Details I would refuse to skip}
\begin{itemize}
  \item \textbf{Definitions:} I should be able to define every technical noun in the chapter without using that same noun in the definition.
  \item \textbf{Assumptions:} I write the condition that makes the method legal beside the method itself. A correct procedure under the wrong assumptions is still a wrong answer.
  \item \textbf{Representation:} I move freely among words, equations or code, a diagram, and a small numerical example. If one representation disagrees with another, that disagreement is useful evidence.
  \item \textbf{Failure modes:} I keep the nearest counterexample in mind: the boundary where the rule changes, the invariant breaks, or the model stops matching reality.
  \item \textbf{Communication:} My final answer names what the result means and what it does not establish. I do not let notation do the explanatory work for me.
\end{itemize}

\begin{sanitybox}
\textbf{Closed-note check.} Can I teach categorical predictors, interactions, and polynomial structure on a blank page, derive or reconstruct its main rule, work a fresh example, and diagnose a deliberately broken solution? If I can only recognize the finished work, I am not done.
\end{sanitybox}

\subsection{How this chapter connects}
I read this chapter as the bridge from residuals, leverage, and influence to model selection and validation. The earlier material supplies the language and constraints; this chapter adds a new reasoning move; the later material asks me to use that move without being told its name. That connection matters because exams and real projects mix chapters on purpose.


\subsection{The full working model}
\begin{itemize}
  \item \textbf{Core claim.} Indicator coding chooses reference comparisons; interactions make one effect depend on another variable; polynomial and basis expansions model curvature while remaining linear in coefficients.
  \item \textbf{What moves.} The model becomes useful only when I can apply categorical predictors, interactions, and polynomial structure to an unfamiliar case and defend the assumptions.
  \item \textbf{What keeps the answer honest.} The model becomes useful only when I can apply categorical predictors, interactions, and polynomial structure to an unfamiliar case and defend the assumptions.
  \item \textbf{Mastery standard.} I can define the objects, rebuild the rule, work a fresh case, compare alternatives, and diagnose a broken solution without relying on recognition.
\end{itemize}

\begin{studenttake}
My shorthand for this chapter is: my shorthand for this chapter is: a main effect inside an interaction is conditional at the other variable's zero or reference level.
\end{studenttake}

\begin{plainbox}
Indicator coding chooses reference comparisons; interactions make one effect depend on another variable; polynomial and basis expansions model curvature while remaining linear in coefficients.
\end{plainbox}

\begin{examplebox}
\textbf{Question.} In y=b0+b1x+b2g+b3xg, what is the x slope when g=1?

\textbf{Walkthrough.} The slope is b1+b3. When g=0 it is b1, and b3 is the slope difference.
\end{examplebox}

\begin{warningbox}
The fastest way to get this chapter wrong is to use the visible procedure without naming its assumption, units, time period, reference group, or boundary. I put that condition beside the work and verify the result independently.
\end{warningbox}

\begin{chapterpractice}
\textbf{Practice 1.} In y=b0+b1x+b2g+b3xg, what is the x slope when g=1?

\textbf{Solution.} The slope is b1+b3. When g=0 it is b1, and b3 is the slope difference.

\medskip
\textbf{Practice 2.} Explain categorical predictors, interactions, and polynomial structure to a classmate using one definition, one concrete example, one assumption, and one failure mode.

\textbf{Solution.} Begin with the core claim above, use the worked case as the concrete example, state the condition highlighted by the warning, and choose a failure where that condition does not hold. A complete explanation connects all four pieces instead of listing them.

\medskip
\textbf{Mastery practice A.} Reconstruct categorical predictors, interactions, and polynomial structure from a blank page. Include the central definition, the governing rule, one required assumption, and one boundary case.

\textbf{Solution.} Start from the blue idea box, but rewrite it in my own words. Identify the objects and state, name the rule before using it, copy the relevant assumption from the details audit, and choose a boundary where that assumption becomes equality or fails. A complete solution explains why each part belongs; a list of vocabulary is not enough.

\medskip
\textbf{Mastery practice B.} A classmate gets a polished-looking answer to a categorical predictors, interactions, and polynomial structure problem but never states a model or checks the result. Write the shortest useful review of that solution.

\textbf{Solution.} I would ask four concrete questions: What exactly are the inputs and desired output? Which rule licenses the main step? Which assumption could invalidate it? Which independent check supports the conclusion? If the answer cannot survive those four questions, I treat the numerical or verbal result as unverified.

\end{chapterpractice}

\section{Model selection and validation}

\begin{idea}
Adjusted R-squared, information criteria, nested tests, stepwise methods, cross-validation, and subject knowledge choose among models under different goals. Data-driven selection changes uncertainty and can overfit.
\end{idea}
% MASTERCLASS EXPANSION
\subsection{Rebuild the chapter from first principles}
The claim I need to own is this: Adjusted R-squared, information criteria, nested tests, stepwise methods, cross-validation, and subject knowledge choose among models under different goals. Data-driven selection changes uncertainty and can overfit. I do not count that as learned just because the sentence looks familiar. I should be able to name the objects, state what changes and what stays fixed, recover the rule from the definitions, and explain why the result is allowed.

\begin{move}
\textbf{My working sequence}
\begin{enumerate}
  \item \textbf{Translate.} Rewrite the prompt in the language of model selection and validation. List the known quantities, the unknown, the units or types, and any hidden constraint.
  \item \textbf{Choose.} State the theorem, model, algorithm, accounting rule, or physical law before substituting values. This is where I make the assumption visible.
  \item \textbf{Execute.} Work one justified step at a time and keep intermediate state readable enough that I can audit it later.
  \item \textbf{Verify.} Check a boundary case, sign, unit, invariant, order of magnitude, or alternative derivation. Then translate the result back into an ordinary sentence.
\end{enumerate}
\end{move}

\subsection{Details I would refuse to skip}
\begin{itemize}
  \item \textbf{Definitions:} I should be able to define every technical noun in the chapter without using that same noun in the definition.
  \item \textbf{Assumptions:} I write the condition that makes the method legal beside the method itself. A correct procedure under the wrong assumptions is still a wrong answer.
  \item \textbf{Representation:} I move freely among words, equations or code, a diagram, and a small numerical example. If one representation disagrees with another, that disagreement is useful evidence.
  \item \textbf{Failure modes:} I keep the nearest counterexample in mind: the boundary where the rule changes, the invariant breaks, or the model stops matching reality.
  \item \textbf{Communication:} My final answer names what the result means and what it does not establish. I do not let notation do the explanatory work for me.
\end{itemize}

\begin{sanitybox}
\textbf{Closed-note check.} Can I teach model selection and validation on a blank page, derive or reconstruct its main rule, work a fresh example, and diagnose a deliberately broken solution? If I can only recognize the finished work, I am not done.
\end{sanitybox}

\subsection{How this chapter connects}
I read this chapter as the bridge from categorical predictors, interactions, and polynomial structure to principal-component regression and stabilized fitting. The earlier material supplies the language and constraints; this chapter adds a new reasoning move; the later material asks me to use that move without being told its name. That connection matters because exams and real projects mix chapters on purpose.


\subsection{The full working model}
\begin{itemize}
  \item \textbf{Core claim.} Adjusted R-squared, information criteria, nested tests, stepwise methods, cross-validation, and subject knowledge choose among models under different goals.
  \item \textbf{What moves.} Data-driven selection changes uncertainty and can overfit.
  \item \textbf{What keeps the answer honest.} The model becomes useful only when I can apply model selection and validation to an unfamiliar case and defend the assumptions.
  \item \textbf{Mastery standard.} I can define the objects, rebuild the rule, work a fresh case, compare alternatives, and diagnose a broken solution without relying on recognition.
\end{itemize}

\begin{studenttake}
I decide whether the goal is explanation, prediction, or compression before selecting a model.
\end{studenttake}

\begin{plainbox}
Adjusted R-squared, information criteria, nested tests, stepwise methods, cross-validation, and subject knowledge choose among models under different goals.
\end{plainbox}

\begin{examplebox}
\textbf{Question.} Why can stepwise p-values be misleading?

\textbf{Walkthrough.} They ignore the adaptive search that selected variables, understating uncertainty and exaggerating evidence. Validate externally or account for selection.
\end{examplebox}

\begin{warningbox}
The fastest way to get this chapter wrong is to use the visible procedure without naming its assumption, units, time period, reference group, or boundary. I put that condition beside the work and verify the result independently.
\end{warningbox}

\begin{chapterpractice}
\textbf{Practice 1.} Why can stepwise p-values be misleading?

\textbf{Solution.} They ignore the adaptive search that selected variables, understating uncertainty and exaggerating evidence. Validate externally or account for selection.

\medskip
\textbf{Practice 2.} Explain model selection and validation to a classmate using one definition, one concrete example, one assumption, and one failure mode.

\textbf{Solution.} Begin with the core claim above, use the worked case as the concrete example, state the condition highlighted by the warning, and choose a failure where that condition does not hold. A complete explanation connects all four pieces instead of listing them.

\medskip
\textbf{Mastery practice A.} Reconstruct model selection and validation from a blank page. Include the central definition, the governing rule, one required assumption, and one boundary case.

\textbf{Solution.} Start from the blue idea box, but rewrite it in my own words. Identify the objects and state, name the rule before using it, copy the relevant assumption from the details audit, and choose a boundary where that assumption becomes equality or fails. A complete solution explains why each part belongs; a list of vocabulary is not enough.

\medskip
\textbf{Mastery practice B.} A classmate gets a polished-looking answer to a model selection and validation problem but never states a model or checks the result. Write the shortest useful review of that solution.

\textbf{Solution.} I would ask four concrete questions: What exactly are the inputs and desired output? Which rule licenses the main step? Which assumption could invalidate it? Which independent check supports the conclusion? If the answer cannot survive those four questions, I treat the numerical or verbal result as unverified.

\end{chapterpractice}

\section{Principal-component regression and stabilized fitting}

\begin{idea}
Correlated predictors create unstable coefficient directions. Principal-component regression rotates to orthogonal directions and discards low-variance components; ridge shrinks directions instead. Scaling and validation are essential.
\end{idea}
% MASTERCLASS EXPANSION
\subsection{Rebuild the chapter from first principles}
The claim I need to own is this: Correlated predictors create unstable coefficient directions. Principal-component regression rotates to orthogonal directions and discards low-variance components; ridge shrinks directions instead. Scaling and validation are essential. I do not count that as learned just because the sentence looks familiar. I should be able to name the objects, state what changes and what stays fixed, recover the rule from the definitions, and explain why the result is allowed.

\begin{move}
\textbf{My working sequence}
\begin{enumerate}
  \item \textbf{Translate.} Rewrite the prompt in the language of principal-component regression and stabilized fitting. List the known quantities, the unknown, the units or types, and any hidden constraint.
  \item \textbf{Choose.} State the theorem, model, algorithm, accounting rule, or physical law before substituting values. This is where I make the assumption visible.
  \item \textbf{Execute.} Work one justified step at a time and keep intermediate state readable enough that I can audit it later.
  \item \textbf{Verify.} Check a boundary case, sign, unit, invariant, order of magnitude, or alternative derivation. Then translate the result back into an ordinary sentence.
\end{enumerate}
\end{move}

\subsection{Details I would refuse to skip}
\begin{itemize}
  \item \textbf{Definitions:} I should be able to define every technical noun in the chapter without using that same noun in the definition.
  \item \textbf{Assumptions:} I write the condition that makes the method legal beside the method itself. A correct procedure under the wrong assumptions is still a wrong answer.
  \item \textbf{Representation:} I move freely among words, equations or code, a diagram, and a small numerical example. If one representation disagrees with another, that disagreement is useful evidence.
  \item \textbf{Failure modes:} I keep the nearest counterexample in mind: the boundary where the rule changes, the invariant breaks, or the model stops matching reality.
  \item \textbf{Communication:} My final answer names what the result means and what it does not establish. I do not let notation do the explanatory work for me.
\end{itemize}

\begin{sanitybox}
\textbf{Closed-note check.} Can I teach principal-component regression and stabilized fitting on a blank page, derive or reconstruct its main rule, work a fresh example, and diagnose a deliberately broken solution? If I can only recognize the finished work, I am not done.
\end{sanitybox}

\subsection{How this chapter connects}
I read this chapter as the bridge from model selection and validation to the cumulative course model. The earlier material supplies the language and constraints; this chapter adds a new reasoning move; the later material asks me to use that move without being told its name. That connection matters because exams and real projects mix chapters on purpose.


\subsection{The full working model}
\begin{itemize}
  \item \textbf{Core claim.} Correlated predictors create unstable coefficient directions.
  \item \textbf{What moves.} Principal-component regression rotates to orthogonal directions and discards low-variance components; ridge shrinks directions instead.
  \item \textbf{What keeps the answer honest.} Scaling and validation are essential.
  \item \textbf{Mastery standard.} I can define the objects, rebuild the rule, work a fresh case, compare alternatives, and diagnose a broken solution without relying on recognition.
\end{itemize}

\begin{studenttake}
My shorthand for this chapter is: my shorthand for this chapter is: a low-variance predictor direction can still matter for y, so unsupervised compression is not automatically predictive.
\end{studenttake}

\begin{plainbox}
Correlated predictors create unstable coefficient directions.
\end{plainbox}

\begin{examplebox}
\textbf{Question.} Why standardize before PCA when variables use different units?

\textbf{Walkthrough.} Without scaling, high-variance units dominate the components. Standardization makes the analysis reflect correlation structure unless raw variance is substantively meaningful.
\end{examplebox}

\begin{warningbox}
The fastest way to get this chapter wrong is to use the visible procedure without naming its assumption, units, time period, reference group, or boundary. I put that condition beside the work and verify the result independently.
\end{warningbox}

\begin{chapterpractice}
\textbf{Practice 1.} Why standardize before PCA when variables use different units?

\textbf{Solution.} Without scaling, high-variance units dominate the components. Standardization makes the analysis reflect correlation structure unless raw variance is substantively meaningful.

\medskip
\textbf{Practice 2.} Explain principal-component regression and stabilized fitting to a classmate using one definition, one concrete example, one assumption, and one failure mode.

\textbf{Solution.} Begin with the core claim above, use the worked case as the concrete example, state the condition highlighted by the warning, and choose a failure where that condition does not hold. A complete explanation connects all four pieces instead of listing them.

\medskip
\textbf{Mastery practice A.} Reconstruct principal-component regression and stabilized fitting from a blank page. Include the central definition, the governing rule, one required assumption, and one boundary case.

\textbf{Solution.} Start from the blue idea box, but rewrite it in my own words. Identify the objects and state, name the rule before using it, copy the relevant assumption from the details audit, and choose a boundary where that assumption becomes equality or fails. A complete solution explains why each part belongs; a list of vocabulary is not enough.

\medskip
\textbf{Mastery practice B.} A classmate gets a polished-looking answer to a principal-component regression and stabilized fitting problem but never states a model or checks the result. Write the shortest useful review of that solution.

\textbf{Solution.} I would ask four concrete questions: What exactly are the inputs and desired output? Which rule licenses the main step? Which assumption could invalidate it? Which independent check supports the conclusion? If the answer cannot survive those four questions, I treat the numerical or verbal result as unverified.

\end{chapterpractice}

\section*{Cumulative study plan}
I use this packet in three passes. First I reconstruct each model and work its examples without looking. Second I mix chapters so the tool is no longer named for me. Third I explain a complete case aloud, including assumptions, units, uncertainty, failure modes, and what evidence would change my conclusion.

\end{document}
