--- title: 'CSSS/POLS 510 Maximum Likelihood Estimation: Lab 6' editor_options: chunk_output_type: console date: '2020-11-13' output: beamer_presentation: colortheme: seagull fonttheme: structurebold keep_tex: yes theme: Szeged slidy_presentation: default fontsize: 12pt subtitle: Nested Logit model GOF author: Kenya Amano --- # Agenda 1. Recap lectures 2. Ordered Probit model 3. Homework: HW4 # 1. Recap Where are we at right now? # 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. Ordered Probit model Review the lecture materials to understand the concept # 2. Ordered Probit model Probabilities we want to estimate in four category case \small \begin{equation*} \begin{split} \text{Pr}(y_i=1|\boldsymbol{x_i})&=\Phi(\tau_1-\alpha-\boldsymbol{x_i\beta})\\ \text{Pr}(y_i=2|\boldsymbol{x_i})&=\Phi(\tau_2-\alpha-\boldsymbol{x_i\beta})-\Phi(\tau_{1}-\alpha-\boldsymbol{x_i\beta})\\ \text{Pr}(y_i=3|\boldsymbol{x_i})&=\Phi(\tau_3-\alpha-\boldsymbol{x_i\beta})-\Phi(\tau_{2}-\alpha-\boldsymbol{x_i\beta})\\ \text{Pr}(y_i=4|\boldsymbol{x_i})&=1-\Phi(\tau_3-\alpha-\boldsymbol{x_i\beta}) \end{split} \end{equation*} To identify the model, we commonly make one of two assumptions: 1. Assume that $\tau_{1}=0$. This is also the identifying assumption of logit and probit. optim() uses this. 2. Assume that $\alpha=0$. polr() uses this. The likelihood function for ordered probit finds the $\boldsymbol{\beta}$ and $\tau$ that make the observed data most likely. # 2 Simulating QoI 1. Estimate: MLE $\hat{\beta}, \hat{\tau}$ and its variance $\hat{V}(\hat{\beta}, \hat{\tau})$\ $\textcolor{red}{\rightarrow \texttt{optim(), polr()}}$ 2. Simulate estimation uncertainty from a multivariate normal distribution:\ Draw $\tilde{\beta} , \tilde{\tau} \sim MVN \big[\hat{(\beta},\hat{\tau}), \hat{V}(\hat{\beta}, \hat{\tau})\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}$ # 2 Simulating QoI 4. Calculate expected values:\ $\tilde{\pi_c} = g(X_c, \tilde{\beta}, \tilde{\tau})$ \ 5. Compute EVs, First Differences or Relative Risks\ EV: $\mathbb{E}(y = j|X_{c1},\tilde{\beta},\tilde{\tau} )$\ $\textcolor{red}{\rightarrow \texttt{simcf::oprobitsimev()} \dots}$\ FD: $\mathbb{E}(y = j|X_{c2},\tilde{\beta},\tilde{\tau}) - \mathbb{E}(y = j|X_{c1},\tilde{\beta},\tilde{\tau})$\ $\textcolor{red}{\rightarrow \texttt{simcf::oprobitsimfd()} \dots}$\ RR: $\frac{\mathbb{E}(y = j|X_{c2},\tilde{\beta},\tilde{\tau})}{\mathbb{E}(y = j|X_{c1},\tilde{\beta},\tilde{\tau})}$\ $\textcolor{red}{\rightarrow \texttt{simcf::oprobitsimrr()} \dots}$\ # 3. Homework: Question HW4 + Due on Nov 24 + Email subject: **MLE510HW4** + File name: **MLE510HW4KenyaAmano** + One common problem when knitting: the math mode environment doesn't like white space or empty line + Try \begin{alinged} instead of \begin{split} + R Markdown guide is [\underline{here}](https://bookdown.org/yihui/rmarkdown)