3 Transformation of Parameters

Consider model M0. A summary of the co-efficient estimates are provided below:

summary(M0)
Coefficients:
            Estimate Std. Error z value Pr(>|z|)
(Intercept)   1.2730     0.2469   5.156 2.52e-07 ***
AppApp2      -0.6417     0.3026  -2.120    0.034 *
AppApp3      -1.2563     0.2786  -4.509 6.51e-06 ***

Evaluate the maximum likelihood estimate and the 95% confidence interval for the odds of recommendation for users of App1. According to the model definition, the (intercept) parameter denotes the log-odds for App1. Therefore, we are able to identify the log-odds MLE and 95% confidence interval as:

Est <- 1.2730
CI <- Est + c(-1, 1) * 1.96 * 0.2469   ##0.7891 1.7569

Since the relationship between odds and log-odds is monotonic, we need only apply the transformation to Est and CI to evaluate required odds MLE and 95% confidence interval:

exp(c(Est,CI))   ## MLE = 3.571551, CI = (2.201361, 5.794586)

Evaluate the maximum likelihood estimate and the 95% confidence interval for the odds of recommendation for users of App3. The parameter transformation in this case is:

ψ=exp{β1+β3}

where the co-efficients β1 and β3 is defined in the model as (Intercept) and AppApp3 respectively (i.e. β3 is the log-odds ratio of recommendation for App3 relative to App1). The MLE ψ^ is easily found by substituting the estimates into the transformation:

beta <- coef(M0)  ##Extracts the estimates from model M0
psi <- exp(beta[1] + beta[3])   ##1.0168

In order to evaluate the confidence interval of the estimator, we first need to calculate the variance of ψ, but we need to account for the dependence between the parameters. For this, we need to employ the delta method. The partial derivative of the transformation with respect to all three co-efficients is:

ψ𝜷=(exp{β1+β3},0,exp{β1+β3})

Substituting the MLEs, the partial derivatives of the transformation are:

d <- c(exp(beta[1] + beta[3]), 0, exp(beta[1] + beta[3]))
d <- matrix(d, ncol=1, nrow=3)  ##Convert d to a column matrix

The variance-covariance matrix of the parameters in model M0 is:

V <- vcov(M0)
round(V,4)
            (Intercept) AppApp2 AppApp3
(Intercept)      0.0610 -0.0610 -0.0610
AppApp2         -0.0610  0.0916  0.0610
AppApp3         -0.0610  0.0610  0.0776

Hence, the variance in the odds estimate for App3 using delta method is:

var_psi <- t(d) %*% V %*% d  ##0.0172

Therefore, an approximate 95% confidence interval is calculated by:

psi + c(-1, 1) * 1.96 * sqrt(var_psi)   ## CI = (0.7595102, 1.2741033).

Alternatively you could derive the confidence interval for the log odds and convert this to the confidence interval for the odds