Description Usage Arguments Details Value Note Author(s) See Also Examples
The function generates a basis matrix including a linear un-transformed variable. It is meant to be used internally by onebasis
and crossbasis
and not directly run by the users.
1 |
x |
the predictor variable. Missing values are allowed. |
intercept |
logical. If |
The function returns a basis matrix with the un-transformed variable, optionally with an intercept if intercept=TRUE
.
A matrix object of class "lin"
. It contains the attribute intercept
.
This function is mainly used internally thorugh onebasis
to create basis matrices. It is not exported in the namespace, and can be accessed through the triple colon operator ':::
' (see Examples below).
Antonio Gasparrini <antonio.gasparrini@lshtm.ac.uk>
onebasis
to generate basis matrices and crossbasis
to generate cross-basis matrices.
See dlnm-package
for an introduction to the package and for links to package vignettes providing more detailed information.
1 2 3 4 5 6 7 8 9 10 | ### simple use (accessing non-exported function through ':::')
dlnm:::lin(1:5)
dlnm:::lin(1:5, intercept=TRUE)
### use as an internal function in onebasis (note the centering)
b <- onebasis(chicagoNMMAPS$pm10, "lin")
summary(b)
model <- glm(death ~ b, family=quasipoisson(), chicagoNMMAPS)
pred <- crosspred(b, model, at=0:60)
plot(pred, xlab="PM10", ylab="RR", main="RR for PM10")
|
This is dlnm 2.3.2. For details: help(dlnm) and vignette('dlnmOverview').
1
[1,] 1
[2,] 2
[3,] 3
[4,] 4
[5,] 5
attr(,"intercept")
[1] FALSE
attr(,"class")
[1] "lin" "matrix"
1 2
[1,] 1 1
[2,] 1 2
[3,] 1 3
[4,] 1 4
[5,] 1 5
attr(,"intercept")
[1] TRUE
attr(,"class")
[1] "lin" "matrix"
BASIS FUNCTION
observations: 5114
range: -3.049835 356.1768
df: 1
fun: lin
intercept: FALSE
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.