# Ddf: Hessian of the observed datat Multivariate Normal... In MissMech: Testing Homoscedasticity, Multivariate Normality, and Missing Completely at Random

## Description

The Hessian of the normal-theory observed data log-likelihood function, evaluated at a given value of the mean vector and the covariance matrix, when data are incomplete. The output is a symmetric matrix with rows/columns corresponding to elements in the mean vector and lower diagonal of the covariance matrix.

## Usage

 `1` ```Ddf(data, mu, sig) ```

## Arguments

 `data` A matrix consisting of at least two columns. Values must be numerical with missing data indicated by NA. `mu` A row matrix consisting of the values of the mean at which points the Hessian of the log-likelihood is to be computed `sig` A symmetric covariance matrix at at which points the Hessian of the log-likelihood is to be computed

## Details

While mu is a vector, it has to be input as a matrix object. See example nelow.

## Value

 `dd ` The resulting Hessian matrix `se ` Negative of the inverse of the Hessian matrix

## Note

There must be no rows in data that contain no observations.

## Author(s)

Mortaza Jamshidian, Siavash Jalal, and Camden Jansen

## References

Jamshidian, M. and Bentler, P. M. (1999). “ML estimation of mean and covariance structures with missing data using complete data routines.” Journal of Educational and Behavioral Statistics, 24, 21-41.

## Examples

 ``` 1 2 3 4 5 6 7 8 9 10``` ```set.seed <- 50 n <- 200 p <- 4 pctmiss <- 0.2 y <- matrix(rnorm(n * p),nrow = n) missing <- matrix(runif(n * p), nrow = n) < pctmiss y[missing] <- NA mu <- c(0,0,0,0) sig <- matrix(c(1,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,1),4,4) Ddf(data=y, as.matrix(mu), sig) ```

### Example output

