Hello Statalist,
I am trying to figure out why I am getting different p-values when using two different omnibus or global interaction tests with survey data. I am using a restricted dataset and so cannot post my output here, but here is my code and summary of results. I am using Stata 16.1 on Windows 10 Pro.
The variables I am interacting each have 4 levels coded as 0,1,2,3 with 0 being the referent group. The output shows a p-value less than 0.05 for the interaction between two of the category combinations only (bisexual#transgender, for example). But what I want is an overall/omnibus/global interaction test for ease of reporting. My first approach to testing the global interaction is below.
This gives me a p-value of 0.01
The following is my second approach, which gives a p-value for the 'intterm' of 0.2.
I am trying to figure out why I am getting different p-values when using two different omnibus or global interaction tests with survey data. I am using a restricted dataset and so cannot post my output here, but here is my code and summary of results. I am using Stata 16.1 on Windows 10 Pro.
Code:
svy: glm pos i.newsexid##i.gendersex i.covid i.race i. educ, fam(poisson) link(log) eform
Code:
testparm i.newsexid#i.gendersex2
The following is my second approach, which gives a p-value for the 'intterm' of 0.2.
Code:
gen intterm=newsexid*gendersex2 svy: glm pos i.newsexid intterm i.gendersex i.covid i.race i. educ, fam(poisson) link(log) eform
Comment