'generic likelihood ration test between nested models
egin{align} D & = -2(\ln(  ext{likelihood for null model}) - \ln(  ext{likelihood for alternative model})) \ & = -2\ln\left( rac{ ext{likelihood for null model}}{        ext{likelihood for alternative model}} ight). \end{align}
is distributed as chisquare with df equal to difference in number of parameters or equivalently
difference in residual degrees of freedom  (sign?)
TODO: put into separate function'

def lr_test(self):

    if (not hasattr(self, 'lsjoint')):
        self.fitjoint()
    if (not hasattr(self, 'lspooled')):
        self.fitpooled()
    loglikejoint = self.lsjoint.llf
    loglikepooled = self.lspooled.llf
    lrstat = ((-2) * (loglikepooled - loglikejoint))
    lrdf = (self.lspooled.df_resid - self.lsjoint.df_resid)
    lrpval = stats.chi2.sf(lrstat, lrdf)
    return (lrstat, lrpval, lrdf)
