anova.blm: F-Test

Description Usage Arguments Details Value Examples

View source: R/blm_analysis.R

Description

Anova F-test for comparison of the fits of 2 blm objects.

Usage

1
2
## S3 method for class 'blm'
anova(model1, model2, ...)

Arguments

model1

first, more simple, blm model, nested in model2.#

model2

second, more complex, blm object.

...

other arguments (currently ignored).

Details

Extracts relevant features and compute the F value and the p-value for comparison 2 model fits.

Value

Analysis of Variance Table as for anova.lm.

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
25
26
27
28
29
30
set.seed(1) 
x <- seq(-10,10,.1) 
b <- 0.3

w0 <- 0.2 ; w1 <- 3 ; w2 <- 10

y <- rnorm(201, mean = w0 + w1 * x + w2 *sin(x), sd = sqrt(1/b)) 
mod1 <- blm(y ~ x + sin(x))

## Not run: 
  plot(mod1, xlim=c(-10,10)) 

## End(Not run)

#another mod removing the sinus term, clearly less well fitting
mod2 <- blm(y ~ x)

anova(mod1, mod2)

##much less distinguished model
b <- 0.003
y <- rnorm(201, mean = w0 + w1 * x + w2 *sin(x), sd = sqrt(1/b)) 
mod1 <- blm(y ~ x + sin(x))
## Not run: 
  plot(mod1, xlim=c(-10,10)) 

## End(Not run)
mod2 <- blm(y ~ x)
anova(mod1, mod2) #... still very low p-value !?
  

manschmi/blm documentation built on May 21, 2019, 11:25 a.m.