hw4<-read.csv("***")
x<-hw4[,1] #length of x is n=100
y<-hw4[,2]
n<-100
x_new<-seq_len(20)
index<-sample(x,n,replace=T)
x_boot<-x[index]
y_boot<-y[index]
slr_classic<-lm(y_boot~x_boot)
classic_interval<-predict(slr_classic,newdata=data.frame(x=x_new),interval="confidence")
Here I want to use bootstrapping to creat a confifence interval. However it gives me error like this: "'newdata' had 20 rows but variables found have 90 rows" Having no idea what is going on>>>