APA_Validation: GOF Im Folgenden die wichtige Voraussetzungen der...

Description Usage Arguments Details Examples

View source: R/APA_Validation.R

Description

Das Modell ist linear in den Parametern. Die Residuen sind normalverteilt und im Mittel sind die Residuen null. Die Zahl der Beobachtungen muss größer sein als die Zahl der zu schätzenden Parameter: n > k.

APA_Validation Validation of Linear Models Assumptions (Testing Linear Regression Models)

Multi-collinearity diagnostics

Conducts a series of checks for multicollinearity.

Bei perfekter Multikollinearität lässt sich das Modell nicht lösen.

APA_Autocorrelation: Der Durbi-Watson (DW) Test verwendet die geschaetzten Residuen um auf Autokorrelation erster Ordnung zu testen.

Der DW d Test weist folgendes Intervall auf: 0<d<4 0: Extrem positive Autokorrelation 4: Extrem negative Autokorrelation. 2: Keine Autokorrelation

Der Breusch-Godfrey (BG) Test ist flexibler, da er auf Autokorrelation hoeherer Ordnung testet.

APA_Heteroscedasticity: mit (lmtest::bptest) Breusch-Pagan test against heteroskedasticity

APA_Durbin_Watson: APA_Durbin_Watson(fit, max.lag=1, simulate=TRUE, reps=1000, method=c("resample","normal"), alternative=c("two.sided", "positive", "negative")): Durbin-Watson Test for Autocorrelated Errors. Kopie der Funktion car::durbinWatsonTest

APA2.durbinWatsonTest: Methode für car::durbinWatsonTest Kopie von car:::print.durbinWatsonTest

multicollinearity diagnostic information

VIF (variance inflation factor)

values over 5 are troubling, should probably investigate anything over 2.5.

Fuer Squareds und Correlations design matrix rockchalk::mcDiagnose(fit)

VIF.default lm Methode aus car::vif

APA_vif: variance inflation factor, aka VIF

VIF.merModLmerTest Quelle https://hlplab.wordpress.com/2011/02/24/diagnosing-collinearity-in-lme4/

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
APA_Validation(
  ...,
  include.ftest = TRUE,
  include.loglik = FALSE,
  include.minus.LL = include.loglik,
  include.pseudo = TRUE,
  include.r = include.pseudo,
  include.heteroskedasticity = TRUE,
  include.durbin = TRUE,
  include.levene = FALSE,
  include.bartlett = FALSE,
  include.multicollin = FALSE,
  include.vif = FALSE,
  include.sigma = FALSE,
  include.rmse = FALSE,
  include.aic = TRUE,
  include.bic = include.aic,
  include.residual = TRUE,
  include.normality = TRUE,
  include.deviance = TRUE,
  caption = "Testing Regression Models",
  note = "",
  names = NULL,
  output = which_output()
)

APA_Multicollinearity(
  x,
  caption = "Test for Multicollinearity ",
  note = "",
  include.vif = TRUE,
  include.cor = TRUE,
  output = which_output()
)

APA_Autocorrelation(x, order = 1, ...)

APA_Heteroscedasticity(x...)

APA_Durbin_Watson(
  x,
  caption = "Durbin-Watson Test for Autocorrelated Errors",
  note = NULL,
  ...
)

## S3 method for class 'durbinWatsonTest'
APA2(
  x,
  caption = "Durbin-Watson Test for Autocorrelated Errors",
  note = NULL,
  ...
)

VIF(x, ...)

## Default S3 method:
VIF(x, ...)

APA_vif(..., caption = "VIF", notes = "")

VIF2(..., caption = "VIF", notes = "")

## S3 method for class 'merModLmerTest'
VIF(x, ...)

Arguments

...

weitere Einstellungen

include.ftest, include.loglik

F-sratistik

include.r, include.pseudo

R-Quadrat

include.heteroskedasticity

Breusch-Pagan test

include.durbin

autocorrelation

include.levene

homogeneity of variance across groupssiehe T-Test

include.bartlett

Homogeneity of Variances siehe T-Test

include.vif

noch nicht Implementiert

include.sigma, include.rmse

RMSE Extract Residual Standard Deviation Sigma

caption, note

Ueberschrift an Output

x

fit-Objekt

include.cor

Bivariate Correlations

Details

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
hkarz$Lai <- factor(hkarz$lai, 0:1, Cs(.neg, .pos))
fit2 <- glm(gruppe ~ tzell + Lai, hkarz, family = binomial)
fit1<-lm(score ~ grade + treatment + stdTest, schools)
APA_Validation(x) 
APA_Validation(fit1,fit2, include.pseudo = TRUE, include.r = TRUE, include.loglik = TRUE,
               include.rmse = TRUE)
               
               

# APA_Durbin_Watson
x<-lm(score ~ grade + treatment + stdTest, schools)
APA2(car::durbinWatsonTest(x))
DW_Test2(x)

lmtest::dwtest(x)
car::durbinWatsonTest(x)


## Not run: 
 fit<-lm(prestige ~ income + education, data=Duncan)
 car::vif(fit)
 VIF(fit)

## End(Not run)

stp4/stp25stat documentation built on Sept. 17, 2021, 2:03 p.m.