## the abdominal data
m1 <- gamlss(y~pb(x), sigma.fo=~pb(x), data=abdom, family=LO)
plotSimpleGamlss(y,x, model=m1, data=abdom, x.val=seq(15, 40, 5),
ylim=c(0, 450), xlim=c(5, 45))
data(species)
species$ll <- log(species$lake)
m2 <- gamlss(fish~ll, data=species, trace=FALSE, family=PO )
plotSimpleGamlss(fish,ll, model=m2, data=species, x.val=c(3,5,7, 9),
val=20, N=100, ylim=c(0,80))
m3 <- gamlss(fish~ll, data=species, trace=FALSE, family=NBI, sigma.fo=~ll )
plotSimpleGamlss(fish,ll, model=m3, data=species, x.val=c(3,5,7, 9),
val=20, N=100, ylim=c(0,100))
##------------------------------------------------------------------------------
## the rent data
## fitting the model first
r1 <- gamlss(R~pb(Fl), sigma.fo=~pb(Fl),data=rent, family=GA, ylim=c(0, 3000))
## plot 1
plotSimpleGamlss(R,Fl, model=r1, data=rent, x.val=seq(40,120, 5))
## plot 2 finer grid
plotSimpleGamlss(R,Fl, model=r1, data=rent, x.val=seq(40,120, 1),
xlim=c(10,120))
## the same but fitting the model within the function
## note that sigma formula has to be specified
plotSimpleGamlss(R,Fl, formula= R~pb(Fl), family=GA, data=rent,
x.val=seq(40,120, 5), sigma.fo=~pb(Fl))
#------------------------------------------------------------------------------
Run the code above in your browser using DataLab