Professional Documents
Culture Documents
If the p-value is less than 0.05, the data does not follow normal distribution.
If p-value is less than 0.05, the data does not follow normal distribution
Obtain VIF
1. Install.packages(“faraway”)
2. Library(farway)
3. Import nks.csv as mydata
4. Model1<- lm(Profits ~ Sales + Price, data=mydata)
5. Summary(Model1) #This gives us a simple linear regression model statistics
6. Vif(model1)
7. We see the VIF for all the variables.
If the VIF of any independent variable is more than 10, there is severe multi-collinearity problem
1. Install.packages(“lmtest”) #you may not need to install, default packages, go to next step
2. Library(lmtest)
3. Import nks.csv as mydata
4. Attach(mydata)
5. Model1 <- lm(Profits~Sales+Price, data=mydata)
6. bptest(Model1)
if the p-value is less than 0.05, we conclude that the data has heteroskedasticity