Question (a)

Use the solver in Excel to replicate the estimation of the parameters of the logit model using maximum likelihood. The log-likelihood is given in cell L30 and the parameters are given in cells D3:H3. Use the GRG nonlinear solver (in Libre Office Excel the DEPS evolutionary algorithm). You can of course also use another software package which allows you to estimate the parameters of a logit model using maximum likelihood.

modelb <- glm(response~male+activity+age+I((age/10)^2), data=Data55, family = "binomial")
stargazer(modelb, type="html", title="Results", header = FALSE)
Results
Dependent variable:
response
male 0.954***
(0.158)
activity 0.914***
(0.185)
age 0.070**
(0.036)
I((age/10)2) -0.069**
(0.034)
Constant -2.488***
(0.890)
Observations 925
Log Likelihood -601.862
Akaike Inf. Crit. 1,213.725
Note: p<0.1; p<0.05; p<0.01

Question (b)

The researcher assumes that a value of 1 corresponds with positive response. What happens if we impose that that positive response is zero and negative response equals 1. The new response variable can be obtained from the old response variable by the following transformation \(resp^{new}_i=-resp_i+1\) (All zero observations become one and all one observations become zero).

Estimate the parameters of the same logit specification but use now the new response variable \(resp^{new}_i\) as dependent variable. Compare the parameter estimates with the original logit model and comment.

respnew <- -Data55$response+1
model2 <- glm(respnew~male+activity+age+I((age/10)^2), data=Data55, family = "binomial")
stargazer(modelb, model2, type="html", header = FALSE)
Dependent variable:
response respnew
(1) (2)
male 0.954*** -0.954***
(0.158) (0.158)
activity 0.914*** -0.914***
(0.185) (0.185)
age 0.070** -0.070**
(0.036) (0.036)
I((age/10)2) -0.069** 0.069**
(0.034) (0.034)
Constant -2.488*** 2.488***
(0.890) (0.890)
Observations 925 925
Log Likelihood -601.862 -601.862
Akaike Inf. Crit. 1,213.725 1,213.725
Note: p<0.1; p<0.05; p<0.01

Intepretation of the parameters remain the same. Does not matter how your code the binary variable \(y_i=resp_i\)

Question (c)

Test the null hypothesis \(H_0: \beta_1 = \beta_2 = 0\) versus \(H_1:\) no restrictions on \(\beta_1\) and \(\beta_2\), using a likelihood ratio test.

modelb2 <- glm(response~age+I((age/10)^2), data=Data55, family = "binomial")
L1 <- as.numeric(logLik(modelb)) #maximum likelihood value in full model
L0 <- as.numeric(logLik(modelb2)) #maximum likelihood value in restricted model
LR <- -2*(L0-L1)
print(LR)
## [1] 68.46841
print(qchisq(0.95,df=2)) #m=2 the number of restrictions
## [1] 5.991465

\(H_0\) is rejected at \(5\%\) level. In fact, the p-value is 1.356045110^{-15}