0
$\begingroup$

The file "Aspirin" contains a 2 × 2 × 2 contingency table with columns defined as follows in R.

Column 1: V1=Count. [Nonnegative integer count for each cell in the Table.]

Column 2: V2=Case/Control Factor. [Factor Level 1 (Controls) and Level 2 (Cases).]

Column 3: V3=Ulcer Type Factor. [Factor Level 1 (Gastric) and Level 2 (Duodenal).]

Column 4: V4=Aspirin Use Factor. [Factor Level 1 (Non-User) and Level 2 (User).]

count=aspirin$V2
outcome=aspirin$V3 
ulcer=aspirin$V4  
use=aspirin$V5

I have 4 log-linear models constructed using these variables, which are

aspirin1=glm(count~ulcer+outcome*use,family=poisson) 
aspirin2=glm(count~ulcer+use*outcome,family=poisson)  
aspirin3=glm(count~ulcer*use+ulcer*outcome,family=poisson)  
aspirin4=glm(count~ulcer*outcome+ulcer*use+outcome*use,family=poisson)  
aspirin5=glm(count~ulcer*outcome*use,family=poisson)  <- saturated model

The residual deviance and degrees of freedom are

aspirin1: deviance=10.539, df=3 => p=0.01449866 (using chi-square)

aspirin2: deviance=10.539, df=3 => p=0.01449866

aspirin3: deviance=17.697, df=2 => p=0.000143597

aspirin4: deviance=6.283, df=1 => p=0.01219016

aspirin5: deviance=7.9936e-15, df=0 => p=0

Using the information above, what is the best model? Is it the one with the lowest p-value?

$\endgroup$

1 Answer 1

1
$\begingroup$

The best model is the one with the least number of terms, but explains as much as possible. One way to test this is to run

anova(aspirin1, aspirin2, aspirin3, aspirin4, aspirin5, test = "Chisq")

This will return an analysis of deviance table which should tell you whether any of the models are significantly different from each other. You are mainly looking to identify the simplest model that does not differ significantly from the saturated model (ie working backwards) so you can verify this by running the above function with the saturated model and each of the other models sequentially.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.