plot.predict.dfrr: Plot dfrr predictions

Description Usage Arguments Details References Examples

View source: R/plot.predict.dfrr.R

Description

Plot a predict.dfrr object.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## S3 method for class 'predict.dfrr'
plot(
  x,
  id = NULL,
  main = id,
  col = "blue",
  lwd = 2,
  lty = "solid",
  cex.circle = 1,
  col.circle = "black",
  ylim = NULL,
  ...
)

Arguments

x

a predict.dfrr-object

id

a vector of length one or more containing subject ids to plot. Must be matched with rownames(newdata). Defaults to all subject ids.

main

a vector of length one or length(id) containing the title of plots.

col, lwd, lty, ...

graphical parameters passed to plot

cex.circle, col.circle

size and color of circles and filled circles.

ylim

a vector of length two indicating the range of y-axis of the plot.

Details

The output is the plot of predictions of latent functions given the new covariates. For the case in which newydata is also given, the predictions are plotted over the observed binary sequence. The binary sequence is illustrated with circles and filled circles for the values of zero and one, respectively.

References

Choi, H., & Reimherr, M. A geometric approach to confidence regions and bands for functional parameters . Journal of the Royal Statistical Society, Series B Statistical methodology 2018; 80:239-260.

Examples

 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)

asgari-fatemeh/dfrr documentation built on Aug. 12, 2020, 3:06 a.m.