lm example

library('sigr')
set.seed(352532)
d <- data.frame(x=1:10, z=c(4,5))
d$y <- 2*d$x + 0.1*rnorm(nrow(d))
model <- lm(y~x+z, data=d)
d$pred <- predict(model, newdata = d)

s <- summary(model)
print(s)
print(s$fstatistic)
cat(render(wrapFTest(model),
    pSmallCutoff=0))
cat(render(wrapFTest(d, 'pred', 'y', nParameters=2),
    pSmallCutoff=0))

Intentionally forget to inform wrapFTest of the true number of parameters:

cat(render(wrapFTest(d, 'pred', 'y'),
    pSmallCutoff=0))


Try the sigr package in your browser

Any scripts or data that you put into this service are public.

sigr documentation built on Aug. 20, 2023, 9:06 a.m.