Description Usage Arguments Details See Also Examples
Takes a dfrr
-object created by dfrr()
and returns predictions
given a new set of values for a model covariates and an optional ydata
-like
data.frame
of observations for the dichotomized response.
1 2 3 4 5 6 7 8 9 10 11 12 |
object |
a fitted |
newdata |
a |
newydata |
(optional) a |
standardized, unstandardized |
a |
return.fourier.coefs, return.evaluations |
a |
time_to_evaluate |
a numeric vector indicating the set of time points for evaluating the predictions, for the case of |
... |
dot argument, just for consistency with the generic function |
This function will return either the Fourier coefficients or the evaluation of
predictions. Fourier coefficients which are reported are
based on the a set of basis which can be determined by basis(dfrr_fit)
.
Thus the evaluation of predictions on the set of time points specified by vector time
,
equals to fitted(dfrr_fit,return.fourier.coefs=T)%*%t(eval.basis(time,basis(dfrr_fit)))
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | set.seed(2000)
N<-50;M<-24
X<-rnorm(N,mean=0)
time<-seq(0,1,length.out=M)
Y<-simulate_simple_dfrr(beta0=function(t){cos(pi*t+pi)},
beta1=function(t){2*t},
X=X,time=time)
dfrr_fit<-dfrr(Y~X,yind=time)
newdata<-data.frame(X=c(1,0))
preds<-predict(dfrr_fit,newdata=newdata)
plot(preds)
newdata<-data.frame(X=c(1,0))
newydata<-data.frame(.obs=rep(1,5),.index=c(0.0,0.1,0.2,0.3,0.7),.value=c(1,1,1,0,0))
preds<-predict(dfrr_fit,newdata=newdata,newydata = newydata)
plot(preds)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.