Description Usage Arguments Details Value Author(s) See Also Examples
View source: R/ComputerDecision.default.r
Decides whether a fitted lm objects residuals are such that a violation of the assumptions of non linearity, heteroscedasticity, non normality occurs
1 |
fit |
an object returned by |
The computer answer is determined by a sequence of tests.
In particular, a test for non linearity is performed (if the sample size is greater than 30 the program tests for the significance of a non linear regression on the residuals versus x, otherwise Ramsey's RESET test is performed), if the null hypothesis is rejected the computer answer will be non linearity, if not, the Breusch-Pagan test for heteroscedasticity is performed, if the null hypothesis is rejected the computer answer will be heteroscedasticity, otherwise the Shapiro-Wilks test of normality is performed and the answer will be non normality if the null hypothesis is rejected; if no test is significant the answer will be ‘no violation’.
(Functions to perform the tests are from the package lmtest
.)
An integer between 1 and 4 where 1=non linearity; 2=heteroscedasticity; 3=non normality; 4=no violation
Francesco Pauli, francesco.pauli@deams.units.it
1 2 3 4 5 6 7 8 9 | x=rnorm(10)
y=x+rnorm(10,0,0.4)
fit=lm(y~x)
ComputerDecision.default(fit)
x=rnorm(30)
y=x+rt(30,2)
fit=lm(y~x)
ComputerDecision.default(fit)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.