```\$dd
[,1]          [,2]        [,3]        [,4]       [,5]       [,6]
[1,] -163.000000  0.000000e+00    0.000000    0.000000   6.657366   15.67618
[2,]    0.000000 -1.620000e+02    0.000000    0.000000   0.000000   16.73926
[3,]    0.000000  0.000000e+00 -158.000000    0.000000   0.000000    0.00000
[4,]    0.000000  0.000000e+00    0.000000 -153.000000   0.000000    0.00000
[5,]    6.657366  0.000000e+00    0.000000    0.000000 -93.059880    0.00000
[6,]   15.676181  1.673926e+01    0.000000    0.000000   0.000000 -120.96557
[7,]    0.000000  1.055406e+01    0.000000    0.000000   0.000000    0.00000
[8,]   -8.245597  0.000000e+00    9.804398    0.000000   0.000000    0.00000
[9,]    0.000000 -2.675188e+00   11.631256    0.000000   0.000000    0.00000
[10,]    0.000000  0.000000e+00    0.885885    0.000000   0.000000    0.00000
[11,]    2.945363  0.000000e+00    0.000000    5.402418   0.000000    0.00000
[12,]    0.000000 -2.687687e-04    0.000000    5.507070   0.000000    0.00000
[13,]    0.000000  0.000000e+00    2.739819   -3.673648   0.000000    0.00000
[14,]    0.000000  0.000000e+00    0.000000    8.328150   0.000000    0.00000
[,7]        [,8]        [,9]      [,10]       [,11]         [,12]
[1,]   0.00000   -8.245597    0.000000   0.000000    2.945363  0.000000e+00
[2,]  10.55406    0.000000   -2.675188   0.000000    0.000000 -2.687687e-04
[3,]   0.00000    9.804398   11.631256   0.885885    0.000000  0.000000e+00
[4,]   0.00000    0.000000    0.000000   0.000000    5.402418  5.507070e+00
[5,]   0.00000    0.000000    0.000000   0.000000    0.000000  0.000000e+00
[6,]   0.00000    0.000000    0.000000   0.000000    0.000000  0.000000e+00
[7,] -78.02623    0.000000    0.000000   0.000000    0.000000  0.000000e+00
[8,]   0.00000 -141.743821    0.000000   0.000000    0.000000  0.000000e+00
[9,]   0.00000    0.000000 -137.547492   0.000000    0.000000  0.000000e+00
[10,]   0.00000    0.000000    0.000000 -90.397741    0.000000  0.000000e+00
[11,]   0.00000    0.000000    0.000000   0.000000 -142.504266  0.000000e+00
[12,]   0.00000    0.000000    0.000000   0.000000    0.000000 -1.301467e+02
[13,]   0.00000    0.000000    0.000000   0.000000    0.000000  0.000000e+00
[14,]   0.00000    0.000000    0.000000   0.000000    0.000000  0.000000e+00
[,13]     [,14]
[1,]    0.000000   0.00000
[2,]    0.000000   0.00000
[3,]    2.739819   0.00000
[4,]   -3.673648   8.32815
[5,]    0.000000   0.00000
[6,]    0.000000   0.00000
[7,]    0.000000   0.00000
[8,]    0.000000   0.00000
[9,]    0.000000   0.00000
[10,]    0.000000   0.00000
[11,]    0.000000   0.00000
[12,]    0.000000   0.00000
[13,] -165.889348   0.00000
[14,]    0.000000 -96.35501

\$se
[,1]          [,2]          [,3]          [,4]          [,5]
[1,]  6.253136e-03  8.577512e-05 -2.294625e-05  4.610005e-06  4.473401e-04
[2,]  8.577512e-05  6.322142e-03 -9.464234e-06  6.642033e-08  6.136225e-06
[3,] -2.294625e-05 -9.464234e-06  6.398692e-03 -2.575067e-06 -1.641541e-06
[4,]  4.610005e-06  6.642033e-08 -2.575067e-06  6.589313e-03  3.297929e-07
[5,]  4.473401e-04  6.136225e-06 -1.641541e-06  3.297929e-07  1.077777e-02
[6,]  8.222266e-04  8.859762e-04 -4.283317e-06  6.066114e-07  5.882087e-05
[7,]  1.160220e-05  8.551520e-04 -1.280161e-06  8.984214e-09  8.300044e-07
[8,] -3.653480e-04 -5.644396e-06  4.439314e-04 -4.462927e-07 -2.613645e-05
[9,] -3.608632e-06 -1.237609e-04  5.412687e-04 -2.190440e-07 -2.581562e-07
[10,] -2.248700e-07 -9.274815e-08  6.270627e-05 -2.523529e-08 -1.608686e-08
[11,]  1.294183e-04  1.775370e-06 -5.718890e-07  2.498999e-04  9.258395e-06
[12,]  1.948921e-07 -1.024545e-08 -1.089427e-07  2.788223e-04  1.394229e-08
[13,] -4.810682e-07 -1.577816e-07  1.057375e-04 -1.459640e-04 -3.441491e-08
[14,]  3.984516e-07  5.740837e-09 -2.225680e-07  5.695270e-04  2.850464e-08
[,6]          [,7]          [,8]          [,9]         [,10]
[1,]  8.222266e-04  1.160220e-05 -3.653480e-04 -3.608632e-06 -2.248700e-07
[2,]  8.859762e-04  8.551520e-04 -5.644396e-06 -1.237609e-04 -9.274815e-08
[3,] -4.283317e-06 -1.280161e-06  4.439314e-04  5.412687e-04  6.270627e-05
[4,]  6.066114e-07  8.984214e-09 -4.462927e-07 -2.190440e-07 -2.523529e-08
[5,]  5.882087e-05  8.300044e-07 -2.613645e-05 -2.581562e-07 -1.608686e-08
[6,]  8.495971e-03  1.198398e-04 -4.812728e-05 -1.759373e-05 -4.197589e-08
[7,]  1.198398e-04  1.293187e-02 -7.634781e-07 -1.674027e-05 -1.254539e-08
[8,] -4.812728e-05 -7.634781e-07  7.106941e-03  3.764939e-05  4.350465e-06
[9,] -1.759373e-05 -1.674027e-05  3.764939e-05  7.318394e-03  5.304356e-06
[10,] -4.197589e-08 -1.254539e-08  4.350465e-06  5.304356e-06  1.106284e-02
[11,]  1.701727e-05  2.401418e-07 -7.568149e-06 -8.288944e-08 -5.604431e-09
[12,]  2.383870e-08 -1.385831e-09 -1.887291e-08 -9.013117e-09 -1.067623e-09
[13,] -8.417652e-08 -2.134202e-08  7.341829e-06  8.944413e-06  1.036212e-06
[14,]  5.243060e-08  7.765229e-10 -3.857394e-08 -1.893240e-08 -2.181135e-09
[,11]         [,12]         [,13]         [,14]
[1,]  1.294183e-04  1.948921e-07 -4.810682e-07  3.984516e-07
[2,]  1.775370e-06 -1.024545e-08 -1.577816e-07  5.740837e-09
[3,] -5.718890e-07 -1.089427e-07  1.057375e-04 -2.225680e-07
[4,]  2.498999e-04  2.788223e-04 -1.459640e-04  5.695270e-04
[5,]  9.258395e-06  1.394229e-08 -3.441491e-08  2.850464e-08
[6,]  1.701727e-05  2.383870e-08 -8.417652e-08  5.243060e-08
[7,]  2.401418e-07 -1.385831e-09 -2.134202e-08  7.765229e-10
[8,] -7.568149e-06 -1.887291e-08  7.341829e-06 -3.857394e-08
[9,] -8.288944e-08 -9.013117e-09  8.944413e-06 -1.893240e-08
[10,] -5.604431e-09 -1.067623e-09  1.036212e-06 -2.181135e-09
[11,]  7.029483e-03  1.057434e-05 -5.543520e-06  2.159933e-05
[12,]  1.057434e-05  7.695434e-03 -6.176366e-06  2.409915e-05
[13,] -5.543520e-06 -6.176366e-06  6.033093e-03 -1.261595e-05
[14,]  2.159933e-05  2.409915e-05 -1.261595e-05  1.042751e-02
```

MissMech documentation built on May 2, 2019, 1:08 p.m.