My impression from preparing the workshop is that this should really be wrapped up in a function that we ship with the package:
Model comparison of nested models:
Δdev = minus2ll(fitted_h0) - minus2ll(fitted)
Δdf = dof(fitted_h0) - dof(fitted)
using Distributions
p = 1 - cdf(Chisq(Δdf), Δdev) # p-value for the LRT
My impression from preparing the workshop is that this should really be wrapped up in a function that we ship with the package:
Model comparison of nested models: