6.6.2.2.4. statsmodels.sandbox.panel.mixed.Unit

class statsmodels.sandbox.panel.mixed.Unit(endog, exog_fe, exog_re)[source]

Individual experimental unit for EM implementation of (repeated measures) mixed effects model.

‘Maximum Likelihood Computations with Repeated Measures: Application of the EM Algorithm’

Nan Laird; Nicholas Lange; Daniel Stram

Journal of the American Statistical Association, Vol. 82, No. 397. (Mar., 1987), pp. 97-105.

Parameters:

endog : ndarray, (nobs,)

response, endogenous variable

exog_fe : ndarray, (nobs, k_vars_fe)

explanatory variables as regressors or fixed effects, should include exog_re to correct mean of random coefficients, see Notes

exog_re : ndarray, (nobs, k_vars_re)

explanatory variables or random effects or coefficients

Notes

If the exog_re variables are not included in exog_fe, then the mean of the random constants or coefficients are not centered. The covariance matrix of the random parameter estimates are not centered in this case. (That’s how it looks to me. JP)

__init__(endog, exog_fe, exog_re)[source]

6.6.2.2.4.1. Methods

__init__(endog, exog_fe, exog_re)
compute_P(Sinv) projection matrix (nobs_i, nobs_i) (M in regression ?) (JP check, guessing)
compute_xtwx() Utility function to compute X^tWX for Unit instance.
compute_xtwy() Utility function to compute X^tWY (transposed ?) for Unit instance.
cov_random(D[, Sinv]) Approximate covariance of estimates of random effects.
deviance([ML]) deviance defined as 2 times the negative loglikelihood
fit(a, D, sigma) Compute unit specific parameters in Laird, Lange, Stram (see help(Unit)).
logL(a[, ML]) Individual contributions to the log-likelihood, tries to return REML contribution by default though this requires estimated fixed effect a to be passed as an argument.