VGAM percentile curve plot in R

1.3k views Asked by At

I am running following code from help files of VGAM:

library(VGAM)
fit4 <- vgam(BMI ~ s(age, df = c(4, 2)), lms.bcn(zero = 1), data = bmi.nz, trace = TRUE)
qtplot(fit4, percentiles = c(5,50,90,99), main = "Quantiles", las = 1, xlim = c(15, 90), ylab = "BMI", lwd = 2, lcol = 4) 

enter image description here

How can I just prevent putting points on the plot so that the graph shows only percentile curves? Is there some option in qtplot where I can suppress points on this graph, so that I do not need to resort to long ggplot route as done on this page: Percentiles from VGAM ? In my earlier question there were other issues also so this point got ignored. Thanks for your help.

1

There are 1 answers

5
IRTFM On BEST ANSWER

There is no qtplot help page so I went to the package help Index and saw qtplot.lmscreg listed. It had a 'pcol.arg' to control points color so I set it to "transparent":

qtplot(fit4, percentiles = c(5,50,90,99), main = "Quantiles", las = 1, 
            xlim = c(15, 90), ylab = "BMI", lwd = 2, lcol = 4, 
            pcol.arg="transparent")

enter image description here