splines with time-varying covariates

Hello,
I'm trying to do a spline regression on a time-varying individual covariate (in my full data - age, ranging from 1 to 29 years). I found this post on doing splines with RMark http://www.phidot.org/forum/viewtopic.php?f=21&t=2454, and I can add a time-varying covariate, but I can't seem to make them work together. The model runs, but throws a pile of "truncating string with embedded nuls" warnings, and only returns an intercept coefficient for p. Any help would be appreciated.
I'm trying to do a spline regression on a time-varying individual covariate (in my full data - age, ranging from 1 to 29 years). I found this post on doing splines with RMark http://www.phidot.org/forum/viewtopic.php?f=21&t=2454, and I can add a time-varying covariate, but I can't seem to make them work together. The model runs, but throws a pile of "truncating string with embedded nuls" warnings, and only returns an intercept coefficient for p. Any help would be appreciated.
- Code: Select all
library(RMark)
library(splines)
data(dipper)
# add a fake time-varying covariate, really just an "occurrence" in this case
dipper$td1981 <- 1
dipper$td1982 <- dipper$td1981 + 1
dipper$td1983 <- dipper$td1981 + 2
dipper$td1984 <- dipper$td1981 + 3
dipper$td1985 <- dipper$td1981 + 4
dipper$td1986 <- dipper$td1981 + 5
dipper.processed=process.data(dipper,begin.time=1980)
dipper.ddl=make.design.data(dipper.processed)
data1.analysis=function(){
Phi.dot=list(formula=~1)
p.td.spline=list(formula=~bs(td))
cml=create.model.list("CJS")
mark.wrapper(cml,data=dipper.processed, ddl=dipper.ddl, delete = FALSE)
}
data1.results <- data1.analysis()
data1.results