charts: Easy computing growth charts

View source: R/charts.R

chartsR Documentation

Easy computing growth charts

Description

Computes and returns quantiles as a function of the specified covariate values

Usage

charts(fit, k, file = NULL, digits=2, conf.level=0, 
    dataframe=FALSE, transf=NULL, se.type=c("sandw","boot"), ...)

Arguments

fit

The object fit returned by gcrq

k

Numeric indicating the covariate values. If integer (and scalar, specified via 5L, say) , k equispaced values in the covariate range are taken.

file

If specified, the (path) file name wherein the returned matrix including the quantiles will be written via write.csv()

digits

Number of digits whereby the estimated quantiles are rounded.

conf.level

If larger than zero, the pointwise confidence intervals for the estimated quantiles are also returned. If conf.level=0 the simple point estimates.

dataframe

Logical. If TRUE and conf.level>0 a dataframe is returned having point estimate and confidence intervals collapsed. Otherwise a matrix having number of rows equal to the number of covariate values.

transf

An optional character string (with "y" as argument) meaning a function to apply to the predicted values. E.g. "(exp(y)-0.1)". If NULL (default) it is taken as the inverse of function transf (*if*) supplied in gcrq. The standard errors (provided se.fit=TRUE has been set) are adjusted accordingly via the Delta method. See argument "transf" in gcrq(). If transf has been specified in gcrq(), use transf="y" to force predictions on the transformed scale, i.e. without back transforming.

se.type

Which covariance matrix should be used, provided that conf.level>0. See type in predict.gcrq.

...

Further arguments passed on to write.csv()

Details

This function is simply a wrapper for predict.gcrq

Value

A matrix having number of columns equal to the number of quantile curves and number of rows depending k

Note

charts just works with models having a single smooth term. See predict.gcrq when the model involves multiple covariates.

Author(s)

Vito Muggeo

See Also

predict.gcrq

Examples

## Not run: 
charts(_fit_, k=1L) #prediction at the minimum of covariate
charts(_fit_, k=1) #prediction at covariate value 1.

charts(_fit_, k=10L)
  
## End(Not run)

quantregGrowth documentation built on July 9, 2023, 6:06 p.m.