Prestige <- read.table('http://math.uttyler.edu/nathan/classes/statistics/data/prestige.data',header=TRUE) attach(Prestige) m1 <- lm(prestige ~ income + education + census + women) summary(m1) #prestige_i = b0+ b1 income_i + b2 education_i + b3 census_i + b4 women_i + e_i #H0: b_1 = 0 #H1: b_1 =/= 0 #H0: all other terms in model, income has no extra effect on prestige #H1: all other terms in model, income has an extra effect on prestige # p-value = 1.15e-05 # really small, so reject H0, conclude b_1 =/= 0 # #H0: b_2 = 0 #H1: b_2 =/= 0 # p-value = 7.38e-12 # really small, so reject H0, concluce b_2 =/= 0 # book calles this one the ``omnibus F test'' #H0: b_1 = b_2 = b_3 = b_4 = 0 #H0: at least one b_i (i > 0) is not zero #H0: none of the variables contributes (linearly) to an understanding # of prestige #H1: at least some of our variables contribute to an understanding of # the variability in prestige # p-value: 2.2e-16 (i.e. 0.0000000000000002) # reject H0 #### Let's look at the above in terms of comparing models: #H0: b_1 = 0 #H1: b_1 =/= 0 # this test compares the models: #H0: prestige_i = b0+ b2 education_i + b3 census_i + b4 women_i + e_i #H1: prestige_i = b0+ b1 income_i+b2 education_i+b3 census_i+b4 women_i + e_i #H0: b_1 = b_2 = b_3 = b_4 = 0 #H0: at least one b_i (i > 0) is not zero #this test compares the models: #H0: prestige_i = b0 + e_i #H1: prestige_i = b0+ b1 income_i+b2 education_i+b3 census_i+b4 women_i + e_i # looking at the regression output, we'd like to compare these two models: #H0: prestige_i = b0+ b1 income_i+b2 education_i+ e_i #H1: prestige_i = b0+ b1 income_i+b2 education_i+b3 census_i+b4 women_i + e_i # here's how to do that. First you need to build both models: m1 <- lm(prestige ~ income + education + census + women) m2 <- lm(prestige ~ income + education) anova(m1,m2) # this tests: #H0: b_3 = b_4 = 0 #H1: at least one of b_3, b_4 non-zero # p-value: .562 -- fail to reject H0 -- safe to use smaller model