Hello everyone, im testing over dispersion in a count variable. I'm using Hilbe's book "Negative binomial regression" for the analysis. He used the formula LR = −2(LP − LNB), but calculate it by hand and then used chiprob(1, result)/2. All my independent variables are presence or ausence of drug consumption, that means i have to adjust models separately.
local sus binoh bintab binmar bincoc binpas
foreach var of local sus {
poisson num_psex `var' sexo i.or_sexual i.tramo_etario edad_inicio nse
estimates store m1
nbreg num_psex `var' sexo i.or_sexual i.tramo_etario edad_inicio nse
estimates store m2
lrtest m1 m2
}
test involves different estimators: nbreg vs. poisson
this is what i got. And it make sense because im not using the same function. I need to store the log likelihood of my models and then use the formula, but i dont know how to make it efficient.
Please, i need some ideas. Thank you very much.
Related Posts with LRTEST poisson vs negative binomial loop
Coefplot, only plotting some of the variablesHi, I have a problem with Coefplot. I have tried the different answers I have found here from earli…
forvalues with indefinite end valueI would like to use a do loop to read in a series of excel files, save them as .dta files, then appe…
Interaction term and lincomHi all, I am running a basic interaction model y=b0 + b1X1 + b2D + b3X1*D. where D is a dummy varia…
xtpcse command with unbalanced dataHi all, I have unbalanced tscs data and want to use xtpcse but the regression won't run and I get t…
ZIPPKG: module to create ZIP archives of community-contributed content for offline distribution now on SSCDear Statalist community, thanks, as always, to KitBaum, a new user written command named zippkg is…
Subscribe to:
Post Comments (Atom)
0 Response to LRTEST poisson vs negative binomial loop
Post a Comment