--- title: 'CSSS/POLS 510 Maximum Likelihood Estimation: Lab 8' editor_options: chunk_output_type: console date: '2020-12-4' output: beamer_presentation: colortheme: seagull fonttheme: structurebold keep_tex: yes theme: Szeged slidy_presentation: default fontsize: 12pt subtitle: Count Data author: Kenya Amano --- # Agenda 1. Count Data 2. Closing # 1. Recap Where are we at right now? 1. Learn distribution and MLE $\rightarrow$ HW1 & HW2 2. Logit model $\rightarrow$ HW3 3. Ordered Probit model $\rightarrow$ HW4 4. Multinomial logit $\rightarrow$ HW5 5. Count data $\rightarrow$ HW5 # 2. Count Data Review the lecture materials to understand the concept # 3. Last words 1. Statistics (and programming) should be intuitive \begin{itemize} \item If I can't explain something in a simple manner, I don't understand it. e.g. coin flip \item Always go back to first principles and simple analogies \item Statistics is a tool; your reserach design is first \item You run the model; donâ€™t let the model run you \end{itemize} # 3. Last words 2. Computers are powerful yet stupid \begin{itemize} \item They execute what you instruct them, \textit{literally} \item When mistakes happen, it is usually us who make mistakes \item No replacement of sound statistical judgement \item Don't be held hostage to particular functions or packages \item "No default, all manual" is a virtue of \texttt{simcf} and \texttt{tile} \item Run incrementally when you face new \texttt{loop} and \texttt{function}: Reading ability is also critical \end{itemize} # 3. Last words 3. Simulations will be your best friends \begin{itemize} \item Understand the assumed DGP \item Solve probability problems \item Evaluate estimators \item Transform statistical results into QoI \end{itemize} # Simulating QoI 1. Estimate: MLE $\hat{\beta}_{(M+1)\times(P+1)}$ and its variance $\hat{V}(\hat{\beta}_{(M+1)\times(P+1)})$\ $\textcolor{red}{\rightarrow \texttt{optim(), multinom()}}$ 2. Simulate estimation uncertainty from a multivariate normal distribution:\ Draw $\tilde{\beta} \sim MVN \big[\hat{\beta}, \hat{V}(\hat{\beta})\big]$\ $\textcolor{red}{\rightarrow \texttt{MASS::mvrnorm()}}$ 3. Create hypothetical scenarios of your substantive interest:\ Choose valuese of X: $X_c$ $\textcolor{red}{\rightarrow \texttt{simcf::cfmake(), cfchange()} \dots}$ # Simulating QoI 4. Calculate expected values:\ $\tilde{\pi_c} = g(X_c, \tilde{\beta})$ \ 5. Compute EVs, First Differences or Relative Risks\ EV: $\mathbb{E}(y = j|X_{c1},\tilde{\beta})$\ $\textcolor{red}{\rightarrow \texttt{simcf::mlogitsimev()} \dots}$\ FD: $\mathbb{E}(y = j|X_{c2},\tilde{\beta},) - \mathbb{E}(y = j|X_{c1},\tilde{\beta})$\ $\textcolor{red}{\rightarrow \texttt{simcf::mlogitsimfd()} \dots}$\ RR: $\frac{\mathbb{E}(y = j|X_{c2},\tilde{\beta})}{\mathbb{E}(y = j|X_{c1},\tilde{\beta})}$\ $\textcolor{red}{\rightarrow \texttt{simcf::mlogitsimrr()} \dots}$\ # 3. Last words 4. Model results are unintelligible unless... \begin{itemize} \item You interpret and communicate them in meaningful ways \item \textit{Substantively meaningful} quantities of interest (QoI) and counterfactual scenarios \item Visualization is critical (CS\&SS 569)\\ 1) Avoid WYGWYS (What you get is what you see)\\ 2) LaTeX \end{itemize} # 3. Homework 5 and Feedback + Due on Dec 10 + Email subject: **MLE510HW5** + File name: **MLE510HW5KenyaAmano** + *slack chanel: #hw5 + Evaluation URL:[\underline{https://uw.iasystem.org/survey/231765}](https://uw.iasystem.org/survey/231765)