ComputerDecision.default {lmviz}R Documentation

Computer player decision

Description

Decides whether a fitted lm objects residuals are such that a violation of the assumptions of non linearity, heteroscedasticity, non normality occurs

Usage

ComputerDecision.default(fit)

Arguments

fit

an object returned by lm

Details

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.)

Value

An integer between 1 and 4 where 1=non linearity; 2=heteroscedasticity; 3=non normality; 4=no violation

Author(s)

Francesco Pauli, francesco.pauli@deams.units.it

See Also

Simulation.default, checksim

Examples

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)


[Package lmviz version 0.2.0 Index]