a | income | consumption |
1 | 556 | 2760 |
2 | 1622 | 1930 |
3 | 2664 | 2740 |
4 | 3587 | 3515 |
5 | 4535 | 4350 |
6 | 5538 | 5320 |
7 | 6585 | 6250 |
8 | 8582 | 7460 |
9 | 14033 | 11500 |
How do I complete the Breusch-Pagan test to test the residuals @ the 5-percent level?
we are doing Breusch-Pagan test to check whether the residuals obtained after linear regression of consumption (dependent variable) on income( independent variable) have constant variances .ie, homoscedasticity,
we use R software to do the needful.
first we fit linear regression
and then apply Breusch-Pagan test on the fit at 5 % level of significance.
Null hypothesis: homoscedastic(constant variance)
Alternate : heteroscedastic( variance differs )
R code:
install.packages("lmtest")
library(lmtest)
x <- c(556,1622,2664,3587,4535,5538,6585,8582,14033)
y<- c(2760,1930,2740,3515,4350,5320,6250,7460,11500)
fit <- lm(y~x) #regression
bptest(fit)
#pvalue = 0.08344 which is greater than 0.05 ( 5%) , so we fail to reject or accept null hypothesis and conclude on the given data that residuals have constant variances or homoscedastic.
Get Answers For Free
Most questions answered within 1 hours.