modelData: Process the data needed for modelling

Description Usage Arguments Value Author(s) Examples

Description

Process the data needed for modelling

Usage

1
2
3
  modelData(y, X, continuous = rep.int(TRUE, ncol(X)),
    nKnots = 4L, splineType = "linear",
    gPrior = c("hyper-g/n", "hyper-g"))

Arguments

y

the numeric response vector

X

the numeric matrix of covariates

continuous

logical vector specifying which covariates really are continous and can be included nonlinearly in a model (default: all covariates are continuous)

nKnots

number of (quantile-based) spline knots (default: 4)

splineType

type of splines to be used (default: “linear”), see makeBasis for possible types.

gPrior

hyperprior for g, either “hyper-g/n” (default) or “hyper-g”.

Value

a list with the internally needed results.

Author(s)

Daniel Sabanes Bove daniel.sabanesbove@ifspm.uzh.ch

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
## get some data
attach(longley)


## try the function
md <- modelData(y=Employed,
                X=cbind(GNP, Armed.Forces))

## look at the results
str(md)


## try again with cubic splines
md <- modelData(y=Employed,
                X=cbind(GNP, Armed.Forces),
                nKnots=10L,
                splineType="cubic")

## look at the results
str(md)

hypergsplines documentation built on May 2, 2019, 6:14 p.m.