View source: R/fix_family_qf.R
fix_family_qf | R Documentation |
Fix $qf() slot of a mgcv family.
fix_family_qf(fam)
fam |
an |
library(mgcvUtils); library(MASS)
b <- gam(list(accel~s(times,k=20,bs="ad"),~s(times)),
data=mcycle,family=gaulss())
b$family <- fix_family_qf( b$family )
qfit <- sapply(c(0.1, 0.5, 0.9),
function(.q)
b$family$qf(.q, b$fitted.values))
plot(mcycle, ylim = c(-150, 100))
for(ii in 1:ncol(qfit)){
lines(mcycle$times, qfit[ , ii], col = 2)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.