Displaying 1 result from an estimated 1 matches for "date_b".
Did you mean:
data_b
2011 Sep 28
0
Fitting a GLM: Problems with ns & date functions
...ages loaded for use within my wider data analysis
library(splines)
library(xtable)
library(tsModel)
library(lattice)
library(mda)
library(gam)
## splines: For date there are 4 seasons across 5 years
## splines: For temp cold and warm seasons are 6 months long
fit <- glm(J00_99 ~ NOX_LIN + ns(DATE_B, 4 * 5) + ns(TEMP_LIN, 6),
data = data, family = poisson)
### Error in (1 - h) * qs[i] : non-numeric argument to binary operator
pr <- predict(fit, type = "terms")
### Error in predict(fit, type = "terms") : object 'fit' not found
## [2] Attempt 2: F...