Assignment 3

Jacqueline Nosrati

Load packages and data

library(Zelig)
library(maxLik)
data(turnout)
head(turnout)
##    race age educate income vote
## 1 white  60      14 3.3458    1
## 2 white  51      10 1.8561    0
## 3 white  24      12 0.6304    0
## 4 white  38       8 3.4183    1
## 5 white  25      12 2.7852    1
## 6 white  67      12 2.3866    1
tail(turnout)
##       race age educate income vote
## 1995 white  22       7 0.2364    0
## 1996 white  26      16 3.3834    0
## 1997 white  34      12 2.9170    1
## 1998 white  51      16 7.8949    1
## 1999 white  22      10 2.4811    0
## 2000 white  59      10 0.5523    0

Log-Likelihood function showing relationship between income and age and education

ols.lf2 <- function(param) {
  mu <- param[1]
  theta <- param[-1]
  y <- as.vector(turnout$income)
  x <- cbind(1, turnout$educate, turnout$age)
  sigma <- x%*%theta
  sum(dnorm(y, mu, sigma, log = TRUE))
}    

MLE Summary

mle_ols2 <- maxLik(logLik = ols.lf2, start = c(mu = 1, theta1 = 1, theta2 = 1, theta3= 1), method="BFGS")
summary(mle_ols2)
## --------------------------------------------
## Maximum Likelihood estimation
## BFGS maximization, 150 iterations
## Return code 0: successful convergence 
## Log-Likelihood: -4843.15 
## 4  free parameters
## Estimates:
##        Estimate Std. error t value  Pr(> t)    
## mu     3.555011   0.069193  51.378  < 2e-16 ***
## theta1 0.362114   0.204550   1.770   0.0767 .  
## theta2 0.133349   0.010756  12.398  < 2e-16 ***
## theta3 0.017507   0.002852   6.139 8.32e-10 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## --------------------------------------------

Analysis

When looking at the relationship between age, education and income we see a positive relationship between the variables, as both theta’s (2 and 3) are positive. Looking at both variables slopes, we can see that education has a greater impact on the changes in income than age (0.13 and 0.02, respectively). When we look at the p-values for both variables we see that both theta 2 (education) and theta 3 are statistically significant at 99% significane, indicating that both education and age affect changes in income. This can also be interpreted by looking at the two t-values for both variables (12.4 and 6.1, respectively), which are greater than the critical value (2.58) for the 99% confidence level in t-distributions.